Event_setTransform

Author Topic: Event_setTransform  (Read 3497 times)

Sets up the default setTransform function as an event for Players, Bots, and Vehicles.

There are two types, setTransformAA, which uses the default ingame Axis Angle rotation system.
And setTransformE, which uses the more conventional 3 point rotation system.

setTransformAA
Uses the game's coordinate, and rotation system.
[posx posy posz] [rotvecx rotvecy rotvecz] [rottheta]
You can use the admin command /gettransform on any object ingame to get these values.
If you aren't admin, trial and error is your best bet.
Rotation uses the axis angle formula.
You define a rotation axis using the first three numbers.
Then you define how much you want to rotate around that axis using the theta value.
Theta can be anywhere from 0 to 2pi.

setTransformE
Uses the game's coordinate system, and the conventional 3 point rotation system(x y z, in degrees. 90 is a right-angle turn).
[posx posy posz] [rotx roty rotz]
You can use the admin command /gettransform to get the first three values, but for the last three you are on your own.

Download:
Mediafire - http://www.mediafire.com/download/9ym2mrmq02n5wb2/Event_setTransform.zip
Dropbox - https://www.dropbox.com/s/hdb8267dtajggww/Event_setTransform.zip?dl=0

I suggested this event here.
jes00 and Zeblote gave me an example to follow, which I refined and expanded.

tldr; It's a difficult to use teleportation event that lets you assign rotation at the same time.

I made a little picture guide on how to teleport a vehicle immediately after it spawns.
This requires vehicle events.

setTransformAA









After respawning.

setTransformE









After respawning.

Let's rotate it a bit.



There we go.


Oh wow I needed something like this

I will make a lot of use out of this.

After all the years of needing this for basically every project I have ever worked on, you have done it!

For the command try to use mFloatLength(%blah, 2) for the transformation, but you can create a function that can mFloatLength it all

http://forum.blockland.us/index.php?topic=277507.0
not to hijack this topic but another event for vehicle rotation if transforming to coords is too specific

Pretty sure you can make larger vector parameters, try vector 100000 instead of the string

Pretty sure you can make larger vector parameters, try vector 100000 instead of the string
Aight I'll do that.  I tried vector 0 300 when testing, it did not work.

which the axis angles to Euler because i doubt there's a human on this forum who is able to translate the commonly used Euler system to axis and we all know that axis angles are satanic anyways

which the axis angles to Euler because i doubt there's a human on this forum who is able to translate the commonly used Euler system to axis and we all know that axis angles are satanic anyways

It's actually pretty useless for players because they can only rotate on Z. Have a slider from 0 to 360 degrees maybe?