Help!

Blitz3D Forums/Blitz3D Programming/Help!

Caton(Posted 2015) [#1]
I want to write bytes,int,files to tpc server in blitz3d. help!


Caton(Posted 2015) [#2]
<Post Removed>


Matty(Posted 2015) [#3]
Read the documentation.

Look up the TCP commands...

It's all there.

EDIT - and look at the code archives and samples..


Caton(Posted 2015) [#4]
Thanks


Zethrax(Posted 2015) [#5]
Also don't just use 'Help!' as your topic title. If you're looking for help from people then you need to provide them with as much information as possible about the problem that you need help with. 'Help!' as the topic title in a help forum is completely redundant and provides no useful information to the people you're asking for help from.


Caton(Posted 2015) [#6]
I can't find anything that has where it will write a exe file to the server and run it from the server. how could I do that?


Matty(Posted 2015) [#7]
Most servers won't run an exe anyway since most run on a form of Linux. Secondly most shared hosts won't let you run arbitrary code like that. Thirdly running an exe is an entirely different question than uploading bytes to a location.


Caton(Posted 2015) [#8]
okay.
in blitz3d how do I load game assets from a file in range
format
filedata.dat
name of file - string
range file localion - int
filepack.dat
are all the files in big file.
I doing this to protect my asset

please make ab explame of loading an image from filepack.dat in range of files in one big file.

the secone file in range int in filedata.dat is 2178
I made a program to pack the data and assets.
but how to read assets and load into my game.


Matty(Posted 2015) [#9]
If you made a program to pack the data and assets (your own words) - surely you just read the data back in the same way?

however example in pseudo code of loading an image from a file....

open file to read
read header
assuming header stores offsets to image locations in file then
seek to each of these offsets and read the bytes in from that location up to the maximum length expected.
Take the bytes that were read in and perform the relevant operation on them to produce an image - ie you will need to know the width, height and bit depth (at the most basic level) and then simply read the pixel data in....and draw to an image buffer 1 pixel at a time....


Matty(Posted 2015) [#10]
http://www.blitzbasic.com/b3ddocs/command.php?name=ReadFile&ref=2d_cat

that should get you started....pressing F1 in the IDE and going to the command reference will bring the same thing up..


Caton(Posted 2015) [#11]
not working!
monster\monstertexture=LoadTexture("packfile.dat")
SeekFile(monster\monstertexture,0)


Matty(Posted 2015) [#12]
You are going to have to put a little more effort in than that......


Caton(Posted 2015) [#13]
please show me an example.


Guy Fawkes(Posted 2015) [#14]
for Dat files, you can't just read the file. You have to know what exactly it is in the file that you're reading. For instance: Is it a string? Is it an integer? Is it a number? Then you need to craft a function using "OpenFile()" & "ReadLine()" or "ReadByte()" & "EOF()" or however it is you wish to read your dat file, and then read out the whole file by doing this:



I hope that helps! :) I'm not really that into writing DAT files, but perhaps someone else here can help you better based ON my above knowledge!

Good Luck!

Sincerely,

~GF


jfk EO-11110(Posted 2015) [#15]
what is packfile.dat anyway? A zipfile? Find that out, then use the required extractor to extract the texture. For example there is a zip library for blitz somewhere. Also use the forum search functions, it may point you to answers to your questions.


Guy Fawkes(Posted 2015) [#16]
Man aren't YOU a lucky S.O.A.B? lol! I used the search function, and found THIS:

http://www.blitzbasic.com/codearcs/codearcs.php?code=3186


Matty(Posted 2015) [#17]
please show me an example.


Already did....pseudocode, manual entry on site (shows a perfectly good example), the F1 help in the IDE....it's all there both available online and offline.....


Caton(Posted 2015) [#18]
I meant was where I use use seekfile for like loadimage or loadsound. it only works with openfile.
and packfile.dat it's just all the files pack in one file not zip file.
I use hex editor to view the file not with windows text editor.


Caton(Posted 2015) [#19]
I just need some help here with loading my game assets from the packfile.