Razor77

Setvariable etc

5 posts in this topic

Hi, Could anybody please explain to me the differance between, Publicvariable, publicvariableVal, SetVariable, SetvariableVal etc I am getting many kicks recently eg "Box_1" and many others.  They are flagged up in the Setvariable.txt, but im never sure where to add them, and Im also adding them all to the first line is this correct.  And the other issue is how do i decide if to do !"Box_1" or !="Box_1".

 

I would appreciate if anybody could post a image of there files so I could see how they are setup, as I am adding the filters to all of them sometimes.  The files are beginning to look all messed up.

 

Thanks in advance Razor

Share this post


Link to post
Share on other sites

!"Box_1" > find the phrase inside the expression so would match "Box_1_AI", "Box_1_blah" and "Box_1_XXX" fine etc

 !="Box_1" > match exact phrase so would not match "Box_1_AI"

Variable is the label, variableVal is the value of a variable

so you may unblock a variable "x" (in Publicvariable) but also unblock x having the value of "1" etc (in publicvariableVal)

 

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement
1 hour ago, red_ned said:

!"Box_1" > find the phrase inside the expression so would match "Box_1_AI", "Box_1_blah" and "Box_1_XXX" fine etc

 !="Box_1" > match exact phrase so would not match "Box_1_AI"

Variable is the label, variableVal is the value of a variable

so you may unblock a variable "x" (in Publicvariable) but also unblock x having the value of "1" etc (in publicvariableVal)

 

Thanks red-ned, that makes a little more sense.  I have been putting !="***" more than just !"***" so i am having to add filters more often.  I will revies my setvariables and change some too !"***"

Its currnetly looking very cluttered :)

Thanks Razor

Share this post


Link to post
Share on other sites

Posted (edited)

@Razor77 its really useful in creatvehicle to whitelist whole mods:

!"O_" !"I_" !"M_" !"I_mas_" !"O_mas_" !"B_mas_" !"_mas_" !"rhs_" !"rhsusf_" !"RHS_" !"mas_" !="launch_" !"CUP_" etc.....

 

note: it doesn't work in the scripts.txt file!

Edited by red_ned
1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

setVariable sets a variable based on the unit that's in front of the setVariable, ie

_target = "CharlieSheen";

_target setVariable ["iswinning",1]; 

 

If you use this in a server side script, or a script that is being ran on the server either through ExecVM or BIS_fn_MP, you will need to use publicvariable to broadcast the change to all clients, ie

_target = "CharlieSheen";

["(_target,1)","fn_iswinning",false,false] BIS_fn_MP;

 

Google is your friend here, use simple search strings such as "arma 3 setVariable" or "arma 3 pubicVariable" to find the BI pages on their usage.

 

! = not, ie
if (!isServer) then {

//stuff in here will only run if whatever running it is not the server

//aka only clients and headless clients

};

Edited by wasti

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.