2 registered members (AndrewAMD, TipmyPip),
12,420
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Effects in C-Lite?
#124547
04/17/07 00:05
04/17/07 00:05
|
Joined: Sep 2006
Posts: 128 Sweden
Tiinusen
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 128
Sweden
|
Hi i got a major problem. my game crashes when i uses the effect function in C-Lite. i post a code snippet that uses the function. Code:
// helper function: sets the vector to random direction and length function vec_randomize (var* vec, var range) { vec[0] = random(1) - 0.5; vec[1] = random(1) - 0.5; vec[2] = random(1) - 0.5; vec_normalize(vec,random(range)); }
// helper function: fades out a particle function part_alphafade(PARTICLE *p) { p.alpha -= 2*time_step; if (p.alpha <= 0) p.lifespan = 0; }
// particle function: generates a fading explosion into vel direction function effect_explo(PARTICLE *p) { var temp[3]; vec_randomize(temp,10); vec_add (p.vel_x, temp); p.alpha = 25 + random(25); p.bmap = "blood.tga"; p.flags |= (BRIGHT | MOVE); p.event = part_alphafade; // change to a shorter, faster function }
function hit() { if(event_type == EVENT_ENTITY) { if(you.skill4 == 2) { you.skill3 -= 5; } if(you.skill66 == 0 && you != pl){ you.pan = ang(my.pan + 90); }
ent_morph(me, "blood.tga"); my.flags |= OVERLAY; my.event=NULL; vec_scale(normal,10); // produce an explosion into the normal direction effect(effect_explo,1,my.x,normal); my.x = you.x; my.y = you.y; wait(1); c_move(my,vector(0-10*speed,0,0),nullvector,GLIDE); my.skill80=1; }
if(event_type == EVENT_SURFACE) { my.event=NULL;
wait(1);
ent_remove(me); } }
Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1
I'm 17 years old, with 4 years of programing
I can programming a lot of languages check my
Bio out,
|
|
|
Re: Effects in C-Lite?
[Re: jcl]
#124549
04/18/07 08:29
04/18/07 08:29
|
Joined: Sep 2006
Posts: 128 Sweden
Tiinusen
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 128
Sweden
|
well ill fiex the crashing. but the problem is that it aint spawning any particles. thats the problem. so the question have changed. how to make it spawn particles. it chould work but it dosent.
Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1
I'm 17 years old, with 4 years of programing
I can programming a lot of languages check my
Bio out,
|
|
|
Re: Effects in C-Lite?
[Re: jcl]
#124551
04/18/07 09:10
04/18/07 09:10
|
Joined: Sep 2006
Posts: 128 Sweden
Tiinusen
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 128
Sweden
|
yes it is. i checked that, u placed error("test"); before the effect. so its called. and i placed error("test2"); in the event thats called by the particles. and its called too
Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1
I'm 17 years old, with 4 years of programing
I can programming a lot of languages check my
Bio out,
|
|
|
Re: Effects in C-Lite?
[Re: jcl]
#124553
04/18/07 09:15
04/18/07 09:15
|
Joined: Sep 2006
Posts: 128 Sweden
Tiinusen
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 128
Sweden
|
well i try that. thank you. i reply when i got some result or no results at all
Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1
I'm 17 years old, with 4 years of programing
I can programming a lot of languages check my
Bio out,
|
|
|
|