RigidChips
Would you like to react to this message? Create an account in a few clicks or log in to continue.

RigidChips English Documentation

4 posters

Go down

RigidChips English Documentation Empty RigidChips English Documentation

Post by fredsmith Wed Jan 19, 2011 1:22 am

Hey, look what I dredged up Very Happy So... I had copied this off the old forums into a text file, for reference without internet access. Now it's become useful again. Feel free to suggest corrections!

Fred


RigidChips English Documentation



Model structure

Five blocks, in a simple text file (you can use the .RCD extension)

Val {}
Describe your variables here. Body{} can use the variables described here as parameters for chips or global variables for scripts

Key {}
Key assignments : says which key changes which variable

Body {}
Model description

Script {}
automatic control and display of the data
Lua {}
Available from V1.5. Using LUA disables the script section.




Val {} description

Variable([default=...],[min=...],[max=...],[step=...],[disp=0|1])

Not case sensitive, except if used in LUA
To call a variable in LUA, you MUST spell it in upper case
You can declare variable()

default : Initial value Default: 0
min : Minimum Default: 0
max : Maximum Default: The maximum float (very high!)
step : the speed at which the variable naturally returns to its default
disp : indicates wether the variable and its value are displayed in the lower left of the screen (actually, anything other than 0 will display it). default : not 0

(here is the original translated text which discusses about conflicts between variable modifications by script/keys/automatic return to default. I don't quite get it)
Example: When with default=10 presently value is step=1 with 15, 15,14,13…11,10,10 it keeps changing.
However the Key {}, Script {}, Lua {} value being renewed in inside, between of the [ru] does not change.
However being renewed, when the change quantity 0 is, (the key {a: 0 (step=0)} script {a=a} and the like) it does not change



Key {} description

Key number: Variable identifier (step=...)

While the key is pushed, the value which is appointed to variable with step is added.You can add multiple affected variables, separating them with commas.
ex :
0:engine(step=1000),rpm(step=100)



Body {} description

Direction: chip type(...) {…}

Direction= “N”, “E”, “W” and “S”

{} add here the chip which becomes the child (the chip which is connected to that chip). If none, just add {}



Chip types

The core - the base of the model. You can add it only directly under Body.
Weight: In. Aerodynamic drag: In. Friction drag: Small.
Fuel 2,000,000 (Ver 1.5B24).
Syntax : core()

Chips - the main construction element
Weight: In. Aerodynamic drag: In. Friction drag: Small.
Fuel 1,000,000 (Ver 1.5B24).
syntaxes:
chip([angle=...]) angle on X axis
rudder([angle=...]) angle on Y axis
trim([angle=...]) angle on Z axis

Frames - no aerodynamic drag
Weight: light. Aerodynamic drag: None Friction drag: In.
Fuel 500,000 (Ver 1.5B24).
syntaxes:
frame([angle=...],[option=1])
rudderf([angle=...],[option=1])
trimf([angle=...],[option=1])
With option=1 ghost conversion (transparency, there is no contact decision)

Weight - heavy chip.
Weight: heavy. Aerodynamic drag: In. Friction drag: Large. Relative importance 4 times (2.Cool.
fuel 6,000,000
syntax : weight([option=1...8])
the value in option define the actual weight factor

Cowl - decoration chip. There is no contact decision and it is processed quicker than other panels.
Weight: 0. Shape changes with option
Cowls can only support other cowls.
syntax: cowl([option=0...?])

Power chips

The jet - thrust is generated in chip's Y axial direction.
Affect thrust with POWER. With effect smoke, with option 1 (hydrogen balloon), 2 (air balloon)
syntax: jet([angle=...],[power=variable],[effect=...],[option=...])

Wheel system - the chip which turns.
Appoint output with the POWER. Modify size with option. With effect thickness modification (contact decision change)
(here is some original text indicating tha you can also control the aspect of the rim, a bit obscure to me)
With the rim and the wheel 2chip minute, with name wheel side, name - rim side can be appointed with 1.
syntaxes:
wheel([angle=...],[power=variable],[brake=variable],[effect=...],[option=...])
rlw([angle=...],[power=variable],[effect=...],[option=...])
the rlw is a "non-reaction wheel". I don't know if it means no drag or no traction, or anything else. testers wanted Smile
POWER = torque ## of wheel (angular velocity + 100) ## 0.6

Arm - shooting weapon.
bullets consume energy, and energy takes time to recharge
syntax: arm([angle=...],[option=<strength of bullets>],[power=<energy bank>])



General options
color :R, G and B in hexadecimal. Example (red): color=#FF0000

spring : speed at which the chip returns to original angle after deformation. values=0...1, default 1

damper : necessary force to bend a chip. values=0...1, default 0.5

Name : give the chip a name, to use as reference in scripts





script {} section

The script is called to every frame.


IF conditional expression {…} : When condition is true, the {} block is executed. No "nestation"
GOTO xxxx / LABEL xxxx : jumps (spaghetti programming, anyone ?)
PRINT X,xxxx :X (0...100) is the line, xxx is the text to be printed (in "") or a numerical value, separate blocks with commas
Var1=Var2 : stores Var2 in Var1. If Var1 wasn't described in Val{], it becomes a local variable. Also note that global variables are not automatically initialized, so using a local variable is often best, for stability issues.
Example: dummy = _BYE (1)

Various operators

+ Addition
- Subtraction
* Multiplication
/ Division
= is equal
! = <> is not equal
> is larger
< is smaller
>= above
<= below
& AND, conditional expression
| OR, conditional expression


Arithmetic functions (script)

_ABS (value) // absolute value
_MOD (value 1, value 2) //remainder of value 1/value 2 (integer division)
_INT (value) // integral part is returned
_FIX (value) // integral part is returned
_FLOOR (value) // cutoff
_CEIL (value) // close
_ROUND (value) // rounding (after Ver1.5b4)
_SGN (value) // returns 01 or 1, depending on the sign of Value
_RND () // random number 0~1
_SQRT (value) // square root
_POW (value 1, value 2) // value1^value2
_EXP (value) //e^value
_LEN3 (a and b, c) //sqrt (a*a+b*b+c*c)
_LEN2 (a and b) //sqrt (a*a+b*b)
_PI () // pi
_TODEG (radian) // radians -> degrees
_TORAD (degree) degrees -> radians
_SIN (value)
_COS (value)
_TAN (value)
_ASIN (value)
_ACOS (value)
_ATAN (value)
_ATAN2 (value 1, value 2)
_LOG (value)
_LOG10 (value)





Lua {} description

function main () ~ end : is called to every frame.
Other main functions :

* OnInit
* OnReset
* OnFrame : if used, Main is disabled

With Lua, out (X,xxxx) replaces PRINT.



Arithmetic functions (Lua)

math.sqrt (value)
math.sin (value)
math.cos (value)
math.tan (value)
math.sin (value)
math.acos (value)
math.atan (value)
math.atan2 (value 1, value 2)
math.abs (value) // absolute value
math.mod (value 1, value 2)
math.pow (value 1, value 2) you can also write x^y
math.exp (value)
math.floor (value) // cutoff
math.ceil (value) // close
math.log (value)
math.log 10 (value)
math.max (x, y,…) // maximum
math.min (x, y,…) // minimum
math.frexp (value) // r and e = math.frexp (x); x = r * 2^e
math.ldexp (value 1, value 2) // x = math.ldexp (r and e); The opposite function of frexp
math.random () under _RND // random number 0~1 ()
math.random (n) random integer number between 1 and n
math.random (x, y) random number of integer of //x ~y
math.randomseed (value) initialization of random numbers
math.deg (value) radian -> degree
math.rad (value) degree -> radian

these functions do not exist in lua, here are definitions for you :

math.int = function (x) if x < 0 then return math.ceil (x) else return math.floor (x) end end
math.fix = math.int
math.round = function (x) return int (x + 0.5*sgn (x)) end
math.sgn = function (x) if x < 0 then return -1 elseif x == 0 then return 0 else return 1 end end
math.len2 = function (a and b) return math.sqrt (a*a+b*b) end
math.len3 = function (a, b and c) return math.sqrt (a*a+b*b+c*c) end





Global variables, usable in both scripts and LUA



General information acquisition functional †

_DT () basic time unit
_FPS () real FPS value
_TICKS () number of elapsed frames
_BASE () specification of FPS upper limit (30 or 15) (only Ver1.5B)
_SETTICKS () redefine _TICKS()
_CHIPS () the number of chips in the model (wheels count for two, because of rims)
_WEIGHT () weight of whole // (kg)
_WIDTH () width of model
_HEIGHT () height of model
_FACE () the number of polygons
_KEY (key number) // returns 1 if pushed, else 0
KEYDOWN (key number) returns 1 if pushed (only Ver1.5B system)
_KEYUP (key number) returns 1 if NOT pushed (only Ver1.5B system)

_ANALOG (0) value of joystick X axis (- from 1000 1000)
_ANALOG (1) value of joystick Y axis (- from 1000 1000)
_ANALOG (2) value of joystick throttle axis (- from 1000 1000)
_ANALOG (3) // (only Ver1.5B system)
_ANALOG (4) // (only Ver1.5B system)
_ANALOG (5) // (only Ver1.5B system)
_HAT (0) value of hat switch of joystick

_MX () x coordinate of the mouse (number of pixels from left edge as standard) (only Ver1.5B system)
_MY () Y coordinate of the mouse (number of pixels from top edge as standard) (only Ver1.5B system)
_ML () the left mouse button state (only Ver1.5B system)
_MR () the right mouse button state (only Ver1.5B system)
_MM () medium mouse button state (only Ver1.5B system)



Drawing functions
only Ver1.5B

_SETCOLOR (color) setting of line color (example #FF0000)
_MOVE3D (x, y and z) setting of starting point of 3D line drawing
_LINE3D (x, y and z) setting of terminus of 3D line drawing
_MOVE2D (x, y) starting point setting of 2 dimensional line
_LINE2D (x, y) terminus setting & drawing of 2 dimensional line

In 2d, the center of the screen is at (0,0), top screen is at y=1, bottom at y=-1. For the x coordinate.... Just try and test :p



Chip attribute acquisition functions

You can use the affected name of a chip in place of its number

_X (chip number) // position west +, east -
_Y (chip number) on +, under -
_Z (chip number) south +, north -

_EX (chip number) // Euler angle (radian) (only Ver1.5B system)
_EY (chip number) //
_EZ (chip number)

_RX (chip number,reference chip number) // relative Euler angle (radian) (only Ver1.5B system)
_RY (chip number,reference chip number)
_RZ (chip number,reference chip number)


_AX (chip number) // angle (radian)
_AY (chip number) // deprecated, use _EX, _EY and _EZ instead
_AZ (chip number)

_LX (chip number) // torque
_LY (chip number)
_LZ (chip number)

_WX (chip number) // angular velocity
_WY (chip number)
_WZ (chip number)

_VEL (chip number) absolute value of translational speed (Use only in scripts, LUA implementation bugged)

_VX (chip number) // translational speed in m/s
_VY (chip number)
_VZ (chip number)

_FX (chip number) // translational momentum
_FY (chip number)
_FZ (chip number)

_H (chip number) height from land in m. When above 10 it reverts to -10000


_GX (chip number) // barycentric coordinates of the model containing the chip
_GY (chip number)
_GZ (chip number)

_XX (chip number) //X axial vector (revolution queue of each chip (3x3) 1 lines at a time )
_XY (chip number)
_XZ (chip number)
_YX (chip number) //Y axial vector
_YY (chip number)
_YZ (chip number)
_ZX (chip number) //Z axial vector
_ZY (chip number)
_ZZ (chip number)

_QX (chip number) // [kuotanion] (???even google couldn't handle this one !!!)
_QY (chip number)
_QZ (chip number)
_QW (chip number)

_I (chip number,line number,line number)
Tensor of inertia of chip (3x3)

_TYPE (chip number) type of chip
_PARENT (chip number) connected original chip number
_TOP (chip number) chip number of the highest parent
_DIR (chip number) connected direction of parent chip

_ANGLE (chip number)
_POWER (chip number)
_SPRING (chip number)
_DAMPER (chip number)
_BRAKE (chip number)
_COLOR (chip number)
_OPTION (chip number)
_EFFECT (chip number)
_USER1 (chip number)
_USER2 (chip number)

_M (chip number) mass of chip
_E (chip number) remaining energy in an ARM chip
_T (chip number) durability of the chip. Starts at 10000, decreases by bullets. -1 = total destruction



Special instructions

_BYE (chip number) the chip is separated
_SPLIT (chip number) the chip is separated. _BYE () power equipped edition (only Ver1.5B system)

When a cowl chip is separated, it stands still that way in the sky



Object attribute functions
only Ver1.5B system

_OX (object number) position of ball
_OY (object number)
_OZ (object number)

_MOBJ (object number) mass of object
_IOBJ (object number,line number,line number) Tensor of inertia of object (3x3)



CCD camera attribute functions

The CCD is located on the Core chip, and has a resolution of 64x64, from top left (0,0) to lower right (63,63)

_CCD (x, y) color information of CCD camera, 15 bit RGB integer value
_RED (x, y) red information of CCD camera, 0~1 actual numerical value
_GREEN (x, y) green information of CCD camera, 0~1 actual numerical value
_BLUE (x, y) blue information of CCD camera, 0~1 actual numerical value
_ZOOM (angle of visibility)


Network-related
only Ver1.5B system

_PLAYERS () number of connected players
_PLAYERHOSTID () ID of host
_PLAYERMYID () your own ID

_PLAYERID (n) ID of player n
_PLAYERCHIPS (n) the number of chips of player n
_PLAYERARMS (n) the number of ARMs of player n
_PLAYERCOLOR (n) marker color of player n
_PLAYERCRUSHES (n) number of deaths of player n (destruction = Core durability <0)
_PLAYERINITS (n) number of initializations of player n
_PLAYERRESETS (n) number of resets of player n
_PLAYERYFORCES (n) number of "y cheatkey" uses of player n

_PLAYERX (n) the x position of player n
_PLAYERY (n) the y position of player n
_PLAYERZ (n) the z position of player n
each returned value is randomly shifted by 5m ( sorry, no automatic killer-script Smile )

_PLAYERNAME (n) name of the player n (returns a string, do not use in scripts, LUA only)


Last edited by fredsmith on Sun Jan 23, 2011 10:41 pm; edited 1 time in total
fredsmith
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

http://lmgtfy.com/?q=rigidchips

Back to top Go down

RigidChips English Documentation Empty Re: RigidChips English Documentation

Post by RA2lover Sun Jan 23, 2011 5:59 am

is there another documentation file specific for scenarios?
RA2lover
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil

Back to top Go down

RigidChips English Documentation Empty Re: RigidChips English Documentation

Post by JHaskly Sun Jan 23, 2011 4:52 pm

Here combined with this.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane

Back to top Go down

RigidChips English Documentation Empty Re: RigidChips English Documentation

Post by Doc Sun Jan 30, 2011 3:00 pm



Last edited by Doc on Sun Jan 30, 2011 3:04 pm; edited 7 times in total (Reason for editing : Broken URL??)
Doc
Doc
Car
Car

Posts : 23
Join date : 2010-10-10
Location : On the edge of nowhere

Back to top Go down

RigidChips English Documentation Empty Re: RigidChips English Documentation

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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