direction and position functions.
3 posters
Page 1 of 1
direction and position functions.
I have tried to pick the script out of the landmarker model, but i just cant figure out what is what.
i would like to know which functions to use that will measure the rotation of a vehicle so that i can make some hovercrafts. I cant figure out how to do it on my own, so i am asking for help.
I am looking for the functions for ROTATION, not coordinates in the world.
i would like to know which functions to use that will measure the rotation of a vehicle so that i can make some hovercrafts. I cant figure out how to do it on my own, so i am asking for help.
I am looking for the functions for ROTATION, not coordinates in the world.
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Re: direction and position functions.
The functions you're looking for are: _ax(), _ay() & _az().
Give one central chip in your model a name and put that name inbetween the brackets.
However, the output is in radians. If you want it in degrees use: _todeg().
Put the whole function that outputs radians inbetween the brackets again.
Give one central chip in your model a name and put that name inbetween the brackets.
However, the output is in radians. If you want it in degrees use: _todeg().
Put the whole function that outputs radians inbetween the brackets again.
T-Bouw- Car
- Posts : 22
Join date : 2010-07-22
Age : 40
Location : The Netherlands
Re: direction and position functions.
ok thank you T-Bouw.-hugs-
EDIT: ok it isnt working. i put a jet on each side of the core, made values for the jets, and i think i typed in the script correctly, but it isn't working. any idea what i am doing wrong? here is the code for the test.
am i doing something wrong?
EDIT: ok it isnt working. i put a jet on each side of the core, made values for the jets, and i think i typed in the script correctly, but it isn't working. any idea what i am doing wrong? here is the code for the test.
- Code:
// [RCD]
Val
{
BJET(default=0, min=-500, max=1000, step=1000)
FJET(default=0, min=-500, max=1000, step=1000)
LJET(default=0, min=-500, max=1000, step=1000)
RJET(default=0, min=-500, max=1000, step=1000)
}
Key
{
}
Body
{
Core(name=CORE) {
N:Jet(power=FJET) { }
S:Jet(power=BJET) { }
W:Jet(power=LJET) { }
E:Jet(power=RJET) { }
}
}
Script
{if _TODEG(_AX(core))=-10{
FJET=(1000)}}
am i doing something wrong?
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Re: direction and position functions.
From what I can see, the jet would only fire when _AX() is exactly -10 degrees. The problem is that angles in RC are not integers, but rather, decimals. The jet simply wouldn't fire even if _AX() is -10.00000001 or -9.9999999 degrees. The chance of _AX() = -10 (integer) is very very slim. It's almost like trying to split an arrow (Robin Hood style) by firing an arrow from Mars.
There are 2 ways to make it work. If you really want the jets to fire when _AX() equals, or close to -10 degrees, you can use _ROUND(_TODEG(AX())) = -10, which gives you a 1 degree range. But if it is an auto-balance script, you'd probably want to fire the jet when _AX() < -10 degrees.
There are 2 ways to make it work. If you really want the jets to fire when _AX() equals, or close to -10 degrees, you can use _ROUND(_TODEG(AX())) = -10, which gives you a 1 degree range. But if it is an auto-balance script, you'd probably want to fire the jet when _AX() < -10 degrees.
Re: direction and position functions.
OK thank you Bwansy. Now i have it working.
and thanks T_bouw for the original script!
you will soon see my first hovering creation on the forums.
and thanks T_bouw for the original script!
you will soon see my first hovering creation on the forums.
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum