AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Returning bullet origins (https://forums.alliedmods.net/showthread.php?t=10846)

TotalNoobScripter 03-02-2005 20:49

Returning bullet origins
 
How would you return a bullet origin that was shot by a user?

Twilight Suzuka 03-02-2005 21:20

what mod?

TotalNoobScripter 03-03-2005 18:27

TS, but i would also like to see examples of CS DOD and TFC

Twilight Suzuka 03-03-2005 18:50

In CS, there is a command for finding the bullet origin of the LAST bullet shot.

For TS, you could not possibly hope to predict where a bullet is at any given point of time.

Why, you might ask?
TS, like other mods, uses trace_line's to make bullets (ok ok, they are not exactly trace lines, but...it gets the point across.).

The bullet is essentially a tracer, following the path of the trace line. Sometimes, there are not even tracers, it just insta hits.

Unlike other mod's, TS slow's down bullets. While I have no real idea how it does that, I believe it find's the trace_line origin (where it will go), and then makes either a slow moving entity, or a slow moving tracer. Either one would work, an entity that, when touches, gives damage to that it touches, or a tracer that moves slowly, and it predicts where it will hit ahead of time.

When things are not moving in slow motion, the bullets are simple trace lines again.

So, while you could use get_user_origin(id,origin,3) or a trace line to find the last origin, you would not know if there is slow mo or not. And even if you did, you would have no idea how to predict where the thing would be at any given point in time, or if people would hit it before it reaches its destination, etc etc.

So, you could use a trace_line, or a get_user_origin, but it will not be perfect.

TotalNoobScripter 03-03-2005 19:59

how exactly does trace_line work? its hard for me to understand... do you specifify a start, and it returns and end? or does it return an end and a start from an ent id you put in IgnoreEnt?

Twilight Suzuka 03-03-2005 21:04

Trace. Line. Traces a line. From one point. To another.

TotalNoobScripter 03-03-2005 21:05

but me dont gets the syntax!

Twilight Suzuka 03-03-2005 21:11

trace_line ( IgnoreEnt, Float:Start[3], Float:End[3], Float:vReturn[3] )

input a start origin. Input an end origin. It will return where it hits. Ignore a specific entity if you like.

I think thats how it works.

TotalNoobScripter 03-03-2005 21:12

wait, whats the point of tracing a line if you know the end coord?

XxAvalanchexX 03-03-2005 22:06

So that you can see if the line intersects anything.


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

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