Bulleit

Getting started - list of available Exile variables?

11 posts in this topic

I've been searching but couldn't find answers. Apologies if this is the wrong place to post this - not sure where else to ask. I'm a noob to Arma scripting.

Here's my question: is there a place to find a list of available variables that can be used in a script? 

For example, take this code:

_playerUID = getPlayerUID player;
{
	_flag = _x;
	_name = _flag getVariable ["ExileTerritoryName", ""];
}
forEach (allMissionObjects "Exile_Construction_Flag_Static");

How would I know that there is a variable named 'ExileTerritoryName" attached to the player object? I didn't see a class definition, or initialization script, or anything indicating what variables are available.

Share this post


Link to post
Share on other sites

unpack ExileClient and start digging :P We've all done it :D

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Best place to look is in the database initialization / load scripts and the trading related ones. You'll need to also open up the server side functions as some variables are broadcast from there too.

Good luck and welcome to the party.

Share this post


Link to post
Share on other sites

Posted (edited)

3 hours ago, Taylor Swift said:

unpack ExileClient and start digging :P We've all done it :D

 

2 hours ago, Apoc said:

Best place to look is in the database initialization / load scripts and the trading related ones. You'll need to also open up the server side functions as some variables are broadcast from there too.

I was afraid you'd say that :]

Thanks for the info - just wanted to be sure I wasn't missing a wiki or something.

Last question - given a variable (say, _player), is there a way to var_dump(_player) or print(_player) or console.log(_player)... basically is there a way to dump its contents to see what's in there for debugging purposes? Or is there a better resource I can look up for this type of information (haven't had much luck finding anything yet).

Edited by Bulleit

Share this post


Link to post
Share on other sites

Posted (edited)

6 hours ago, Bulleit said:

 

I was afraid you'd say that :]

Thanks for the info - just wanted to be sure I wasn't missing a wiki or something.

Last question - given a variable (say, _player), is there a way to var_dump(_player) or print(_player) or console.log(_player)... basically is there a way to dump its contents to see what's in there for debugging purposes? Or is there a better resource I can look up for this type of information (haven't had much luck finding anything yet).

 

 diag_log format ["Your message:",_variable];

or could be

diag_log format ["Your message: %1",_variable];

not 100% sure which or both or neither

Edited by red_ned
1 person likes this

Share this post


Link to post
Share on other sites
7 hours ago, Bulleit said:

 

I was afraid you'd say that :]

Thanks for the info - just wanted to be sure I wasn't missing a wiki or something.

Last question - given a variable (say, _player), is there a way to var_dump(_player) or print(_player) or console.log(_player)... basically is there a way to dump its contents to see what's in there for debugging purposes? Or is there a better resource I can look up for this type of information (haven't had much luck finding anything yet).

Apoc is right, have a look at:

ExileServer_object_player_createBambi
ExileServer_object_player_database_load

That's where most of the client/player object variables are set.

And yes, you can read the value/data of a variable by doing:

Server: diag_log (format ["MyVar: %1",_variable]);
Client: hint (format ["MyVar: %1",_variable]); // easier to hint on the client to save digging through client rpt's

 

Share this post


Link to post
Share on other sites
3 hours ago, Taylor Swift said:

That's where most of the client/player object variables are set.

And yes, you can read the value/data of a variable by doing:


Server: diag_log (format ["MyVar: %1",_variable]);
Client: hint (format ["MyVar: %1",_variable]); // easier to hint on the client to save digging through client rpt's

 

Great info, thanks.

Share this post


Link to post
Share on other sites
27 minutes ago, Bulleit said:

Great info, thanks.

Also take a look at this huge, yet informative guide on Exiles network message passing system as that plays a big part in a lot of addons that need the server and the client to work together.

Share this post


Link to post
Share on other sites

Posted (edited)

- delete -

Edited by Bulleit

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.