Script functions?

View previous topic View next topic Go down

Script functions?

Post by Sting Auer on Mon Oct 08, 2012 4:30 pm

I haven't played Rigidchips in quite a while, and I need a bit of a freshening-up on certain script functions.

1.) What is the function to detect altitude?

2.) What is the function to detect velocity?

3.) Could you list some other useful script functions?
avatar
Sting Auer
Hover
Hover

Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.

View user profile

Back to top Go down

Re: Script functions?

Post by Rainman on Tue Oct 09, 2012 8:13 am

1. _Y([chipname]) will detect the absolute height of the chip with NAME=[chipname], which defaults to the core if left blank. However, this only tracks chips on your vehicle.

To track another vehicle's height, you use _PLAYERY([number]), which tracks the enumerated player's core chip. However, all of the _PLAYERX/Y/Z() commands have 5m of noise built in, to prevent instagibby auto-snipe scripted weapons. As far as I know, you also can't track non-self chips other than another player core, which means anyone who knows how to use the _BYE() command can make a vehicle that can eject its core and evade such tracking.

2. Velocity can be tracked via _VX(), _VY(), and _VZ(), as well as _VEL() if you're not using Lua. (If you are, you can go in and manually define _VEL() as the modulus of the first three commands.) As with the _Y() function mentioned earlier, these commands default to measuring from your vehicle's core chip if left blank, or a different named chip if that name is entered in the parenthesis.

3. _KEY() and _KEYDOWN() have become my best friends in writing scripts, obviously. For creating visual displays, the DRAW/LINE2D and DRAW/LINE3D commands are neccesary, and in general understanding of trigonometry so that you can make use of _SIN() and _COS() is invaluable.

Highly useful utility/"informational" commands (i.e. commands I usually set to print in order to give me live test data on a vehicle's performance) are _WEIGHT(), _FUEL(), and _E().

For creating mouse-controlled systems, the mouse commands are obviously neccesary; _ML() & _MR() (mouse click detectors), _MX() and _MY() (tracks relative position on the screen, kind of fiddly). Vital however are _WIDTH() and _HEIGHT(), as these autodetect the width and height of your screen/the game window, allowing you to calibrate the mouse without exhaustive guess-and-check for every new screen and computer.

In general, I can't reccomend enough that you take a look through Fredsmith's posted copy of the English-translated game documentation, which I've come to use as my Bible for scripting in Rigidchips. If you scroll about a third of the way down, you'll come to the script section, which has a near-exhaustive list of the various commands and what they do.
avatar
Rainman
Tank
Tank

Posts : 80
Join date : 2011-02-14
Age : 25
Location : New England, US

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum