[GLOBAL]Qbyte code Documentation

Tutorials for all THUG+ games goes here.
Forum rules
This forum is only for posting tutorials.
Specify what game it is for, and please take a look at this Template.
Post Reply
ProHad
VIP
Posts: 45
Joined: Wed Mar 03, 2010 10:10 pm

[GLOBAL]Qbyte code Documentation

Post by ProHad » Sat Mar 20, 2010 1:20 pm

Not exactly sure how upto date this one is, i thik there were a few more updates before the site went down.

Code: Select all

OP | Name        | Additional Info
-----------------------------------------------------------------------------------------
00 : End Script        : Indicates the end of the script file
01 : New Instruction    : Literally translated as line breaks from script source
02 : Line Wrap      : Followed by long value for how long the line continues
03 : Struct        : Followed by variable names and values
04 : End Struct
05 : Array        : Followed by values
06 : End Array
07 : Equals        : Followed by value
08 : Unknown
09 : Unknown
0A : Minus        : Followed by value to subtract
0B : Plus        : Followed by value to add
0C : Multiply        : Followed by value to multiply
0D : Divide        : Followed by value to divide
0E : Nesting increase    : Literally translated as open parentheses from script source
0F : Nesting decrease    : Literally translated as close parentheses from script source
10 : Unknown
11 : Unknown
12 : < Less Than    : IF (Something < SomethingElse)
13 : <= Less Than or Equal  : [Guessed, not observed yet]
14 : > More Than    : IF (Something > SomethingElse)
15 : >= More than or Equal  : [Guessed, not observed yet]
16 : Symbol hash    : Followed by crc-32 hash of the symbol
17 : Long Integer    : Followed by 32 bit long value
18 : Unknown
19 : Unknown
1A : Single Float    : Followed by a floating point number
1B : String        : Followed by long value for strlen then null terminated string
1C : String
1D : Unknown
1E : Vector        : Followed by 3 floating point numbers
1F : Pair        : Followed by 2 floating point numbers
20 : Loop
21 : End Loop
22 : Exit Loop
23 : Function        : Followed by function name hash
24 : End Function
25 : If
26 : Else
27 : Unknown
28 : Endif
29 : Return
2A : Unknown
2B : Symbol entry    : Followed by crc-32 hash and symbol text
2C : Null
2D : Argstack variable    : Used to address a variable passed as a function argument
2E : Jump        : Followed by long offset to jump to
2F : Random
30 : Unknown
31 : Unknown
32 : Or            : Followed by second if condition
33 : Unknown
34 : Unknown
35 : Unknown
36 : Unknown
37 : Unknown
38 : Unknown
39 : Not        : Right after If, negates if condition
3A : Unknown
3B : Unknown
3C : Switch        : Followed by switch value and cases
3D : Endswitch
3E : Case        : Followed by short break and case value
3F : Default Case    : Followed by default switch code
40 : Unknown        : Shares bytecode syntax with "random"
41 : Unknown
42 : Dot operator    : Followed by member name
43 : Unknown
44 : Unknown
45 : Unknown
46 : Unknown
47 : If            : Followed by short offset to next comparison
48 : Else        : Followed by short offset to next comparison
49 : Short break    : Followed by short offset to break to

Morten1337
Site Admin
Posts: 322
Joined: Mon Mar 01, 2010 2:23 pm
Location: Norway

Re: Qbyte code Documentation

Post by Morten1337 » Sat Mar 20, 2010 3:09 pm

Here's the complete documentation

Code: Select all

OP | Name        | Additional Info
-----------------------------------------------------------------------------------------
00 : End Script        : Indicates the end of the script file
01 : New Instruction    : Literally translated as line breaks from script source
02 : End Of Line Number        : Followed by long value
03 : Struct        : Followed by variable names and values
04 : End Struct
05 : Array        : Followed by values
06 : End Array
07 : Equals        : Followed by value
08 : Dot		: Followed by member name
09 : Comma
0A : Minus        : Followed by value to subtract
0B : Plus        : Followed by value to add
0C : Multiply        : Followed by value to multiply
0D : Divide        : Followed by value to divide
0E : Nesting increase    : Literally translated as open parentheses from script source
0F : Nesting decrease    : Literally translated as close parentheses from script source
10 : never used
11 : == Same as	: Basicly "Equals"
12 : < Less Than    : IF (Something < SomethingElse)
13 : <= Less Than
14 : > More Than    : IF (Something > SomethingElse)
15 : >= More Than
16 : Symbol hash    : Followed by crc-32 hash of the symbol
17 : Long Integer    : Followed by 32 bit long value
18 : Hex Integer
19 : Enum
1A : Single Float    : Followed by a floating point number
1B : String        : Followed by long value for strlen then null terminated string
1C : String
1D : Array
1E : Vector        : Followed by 3 floating point numbers
1F : Pair        : Followed by 2 floating point numbers
20 : Begin		
21 : Repeat
22 : Break
23 : Function        : Followed by function name hash
24 : End Function
25 : If
26 : Else
27 : ElseIf
28 : Endif
29 : Return
2A : Undefined
2B : Symbol entry    : Followed by crc-32 hash and symbol text
2C : AllArgs		: isNULL
2D : Argstack variable    : Used to address a variable passed as a function argument
2E : Jump        : Followed by long offset to jump to
2F : Random
30 : Random Range
31 : At	
32 : Or            : Followed by second if condition
33 : And
34 : Or ?
35 : << Shift Left
36 : >> Shift Right
37 : Random 2
38 : Random range 2
39 : Not        : Right after If, negates if condition
3A : And
3B : Or
3C : Switch        : Followed by switch value and cases
3D : Endswitch
3E : Case        : Followed by short break and case value
3F : Default Case    : Followed by default switch code
40 : Random 
41 : Random 
42 : Colon
43 : never used
44 : never used
45 : Unknown
46 : Unknown
47 : If            : Followed by short offset to next comparison
48 : Else        : Followed by short offset to next comparison
49 : Short break    : Followed by short offset to break to

%.gone.
Global Moderator
Posts: 390
Joined: Sun Mar 07, 2010 5:12 pm

Re: Qbyte code Documentation

Post by %.gone. » Sat Mar 20, 2010 3:32 pm

THAW:
4A : script structure item | uses THAW pak structure item datatypes and pointers

Post Reply