Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / is there a quicker way of doing this?

Author
Message
FROGGIE!
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 1st May 2004 15:52
ive got 20 textures and the only way i know of loading them is like this:

LOAD IMAGE "name.bmp",1
LOAD IMAGE "name.bmp",2
LOAD IMAGE...

ive tried

FOR a = 1 TO 20
LOAD IMAGE "name";a;".bmp",a
NEXT a

but it doesnt work. can anyone help?

I should have changed my signature when asked
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 1st May 2004 16:55
thats because load image needs a string parameter, not a integer.

You were on the right way:

For a = 1 to 20
Load image "name"+str$(a)+".bmp",a
Next a

Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 2nd May 2004 04:57 Edited at: 2nd May 2004 05:00
A more complex method would be to create a loading script which contains a list of the files you want to load. Open the file, read the names, load the files, repeat until dones, close the script and carry on. This would allow you to add or subtract files as needed. You can make the script even more flexible by reading in the images IDs and other data as well. That way you're not locked into sequential file names, etc. Lots of room to play with that idea.
--
TAZ

As an example, you can really go off the deep end if you want. Here is an sample VirMin file. It's a combination of game setup and level loading script. It loads the maps, models, props, game data, custom dice, critical hit tables, etc. for a tactical space ship war game. Using a different script, the game engine could load in a dungeon crawl scenario or a game of chess.



Login to post a reply

Server time is: 2025-05-23 14:01:49
Your offset time is: 2025-05-23 14:01:49