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 (Ayumi, 1 invisible), 1,085 guests, and 6 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
Path between point #210663
06/12/08 04:50
06/12/08 04:50
Joined: Apr 2007
Posts: 249
Louisana, USA
Ilidrake Offline OP
Member
Ilidrake  Offline OP
Member

Joined: Apr 2007
Posts: 249
Louisana, USA
Lets just say for example you have an RTS where the player has the option of attacking another unit but the attack power is based on the distance between units and we were using measurements of feet. How would i create a visible line between the player unit and the unit the player is attacking as well as display the measurment of the distance between the two. I want some sort of line drawn between the two units but have no idea how to do it.


Just Because Your Paranoid Doesn't Mean They Aren't After You...Because They Really Are

http://spearbang.awardspace.com/news.php
Re: Path between point [Re: Ilidrake] #210665
06/12/08 05:32
06/12/08 05:32
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
You could use draw_line3d

Re: Path between point [Re: Xarthor] #210670
06/12/08 07:44
06/12/08 07:44
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
or you use a sprite (4x4) and stretch/rotate it so that it is like a line... then you don't have the jaggy edges.

Re: Path between point [Re: Joey] #210715
06/12/08 12:45
06/12/08 12:45
Joined: Apr 2007
Posts: 249
Louisana, USA
Ilidrake Offline OP
Member
Ilidrake  Offline OP
Member

Joined: Apr 2007
Posts: 249
Louisana, USA
How do you manipulate a sprite? This is the first time i've ever heard of this. And how would I convert quants to feet?


Just Because Your Paranoid Doesn't Mean They Aren't After You...Because They Really Are

http://spearbang.awardspace.com/news.php
Re: Path between point [Re: Ilidrake] #211516
06/17/08 03:23
06/17/08 03:23
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline
Junior Member
coma_dose  Offline
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
Dude I can do this, there is a function in the a6 templates that will draw a line its called particle_drawline or something. If you want, I can just go home in like 45 minutes (I'm at work) copy the code and paste it here. It's really easy I just can't remember what 1 function is because I don't really need to draw lines in my game.

Basically this code makes a line, you can use a sprite particle and use my.streak = on, and it will look cooler depending on what sprite you use. I'll post it when I get home if no one else does first laugh

Re: Path between point [Re: coma_dose] #211520
06/17/08 05:01
06/17/08 05:01
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline
Junior Member
coma_dose  Offline
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
This is from the template_6 folder.

Code:
function Particle00_DrawLine_Func()
{
	my.red = 255;
	my.green = 0;
	my.blue = 0;
	my.size = 1;
	my.lifespan = 1;
	my.streak = on;
	my.function = NULL;
}


function Particle00_DrawLine(&start,&end)
{
	vec_diff(temp,end,start);
	effect(Particle00_DrawLine_Func,1,start,temp);
}


Particle00_DrawLine_Func() is the particle and use Particle00_DrawLine(&start,&end) like this:

Code:
Particle00_DrawLine(first_unit.x,second_unit.x);


Notice that my.streak = on, that is a commercial and above flag so if you don't have at least commercial it won't work.

I guess converting quants to feet is up to you like 5 quants to 1 foot or 10 quants to 1 foot, it's up to you.

Re: Path between point [Re: coma_dose] #211824
06/18/08 17:07
06/18/08 17:07
Joined: Apr 2007
Posts: 249
Louisana, USA
Ilidrake Offline OP
Member
Ilidrake  Offline OP
Member

Joined: Apr 2007
Posts: 249
Louisana, USA
Dude!!! Thanks alot. I have commercial so this will work fine.


Just Because Your Paranoid Doesn't Mean They Aren't After You...Because They Really Are

http://spearbang.awardspace.com/news.php
Re: Path between point [Re: Ilidrake] #212046
06/19/08 21:37
06/19/08 21:37
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline
Junior Member
coma_dose  Offline
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
I am making a space shooter that utilizes this effect with cool results. I have a space mine that creates the line from my.y + 2000 to my.y - 2000, the particle uses my.streak = on and a cloudy square-shaped bitmap with an alpha channel. In the particle function I put my.x += random(10) - 5; my.y += random(10) - 5; and my.z += random(10) - 5; and the result is a cool laser beam that flickers around. I will be posting the effect in the projects section as soon as the demo is smooth.

Check particle00.wdl in the a6 templates, I think thats the script; It has some nice scripts for drawing lines with particles.

Re: Path between point [Re: coma_dose] #212258
06/21/08 05:36
06/21/08 05:36
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline
Junior Member
coma_dose  Offline
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
<Insert chance for me to brag here...> Ok the enemies use the streak effect with almost the exact same code as above, causing the beam to jump around and flicker.



Using an actual sprite in the particle brought up an interesting flaw when using a sprite: the longer the line, the more the particle sprite is stretched meaning the beam may appear faint.

Re: Path between point [Re: coma_dose] #212262
06/21/08 07:03
06/21/08 07:03
Joined: Apr 2007
Posts: 249
Louisana, USA
Ilidrake Offline OP
Member
Ilidrake  Offline OP
Member

Joined: Apr 2007
Posts: 249
Louisana, USA
Awesome dude. Thanks!!!


Just Because Your Paranoid Doesn't Mean They Aren't After You...Because They Really Are

http://spearbang.awardspace.com/news.php

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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