Jump to content
  • 0

monitoring changing of variables


WLF

Question

Hi all!

How can I check the changing of a variable? For example "humanity".
What is the difference between functions "server_getDiff" & "server_getDiff2"?

Why  '_diff_humanity = ["humanity",player] call server_getDiff2;' returns me 'any' ?
 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Do you me with "changing" the change from the variables from 1.0.5.1 to 1.0.6.1 or the changing of the variable while running a script?

Both a very easy. There is a file in the documents folder on the official github which includes all changed variables to the new version.

And if you mean script-side then you can just print out the value or the string of the variable to the game so you see what it is.

Link to comment
Share on other sites

  • 0

I mean I want run a script when specific variable is changed. Namely, when humanity is changed run script which print out a text with amount humanity changed (+5 when Z killed or +75 (-75) when AI killed).

Link to comment
Share on other sites

  • 0

I would suggest you add that directly to the corresponding mission system then.

Look for the function where the mission system recognizes when an AI is killed. So in this script there should be something like player humanity += config_humanity
You know? So look for the file where the system gives you humanity for killing an AI and add a message to that loop.

Could be something like this:
 

if (_aiKilled) then {
	player _humanity += 25;
	[nil,nil,rTitleText,"Player xyz gained 25 humanity for killing an AI!", "PLAIN",10] call RE;
};

Actually this is just an example and this would be a global message everyone could see on the server.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...