Global variables useable?

Global variables useable?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Global variables useable?

Post by Optimus Prime »

Are there any global variables useable?
For example "globaltime" or so which you can use in any unitscript.
I dont think so, but who knows.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Code: Select all

// Indices for set/get value
#define ACTIVATION			1	// set or get
#define STANDINGMOVEORDERS	2	// set or get
#define STANDINGFIREORDERS	3	// set or get
#define HEALTH				4	// get (0-100%)
#define INBUILDSTANCE		5	// set or get
#define BUSY				6	// set or get (used by misc. special case missions like transport ships)
#define PIECE_XZ			7	// get
#define PIECE_Y				8	// get
#define UNIT_XZ				9	// get
#define	UNIT_Y				10	// get
#define UNIT_HEIGHT			11	// get
#define XZ_ATAN				12	// get atan of packed x,z coords
#define XZ_HYPOT			13	// get hypot of packed x,z coords
#define ATAN				14	// get ordinary two-parameter atan
#define HYPOT				15	// get ordinary two-parameter hypot
#define GROUND_HEIGHT		16	// get
#define BUILD_PERCENT_LEFT	17	// get 0 = unit is built and ready, 1-100 = How much is left to build
#define YARD_OPEN			18	// set or get (change which plots we occupy when building opens and closes)
#define BUGGER_OFF			19	// set or get (ask other units to clear the area)
#define ARMORED				20	// set or get

/*#define WEAPON_AIM_ABORTED	21
#define WEAPON_READY		22
#define WEAPON_LAUNCH_NOW	23
#define FINISHED_DYING		26
#define ORIENTATION			27*/
#define IN_WATER   28
#define CURRENT_SPEED  29
//#define MAGIC_DEATH   31
#define VETERAN_LEVEL  32
#define ON_ROAD    34

#define MAX_ID					70
#define MY_ID					71
#define UNIT_TEAM				72
#define UNIT_BUILD_PERCENT_LEFT	73
#define UNIT_ALLIED				74
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

what do the weapon stuffs do? (ie can you SET them, what happens if you do, what sort of thing do you receive with a GET command? etc)

EDIT: And how does ON_ROAD work? I'm guessing that's a get only, but how is it detected by the engine?
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Notice they're commented out in a block comment :P
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

damn
esteroth12
Posts: 501
Joined: 18 May 2006, 21:19

Post by esteroth12 »

Gnome wrote:Notice they're commented out in a block comment :P
ON_ROAD isnt

this could be used to make things go faster on a road... of course, what does Spring call a road?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

nothing, its from TAK I think
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Post by Sheekel »

There's source in there from TAK?

Did you guys get your hands on TA and TAK source?
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Not source; these are .bos scripts that are easily figured out with Scriptor ( a well known utility for TA made by community...)
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Sheekel wrote:Did you guys get your hands on TA and TAK source?
Oh, if only
Post Reply

Return to “Engine”