AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to make entity arc (https://forums.alliedmods.net/showthread.php?t=17231)

Zenith77 08-27-2005 23:09

How to make entity arc
 
1 Attachment(s)
I need to make an entity arc from one player origin to another player origin...

as seen in the picture below..

(exuse my 1337 painting skills :) )

[img]
http://img292.**************/img292/130/arc6te.gif
[/img]

the code can be downloaded at the bottom...

thnx

--Zenith

GHW_Chronic 08-28-2005 01:12

arc as in a line, like the Beam in hookmod type thing except arced. How Long Should It Last? what is the purpose for it in your script?

Xanimos 08-28-2005 02:44

i think since its coin mod that he is going to try and get someone to drop coins in an arch fashion

GHW_Chronic 08-28-2005 02:55

ah, i get it...

Zenith77 08-28-2005 12:25

nobody knows how :(

GHW_Chronic 08-28-2005 13:07

yeah, ppl do, its not too hard, set_user_velocity(entity,vector) this is not hard to do. Just find the difference in the 2 locations of the player and the end of the arc then set the velo to that and add some on the Z side so that it goees up and arcs and it will fly.

module: engine
Funcwiki

Contact me for additional help, +karma 8)

Zenith77 08-28-2005 13:20

Thnx chronic..i will give you karma as soon as it lets me....

but..i dont get what to do for the vectors part :?


( p.s. i cant contact you unless my mom is gone...she will get mad and think your a hacker or something :/, i still have you on AIM though... )

GHW_Chronic 08-28-2005 13:33

ok, look, im gonna give u an example of what u want to do.

You have a player at point A which is 0 0 0

You have a coin at point B which is 100 200 0

if you want the coin to fly to the person:

Code:

new Float:vector[3]
vector[0] = -100.0
vector[1] = -200.0
vector[2] = 80.0

set_user_velocity(coin,vector)

Now to calculate the vector, just do this.

Code:

new Float:origin[3]
entity_get_vector(id,EV_VEC_origin,origin)
new Float:coinorigin[3]
entity_get_vector(coin,EV_VEC_origin,coinorigin)

new Float:vector[3]
vector[0] = origin[0] - coinorigin[0]
vector[1] = origin[1] - coinorigin[1]
vector[2] = origin[2] - coinorigin[2] + 80

set_user_velocity(coin,vector)

Adding 80 may make the coin fly over the person so a little, so you may have to mess around w/ the x and y vector by subtracting like 10 from each or something.

Zenith77 08-28-2005 14:22

thnx man...


All times are GMT -4. The time now is 14:27.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.