4 registered members (ozgur, Ayumi, VHX, monarch),
1,161
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Need a laser beam particle effect example
[Re: Ercoles]
#413427
12/13/12 19:37
12/13/12 19:37
|
Joined: Apr 2011
Posts: 75 Malta
Ercoles
OP
Junior Member
|
OP
Junior Member
Joined: Apr 2011
Posts: 75
Malta
|
I have set the main function to:
function main() { var i; var j; vec_set(sky_color,vector(0,0,0)); level_load(NULL); video_window(NULL,NULL,0,"Laser demo"); vec_set(camera.x,vector(-250,0,50)); vec_set(camera.pan,vector(0,-15,0)); while (1){ if (mouse_left == 1){ if(proc_status(tracer_right) < 5){gun1=ent_create(NULL,vector(-100,-170,-80),tracer_right);i++;} if(proc_status(tracer_left) < 5){gun2=ent_create(NULL,vector(-100,170,-80),tracer_left);j++;} } if((proc_status(tracer_right) == 0) && (i>0)){ptr_remove(gun1);i--;} if((proc_status(tracer_left) == 0) && (j>0)){ptr_remove(gun2);j--;} wait(1); } }
but still though very rarely I get that error.
|
|
|
Re: Need a laser beam particle effect example
[Re: Ercoles]
#413428
12/13/12 19:45
12/13/12 19:45
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
I'm sorry I can't help you with your problem but I think the people helping you with this would appreciate it if you'll write your code with the code tags for easier reading / understanding:
[code] (your code here) [/code]
POTATO-MAN saves the day! - Random
|
|
|
Re: Need a laser beam particle effect example
[Re: Kartoffel]
#413431
12/13/12 20:31
12/13/12 20:31
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
From the first code sample you posted just place an "ptr_remove(me);" in your tracer_xxxxx functions just after the while loop. That should do the trick.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: Need a laser beam particle effect example
[Re: Superku]
#413536
12/15/12 07:57
12/15/12 07:57
|
Joined: Apr 2011
Posts: 75 Malta
Ercoles
OP
Junior Member
|
OP
Junior Member
Joined: Apr 2011
Posts: 75
Malta
|
Is it possible to use the c_move command with beam particles?
What I need is that the laser beam particle always moves from its start position at vector(camera.x,camera.y-400,camera.z) or vector(camera.x,camera.y+400,camera.z) to the vector(camera.x+400, camera.y, camera.z-30)
c_move can do that but can it be used with beam particles?
Also the manual in the effect command mentions a Beam Length but I cannot find any description how to use it. Can someone shed some light on this?
Last edited by Ercoles; 12/15/12 08:50.
|
|
|
Re: Need a laser beam particle effect example
[Re: 3run]
#413545
12/15/12 09:53
12/15/12 09:53
|
Joined: Apr 2011
Posts: 75 Malta
Ercoles
OP
Junior Member
|
OP
Junior Member
Joined: Apr 2011
Posts: 75
Malta
|
You can't use "c_move" with particles (you need collusions, or don't you just know how to move them?). No I do not need collisions, I just do not know how to handle the vector mathematics.
|
|
|
Re: Need a laser beam particle effect example
[Re: Ercoles]
#413547
12/15/12 09:57
12/15/12 09:57
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
VECTOR vTemp;
// move in X direction, with speed 15:
vec_set(vTemp, vector(15, 0, 0));
// rotate vector above with camera angles (make movement local):
vec_rotate(vTemp, camera.pan);
// apply to particle:
vec_set(p.vel_x, vTemp);
If what I wrote right here, is just like a Chinese language for you, go learn from workshops, AUM and manual!
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|