I have a collection of sprites in the following directory:
/G-Force/Sprites/(Non-Auto)/SongX
The files are named 00SongX.jpg, 01SongX.jpg... all the way up to 20SongX.jpg
Now, suppose I wanted to create a script like "CTRL X.txt" that would randomly display all those sprites in that directory.
It seems like "rnd(20)SongX;" or even "SongX;" should work, but it does not.... Am I way off?
Where might I get additional well-documented scripts to study?
Scripting newbie
Moderators: BTT, andy55, b.dwall, juxtiphi
Re: Scripting newbie
When G-Force 2.6.6 comes out (less than a week), use a script like:FunkyD wrote:I have a collection of sprites in the following directory:
/G-Force/Sprites/(Non-Auto)/SongX
The files are named 00SongX.jpg, 01SongX.jpg... all the way up to 20SongX.jpg
Now, suppose I wanted to create a script like "CTRL X.txt" that would randomly display all those sprites in that directory.
It seems like "rnd(20)SongX;" or even "SongX;" should work, but it does not.... Am I way off?
Where might I get additional well-documented scripts to study?
StartSprite( sprintf( "%dSongX", rnd( 20.999 ) ) );
Since %d means integer, the decimal part of your random number will just get chopped off. Also note that the numbers woud go from 0 to 20 (21 possibilities in this case). If you wanted to to from 1 to 20, use something like:
1 + rnd( 19.999 )
Re: Scripting newbie
That'd be as close to PERFECT as one could ask (for the money)! It appears that I may have been looking at scripting dox from a way older version of G-Force... or is the fortcoming scripting language syntax that radically different than it's predecessor(s)?When G-Force 2.6.6 comes out (less than a week), use a script like:
Will more new documented scripts come with 2.6.6?
Doot, do you sleep?
-d