Editing and Customization > Modding Help

Is there a way for mode scripts to calculate a trace ray's contact vector?

(1/1)

Joe:
Hi,

I would like to know this so that I can make DAD mode's script draw resurrection beams from players to the point on a gravestone where they are aiming the beam at, instead of just making the beam be drawn to the gravestone's origin.

I've tried to work out a calculation for this but I haven't been successful. I would bet though, that there is a way to calculate this with the data available to mode scripts.

Available data which I think could be useful for this calculation:

* A vector pointing in the direction of a "long range resurrection ability" user's aim direction.
* This ability's maximum range.
* The user's origin vector.
* The user's rotation vector.
* The gravestone's (capture area object's) origin vector.
* The gravestone's rotation vector.
* The size and shape of the gravestone's entity area box.

killermonkey:
One problem with this is that as you move the beam it will have to destroy the original one and recreate a new one. This would create a significant network overhead. Although not too terrible, just something to consider.

My suggestion would be to create a random "attachment point" when you first create the beam that is something other than the origin of the grave stone.

It might just be easiest to +15 in the Z direction of the gravestone's origin to start with.

Joe:
Thanks for helping me Killer Monkey.


--- Quote from: killermonkey on July 07, 2013, 12:27:08 pm ---One problem with this is that as you move the beam it will have to destroy the original one and recreate a new one. This would create a significant network overhead. Although not too terrible, just something to consider.

--- End quote ---

If this would create a significant network overhead then I will just make the beam go from a player's aim direction vector to the center of the gravestone they are aiming at.

When a player is able to use two or more gravestones at the same time with the LRR ability, I will make this mode's script draw multiple beams from the player's aim direction vector to the gravestones they are using.

Navigation

[0] Message Index

Go to full version