Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 1,086 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
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
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

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 Offline
Expert
Kartoffel  Offline
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 Offline
Expert
Uhrwerk  Offline
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: Uhrwerk] #413492
12/14/12 17:34
12/14/12 17:34
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
I am a bit confused on the vectors. If I tilt or pan the camera the 2 beam starting points will need to shift as well. What formula do I need to use so that the starting points are always on the left and right of the camera even when I tilt or pan?

Re: Need a laser beam particle effect example [Re: Ercoles] #413495
12/14/12 17:58
12/14/12 17:58
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You need to use vec_rotate, f.i. as follows:

VECTOR temp;
vec_set(temp,vector(16,-8,0)); // in front of the camera and 8 quants to the right side
vec_rotate(temp,camera.pan);
vec_add(temp,camera.x);


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
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
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

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: Ercoles] #413540
12/15/12 09:13
12/15/12 09:13
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
You can't use "c_move" with particles (you need collusions, or don't you just know how to move them?).


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
Originally Posted By: 3run
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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Code:
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!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Need a laser beam particle effect example [Re: 3run] #413550
12/15/12 10:37
12/15/12 10:37
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
In which function should this go the tracer_XXXXX or the p_trace function?

Page 2 of 3 1 2 3

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