0 registered members (),
16,302
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
i have an issue
#215471
07/11/08 12:36
07/11/08 12:36
|
Joined: Aug 2005
Posts: 199 houston
seneca
OP
Member
|
OP
Member
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: Widi]
#215530
07/11/08 20:35
07/11/08 20:35
|
Joined: Aug 2005
Posts: 199 houston
seneca
OP
Member
|
OP
Member
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...
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...
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....
//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
seneca
OP
Member
|
OP
Member
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
seneca
OP
Member
|
OP
Member
Joined: Aug 2005
Posts: 199
houston
|
Nevermind, i found the problem...finally.
thanks anyway!
a8 commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|