Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Where to put this code? #162693
10/21/07 22:38
10/21/07 22:38
Joined: Jun 2007
Posts: 11
W
whidky68 Offline OP
Newbie
whidky68  Offline OP
Newbie
W

Joined: Jun 2007
Posts: 11
I have my torch and flame ready to go but I cannot get the sample code to work from the questiona nd answer section of aum 31. I put the code in the main script file of my game but I get a 'empty pointer' error message. Can anyone help?


-code listing-

Q: Trying to set up a simple fire effect for torches is beyond my comprehension. Can you help?
A: Sure. Use the code below:

bmap fire_map = <flame.tga>;

function fire_init();
function fade_away();

action fire_generator
{
my.invisible = on;
my.passable = on;
while (1)
{
effect(fire_init, 1, my.pos, normal);
wait (1);
}
}

function fire_init()
{
my.bmap = fire_map;
my.alpha = 12; // play with this value
my.size = 5;
my.flare = on;
my.bright = on;
my.move = on;
my.x += 2 - random (4);
my.y += 2 - random (4);
my.z += 1 + random (1);
my.function = fade_away;
}

function fade_away()
{
my.alpha -= 0.5 * time;
if (my.alpha <= 0)
{
my.lifespan = 0;
}
}

Re: Where to put this code? [Re: whidky68] #162694
10/21/07 22:59
10/21/07 22:59
Joined: Jun 2007
Posts: 11
W
whidky68 Offline OP
Newbie
whidky68  Offline OP
Newbie
W

Joined: Jun 2007
Posts: 11
Nevermind.

I got it working. It's in a separate .wdl file as an action script. Well, I'm figuring some things out and with the help of those on the forum things are getting a bit clearer. It's just tough migrating here from darkbasic lol.

Re: Where to put this code? [Re: whidky68] #162695
10/21/07 23:29
10/21/07 23:29
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Oh I fixed the code a little for A7, but you got it working.. Guess you're still using A6?


smile
Re: Where to put this code? [Re: D3D] #162696
10/22/07 01:18
10/22/07 01:18
Joined: Jun 2007
Posts: 11
W
whidky68 Offline OP
Newbie
whidky68  Offline OP
Newbie
W

Joined: Jun 2007
Posts: 11
I'm actually using gstudio7

I put the code in as a wdl file and added to my project as a script and it did work in a7. I couldn't find the torch model or the flame.tga bmap in aum31 download but I finally found them in one of the later aum files.


Gamestudio download | 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