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 (), 16,302 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
i have an issue #215471
07/11/08 12:36
07/11/08 12:36
Joined: Aug 2005
Posts: 199
houston
S
seneca Offline OP
Member
seneca  Offline OP
Member
S

Joined: Aug 2005
Posts: 199
houston
just recently switched to A7 LiteC and converted the code. I have a couple of bugs, but the most pressing is how to attach an array of particle generators, particles to an array of models.

let me explain.

i have a scene where i had several candles moving up and down randomly with flames. the candles are models and attached to them are the particle generators. the flames are particles.

it was working before i converted, but now i don't know what to do to get it to work.

the engine tells me that the particle isn't part of the functions, class or some junk like that. any help would be appreciated.

I can get the code and paste it here if it helps.

Last edited by seneca; 07/11/08 12:37.

a8 commercial
Re: i have an issue [Re: seneca] #215483
07/11/08 14:05
07/11/08 14:05
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You dont can use the my-Pointer. Try this:

void RAUCH_VERSCHWINDEN(PARTICLE *p)
{
p.alpha -= 3.6 * time;
if (p.alpha < 0) p.lifespan = 0;
}

void INIT_RAUCH(PARTICLE *p)
{
p.alpha = 50;
p.lifespan = 100;
p.bmap = Rauch_tga;
p.event = RAUCH_VERSCHWINDEN;
set(p,MOVE);
}

action FEUER()
{
....
....
effect (INIT_RAUCH, 1, my.x, Temp_vec1);
}

Re: i have an issue [Re: Widi] #215530
07/11/08 20:35
07/11/08 20:35
Joined: Aug 2005
Posts: 199
houston
S
seneca Offline OP
Member
seneca  Offline OP
Member
S

Joined: Aug 2005
Posts: 199
houston
i can't use void in front of the functions. I get a syntax error. when i use the code that should work the engine tells me that i have an invalid argument in 'fire'

i don't know how to get it to work like it should.


this is part of the candle action...

Code:
action candle()
{
	candle_cnt += 1;  // used for unique id. already set to 99 in var_wdl
	//VECTOR tempz[3];
	
	if(candle_cnt == 1)
	{
		candle_ent1 = me;
		my.skill30 = candle_cnt; // unique id # + 1 = 100
		
	}
	if(candle_cnt == 2)
	{
		candle_ent2 = me;
		my.skill30 = candle_cnt; // unique id #
		
	}
	if(candle_cnt == 3)


below is the fire code...


Code:
action fire() 
{
	cfire_cnt += 1; //my counter
		//PARTICLE* p;
	if(cfire_cnt == 1)
	{
		cfire_ent1 = me;
		my.skill30 = cfire_cnt;
		while(!candle_ent1){ wait(1); }
		my.z = candle_ent1.z + 16;
		//my.passable = on;
		set(my, PASSABLE);
		temp.x=my.x;
		temp.y=my.y;
		temp.z=my.z;
		effect(fire_effect,20*time_step,temp,temp);
		//my.event = fire_do(my);
		//fire_do();
	}
	/*if(cfire_cnt == 2)
	{
		cfire_ent2 = me;
		my.skill30 = cfire_cnt;
		my.event = fire_do;
	}
	if(cfire_cnt == 3)
	{
		cfire_ent3 = me;
		my.skill30 = cfire_cnt;
		my.event = fire_do;
	}


here is the particle part....

Code:

//for candles
function fire_effect(PARTICLE *p)
{
	
	randomize();
	p.x+=random (3*(sin(total_ticks*20) * cos(total_ticks*5)));

	p.y+=random (3*(sin(total_ticks*20) * sin(total_ticks*5)));

	//my.lightrange = 2;
	p.size=3;
	p.vel_x=0;
	p.vel_y=0;
	p.vel_z=2+random(2);
	p.flags |= BRIGHT|MOVE;  //my.move=on;
	p.lifespan=2;
	p.red=255;
	p.green=255;
	p.blue=0;
	set(me,TRANSLUCENT);  //my.transparent=on;
	//p.event=fire_property;
}

function fire_property()
{
	my.red-=5*time_step;
	my.green-=15*time_step;
}

function fire_do(PARTICLE* p)  //function fire_do(ENTITY* fcnt)
{
	set(me, PASSABLE);
	//var whatev[];
	while(1) 
	{
		//if(my.skill30 == 1)
		//{
			while(!candle_ent1){ wait(1); }
			p.z = candle_ent1.z + 16;
			set(my, PASSABLE);
			temp.x=p.x;
			temp.y=p.y;
			temp.z=p.z +36;
			effect(fire_effect,20*time_step,temp,temp);//fire_start(p);
		//}
	




a8 commercial
Re: i have an issue [Re: seneca] #215666
07/12/08 18:29
07/12/08 18:29
Joined: Aug 2005
Posts: 199
houston
S
seneca Offline OP
Member
seneca  Offline OP
Member
S

Joined: Aug 2005
Posts: 199
houston


I think i got it narrowed down to the effect code

effect(fire_effect,20*time_step,temp,temp);

when i comment out the line above, the engine gives me no errors.

but of course i also get no fire. Also, no matter where i place the above
effect code, i always get an error, even when the function is empty.

ie...

//for candles
function fire_effect(PARTICLE *p)
{

wait(1);
}

i get an engine error that says "invalid argument in fire" so what is wrong with the effect or what is wrong with the function? Does anyone know?


a8 commercial
Re: i have an issue [Re: seneca] #215677
07/12/08 19:36
07/12/08 19:36
Joined: Aug 2005
Posts: 199
houston
S
seneca Offline OP
Member
seneca  Offline OP
Member
S

Joined: Aug 2005
Posts: 199
houston
Nevermind, i found the problem...finally.

thanks anyway!


a8 commercial
Re: i have an issue [Re: seneca] #215690
07/12/08 20:45
07/12/08 20:45
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
It's always best to share your solution, that way many people can learn from it and don't have to create unnecessary posts.


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