Welcome to FireScript Animation. FireScript is a new WIP script of functions that will make fire effects in your game easier. The fire effects were initially made for KRO (Kaos Realm Online) but I decided to start building it up to release it for everyone.
V 1.0
Here is a short Video capture of Firescript in work. (the video might make the fire look choppy, but its actually alot smoother)
http://www.kaosrealmonline.com/FireScript.wmv
And here is the media.
[href]http://www.kaosrealmonline.com/Fire Images-EXTRACT.zip[/href]
As you can see, in V 1.0 you can have multiple fires simultaeneosly running.
The images used for the fire are not mine, and I do not intend to take all the credit for them. I did not draw them, I used them.
Here are the 3 easy WIP functions used to use FireScript.
Function 1
loadfire(i1#,i2#,i3#,i4#,i5#,i6#,i7#,i8#)
What this function does, placed at the top of your program (after sync setup) is load the 8 fire images for the fire into the 8 image numbers you choose.
function loadfire(i1#,i2#,i3#,i4#,i5#,i6#,i7#,i8#)
load image "flame1.bmp",i1#
load image "flame2.bmp",i2#
load image "flame3.bmp",i3#
load image "flame4.bmp",i4#
load image "flame5.bmp",i5#
load image "flame6.bmp",i6#
load image "flame7.bmp",i7#
load image "flame8.bmp",i8#
endfunction
Put this function at the end of your entire game code.
Function 2
setupfire(onum#,sx,sy,x,y,z)
This function, placed right after the first function, is used to make the fire object. 'onum#' would be the object number of the fire you are making. 'sx' and 'sy' and the size on the x and y axis' of the fire you are making. 'x' 'y' and 'z' are the positions of the fire object you are making.
function setupfire(onum#,sx,sy,x,y,z)
make object plain onum#,sx,sy : yrotate object onum#,180 : fix object pivot onum# : position object onum#,x,y,z
endfunction
Put this function at the end of your entire game code.
Function 3
controlfire(onum#,i1#,i2#,i3#,i4#,i5#,i6#,i7#,i8#)
This funtion, used inside the main loop, is of course used to control the fire. 'onum#' would be the fire object number you are controling. 'i' 1 through 8 would be the image numbers of the fire images you loaded in the first function.
function controlfire(onum#,i1#,i2#,i3#,i4#,i5#,i6#,i7#,i8#)
if firecount#=1 then texture object onum#,i1#
if firecount#=4 then texture object onum#,i2#
if firecount#=7 then texture object onum#,i3#
if firecount#=10 then texture object onum#,i4#
if firecount#=13 then texture object onum#,i5#
if firecount#=16 then texture object onum#,i6#
if firecount#=19 then texture object onum#,i7#
if firecount#=22 then texture object onum#,i8# : firecount#=-2
set object to camera orientation onum#
set object transparency onum#,1
endfunction
Put this function at the end of your entire game code.
The only last thing you have to do is place the code:
global firecount#
firecount#=-2
-Right after your sync setup to make the variable 'firecount#' usable in all functions.
An Example of all this is right here (be sure to have the media in the same folder as the EXE) :
Sync on
global firecount#
firecount#=-2
loadfire(301,302,303,304,305,306,307,308)
setupfire(300,20,30,0,0,0)
setupfire(301,20,30,-13,4,5)
setupfire(302,20,30,-26,2,0)
setupfire(303,20,30,13,3,5)
Do
inc firecount#,1
controlfire(300,301,302,303,304,305,306,307,308)
controlfire(301,301,302,303,304,305,306,307,308)
controlfire(302,301,302,303,304,305,306,307,308)
controlfire(303,301,302,303,304,305,306,307,308)
sync
loop
function loadfire(i1#,i2#,i3#,i4#,i5#,i6#,i7#,i8#)
load image "flame1.bmp",i1#
load image "flame2.bmp",i2#
load image "flame3.bmp",i3#
load image "flame4.bmp",i4#
load image "flame5.bmp",i5#
load image "flame6.bmp",i6#
load image "flame7.bmp",i7#
load image "flame8.bmp",i8#
endfunction
function setupfire(onum#,sx,sy,x,y,z)
make object plain onum#,sx,sy : yrotate object onum#,180 : fix object pivot onum# : position object onum#,x,y,z
endfunction
function controlfire(onum#,i1#,i2#,i3#,i4#,i5#,i6#,i7#,i8#)
if firecount#=1 then texture object onum#,i1#
if firecount#=4 then texture object onum#,i2#
if firecount#=7 then texture object onum#,i3#
if firecount#=10 then texture object onum#,i4#
if firecount#=13 then texture object onum#,i5#
if firecount#=16 then texture object onum#,i6#
if firecount#=19 then texture object onum#,i7#
if firecount#=22 then texture object onum#,i8# : firecount#=-2
set object to camera orientation onum#
set object transparency onum#,1
endfunction
Thanks, hope it helps,
-Xeno
P.S. remember there will be more functions and the current 3 functions will be updated in the new versions.
"Forgiveness is a good thing"
"Forgiveness is between them, and God. I set up the meeting"
-Man on Fire