Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Torch for RPG #161598
10/17/07 15:53
10/17/07 15:53
Joined: Jun 2007
Posts: 11
W
whidky68 Offline OP
Newbie
whidky68  Offline OP
Newbie
W

Joined: Jun 2007
Posts: 11
I'm trying to make a good torch for my game in 3dgs but I'm having trouble. I can't get the flame file for one of the tutorials to get it working. Also, maybe there is a better way. Help please!!

Re: Torch for RPG [Re: whidky68] #161599
10/17/07 16:45
10/17/07 16:45
Joined: Oct 2007
Posts: 42
Minnesota, USA
Techd Offline
Newbie
Techd  Offline
Newbie

Joined: Oct 2007
Posts: 42
Minnesota, USA
Use a sprite as target(place the sprite where you would like the flame to ignite)

set the sprite invisible and use this code.

Code:

BMAP fire_map,<fire.tga>;//this is the fire


var parray [1801]; // will be used as a 300*6 multi dimensional array
// each of the 300 entries will consist of: 0 = flag, 1 = x_pos, 2-5 = data slots
var ppoint = 0; // points to the next free entry-slot, is set through searcharray()


function sarray() {
ppoint = 0;
while (parray [ppoint*6] != 0) { ppoint += 1; }
}

action my_fire {
sarray(); // look for free array slot
if (ppoint >= 300) { END; } // stop action if too many emitters already present
my.skill14 = ppoint; // set skill14 accordingly
parray[my.skill14 * 6] = 1; // set flag of the slot to occupied
if (my.skill8 == 0) { my.skill8 = 4; } // rate 0 defaults to 4
if (my.skill7 == 0) { my.skill7 = 1; } // size 0 defaults to 1
if (my.skill7 < 0.2 && my.skill7 != -1) { my.skill7 = 0.2; } // check size values and correct them
if (my.skill7 > 3) { my.skill7 = 3; }
while(1) { // fire burns forever
if (my.skill7 > 0) { // check if fire is turned ON
my.skill13 -= 1; // decrease emit counter
if (my.skill13 <= 0) {
my.skill13 = my.skill8 / TIME; // set counter according to skill8

parray[my.skill14 * 6 +2] = my.skill7; // set size value in array

parray[my.skill14 * 6 +1] = my.x + (random(4) - 2) * my.skill7; // set pos.x value in array
my.skill10 = my.skill14; // array pointer stored in x_pos
my.skill11 = my.y + (random(4) - 2) * my.skill7; // set pos.y for emit
my.skill12 = my.z; // set pos.z for emit
emit(1,my.skill10,feuer_particle); // emit particle

parray[my.skill14 * 6 +1] = my.x + (random(4) - 2) * my.skill7; // set new pos.x
my.skill11 = my.y + (random(4) - 2) * my.skill7; // set new pos.y
emit(1,my.skill10,feuer_particle); // emit second particle
}
}
wait(1);
}
}


function feuer_particle(){
if(my_age == 0) {
my_alpha = 0; // set to invisible at start
my_color.blue = parray[my_pos.x * 6 + 2]; // get size from array
my_pos.x = parray[my_pos.x * 6 + 1]; // restore real pos.x
my_speed.z = (1.7+random(0.4)) * my_color.blue; // set speed.z
my_color.red = random (100); // set some random values
my_color.green = random (100);
my_size = (2000+random(300)) * my_color.blue; // set size
my_map = fire_map; // set map
my_flare = on; // set to transparent (my_transparent seems to be buggy on some graphics cards
my_bright= on; // set my_bright to achieve the gloving effect
END;
}
if (my_age > 30) { // kill particle if too old
MY_ACTION = NULL;
}
if (my_age > 7) { // set alpha according to age
my_alpha = 100-MY_AGE*3.3;
} else { my_alpha = my_age * 10; }

my_speed.x = (sin(my_age*7+my_color.red) / 7) * my_color.blue; // play with speed values
my_speed.y = (cos(my_age*8+my_color.green) / 7) * my_color.blue;
}

This should get the fire going!

o yea a decent effect is to have a flickering light!

so try this..

place a light underneth your torch and use this code


ACTION fire_light
{
my.invisible = on;
my.red = 50;
my.green = 5;
my.blue = 2;
while(1)
{
waitt(1);
MY.LIGHTRANGE = 0;
MY.LIGHTRANGE = int(Random(175)) + 12;
wait(1);
}
}




Last edited by rvL_eXile; 10/17/07 16:51.

Life is what you make it just like Games!
Re: Torch for RPG [Re: Techd] #161600
10/17/07 16:53
10/17/07 16:53
Joined: Apr 2005
Posts: 3,076
Germany, NRW
rvL_eXile Offline

3D Artist
rvL_eXile  Offline

3D Artist

Joined: Apr 2005
Posts: 3,076
Germany, NRW
In the Aum between 30-40 is a Torch exmaple for more Informations and detailled explantation!

@Techd: (Have Edited youre Post)
Please use the [ code] & [ /code] tags to show your Code Snipped!

Last edited by rvL_eXile; 10/17/07 16:53.

Tutorials:
[Blender]Terrain creation ENG/GER
[Blender]Low Poly Tree Modeling
[GIMP]Create a Texture for Terrains
CLICK HERE


Re: Torch for RPG [Re: rvL_eXile] #161601
10/17/07 17:58
10/17/07 17:58
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Cool, good commenting

Re: Torch for RPG [Re: Nems] #161602
10/17/07 18:29
10/17/07 18:29
Joined: Oct 2007
Posts: 42
Minnesota, USA
Techd Offline
Newbie
Techd  Offline
Newbie

Joined: Oct 2007
Posts: 42
Minnesota, USA
I try to be as specific as possible

Just have to remember Code:
  

tags


Life is what you make it just like Games!
Re: Torch for RPG [Re: Techd] #161603
10/18/07 01:15
10/18/07 01:15
Joined: Jun 2007
Posts: 11
W
whidky68 Offline OP
Newbie
whidky68  Offline OP
Newbie
W

Joined: Jun 2007
Posts: 11
Thanks for your help Techd!

Re: Torch for RPG [Re: whidky68] #161604
10/18/07 04:52
10/18/07 04:52
Joined: Oct 2007
Posts: 42
Minnesota, USA
Techd Offline
Newbie
Techd  Offline
Newbie

Joined: Oct 2007
Posts: 42
Minnesota, USA
Glad I could help!


Life is what you make it just like Games!

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1