Jump to content
NakedSquirrel

Please Help I can't set a basic variable = true

Recommended Posts

What is the correct syntax to set a condition to true or false?

 

I have been trying to get basic conditional triggers to work in ARMA 3, but when I set the trigger condition to:

 

TRIGGERWORK = true

 

the trigger doesn't activate. 

 

I'm pulling my hair out on this one >.<

 

 

Basically the mission is

 

 

Trigger 1

Radio Alpha

Condition: this

Onactivation: TRIGGERWORK=true

 

Trigger 2

Nothing present

condition: TRIGGERWORK=true

Onactivation: Hint "This trigger worked"

 

I radio alpha, nothing happens.

 

I have tried setting TRIGGERWORK=false in the init file but no dice.   I also tried a TRIGGERWORK=true;this combo, but that just makes it activate before trigger 1 has activated.

 

I know this is a basic editor question, but any help would be greatly appreciated, I swear this worked fine in ARMA 2.

 

 

(PS:  Are the timer/countdown functions for triggers broken with ARMA 3?  I can't seem to get those to work either. I can add 1000000 to min mid max, and the trigger activates instantly.)

 

 

 

Share this post


Link to post
Share on other sites


Trigger1

Radio Alpha

Condition: this

Onactivation:

Trigger2

Nothing present

condition: triggerActivated Trigger1

Onactivation: Hint "This trigger worked"

Share this post


Link to post
Share on other sites
Trigger1

Radio Alpha

Condition: this

Onactivation:

 

Trigger2

Nothing present

condition: triggerActivated Trigger1

Onactivation: Hint "This trigger worked"

 

Thanks for the reply Davidoss, but I really need control over the conditional variable

 

ANYTHING = True

 

Basically I have Trigger1 as:

 

nul=execvm "Script.sqf"

Script.sqf:
hint "Script Started";
sleep 60;
hint "60 seconds passed";
ANYTHING=True;
sleep 60;
hint "120 more seconds passed";

Then for trigger 2:

 

Trigger 2

Nothing present

condition: TRIGGERWORK=true

Onactivation: Hint "This trigger worked"

 

 

The only reason I'm using triggers for this is for the 'switch' function. It allows me to link waypoints and direct AI on the map, otherwise I would do this all in a .sqf

 

I realize I could just murder an AI randomly and do "setdamage 1 thisAIsucks" and then have "!alive thisAIsucks" for trigger condition, but there has to be a way to set simple variables as trigger conditions without cluttering my map with random AI civillians that need to be murdered for the mission to continue.

 

I love senseless violence, but the mission clutter is too much.

Share this post


Link to post
Share on other sites

You cant define variables inside condition field.

 

if TRIGGERWORK was defined as true  it is globally true already

 

in codition use

 

TRIGGERWORK          it means activate if TRIGGERWORK is true

 

!TRIGGERWORK          it means activate if TRIGGERWORK is false

Trigger 1

Radio Alpha

Condition: this

Onactivation: TRIGGERWORK=true

 

Trigger 2

Nothing present

condition: TRIGGERWORK

Onactivation: Hint "This trigger worked"

Anyway you can use scripted triggers as well in your script.sqf

Share this post


Link to post
Share on other sites

You cant define variables inside condition

 

if TRIGGERWORK was defined as true  it is globally true already

 

in codition use

 

(TRIGGERWORK)          it means activate if TRIGGERWORK is true

 

!(TRIGGERWORK)          it means activate if TRIGGERWORK is false

Trigger 1

Radio Alpha

Condition: this

Onactivation: TRIGGERWORK=true

 

Trigger 2

Nothing present

condition: (TRIGGERWORK)

Onactivation: Hint "This trigger worked"

Anyway you can use scripted triggers as well in your script.sqf

 

condition: (TRIGGERWORK)

 
Thanks, you're a godsave, the script worked!
 
So for a TRIGGERWORK=False
 
is it (!TRIGGERWORK)   ?

Share this post


Link to post
Share on other sites

I am borrowing this tread..

I have 2 triggers, i walk in to a room with a officer(deadman)  who have intel with him. The intel is on a tabel, when i go in the room i get a hint "The intel is on the tabel" and when i pick it up and leave the room a trigger will give him (deadman) a damage 1, but he shall only die when i go out of the room (trigger 2 has a gunsound when triggert) 

 

Trigger 1

present blufor

Condition: this

Onactivation: hint "The intel is on the tabel"; dead=true

 

Trigger 2

Nothing present

condition: (dead)

Onactivation: deadman setdamage  1; (i have a man called deadman)

 

anyone who can tell me what i do wrong to get trigger 2 to work

 

Thx

Share this post


Link to post
Share on other sites

You need to set the dead variable to false first. Otherwise it is undefined for trigger 2

Share this post


Link to post
Share on other sites

so i can just put a trigger 0 x 0 in a corner and write in Onactivation:  dead=false ??

 

*Or do i have to write  set variabel(dead,false) ?? 

Share this post


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

I am borrowing this tread..

I have 2 triggers, i walk in to a room with a officer(deadman)  who have intel with him. The intel is on a tabel, when i go in the room i get a hint "The intel is on the tabel" and when i pick it up and leave the room a trigger will give him (deadman) a damage 1, but he shall only die when i go out of the room (trigger 2 has a gunsound when triggert) 

 

Trigger 1

present blufor

Condition: this

Onactivation: hint "The intel is on the tabel"; dead=true

 

Trigger 2

Nothing present

condition: (dead)

Onactivation: deadman setdamage  1; (i have a man called deadman)

 

anyone who can tell me what i do wrong to get trigger 2 to work

 

Thx

 

you can do this with single trigger

Trigger 1 (sets its area to cover the room)

present blufor

Condition: this

Onactivation: hint "The intel is on the tabel"; 
OnDEactivation: deadman setdamage  1;

Share this post


Link to post
Share on other sites

The best solution always is to not complicate easy task.

In your case i would use (triggeractivated Trigger1) without any other variables.

But maybe you need the variable for something else

Share this post


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

TRIGGERWORK=False
is assignment
to check you should do TRIGGERWORK==False

  You cannot compare booleans this way, please do not spread misinformation.

 

something == true - WRONG!

something isEqualTo true - correct!

Share this post


Link to post
Share on other sites
15 hours ago, Devastator_cm said:

 

you can do this with single trigger

Trigger 1 (sets its area to cover the room)

present blufor

Condition: this

Onactivation: hint "The intel is on the tabel"; 
OnDEactivation: deadman setdamage  1;

but can i make it so the shot sound comes when i deactivate trigger.

 

 

Share this post


Link to post
Share on other sites
15 hours ago, davidoss said:

The best solution always is to not complicate easy task.

In your case i would use (triggeractivated Trigger1) without any other variables.

But maybe you need the variable for something else

 

(triggeractivated Trigger1) is that in condition.. or where to put it ??

Share this post


Link to post
Share on other sites
17 minutes ago, Play3r said:

but can i make it so the shot sound comes when i deactivate trigger.

 

 

hmm I think not
 

Share this post


Link to post
Share on other sites
8 hours ago, killzone_kid said:

  You cannot compare booleans this way, please do not spread misinformation.

 

something == true - WRONG!

something isEqualTo true - correct!

Thanks for correction but it is not misinformation completely :). Still assignment and comparison operators are valid for other data types :)
I didn't notice that Arma scripting language is not able to compare boolean values with == . Language which I use daily can do that. I should try first if it is the case here as well but I was not playing Arma at that time

Share this post


Link to post
Share on other sites
10 minutes ago, Devastator_cm said:

hmm I think not
 

hmm I want him to shot himself when he have given me the intel :(

Share this post


Link to post
Share on other sites

I would try the following but keep in mind I didn't validate it now by myself and there might be another way to handle your case

 

 

1- Trigger #1

    Activation: Blufor Present in room

    on Activation: Hint "Item is on table";

   this trigger can be activated multiple time 

 

2- Trigger #1

   Activation: Blufor Present (just right after the door of the room. So it will fire when a unit enters or leaves the room)  AND player's inventory has intel item ( I assume intel is an item)

 (https://community.bistudio.com/wiki/items).

   on Activation: enemy setdamage 1; 

 this trigger can be activated once


So this will cover the situation if player goes in room but left it without taking the item in inventory. I don't think that you want your enemy to suicide in that case as well :)

 

Share this post


Link to post
Share on other sites
5 hours ago, Devastator_cm said:

I would try the following but keep in mind I didn't validate it now by myself and there might be another way to handle your case

 

 

1- Trigger #1

    Activation: Blufor Present in room

    on Activation: Hint "Item is on table";

   this trigger can be activated multiple time 

 

2- Trigger #1

   Activation: Blufor Present (just right after the door of the room. So it will fire when a unit enters or leaves the room)  AND player's inventory has intel item ( I assume intel is an item)

 (https://community.bistudio.com/wiki/items).

   on Activation: enemy setdamage 1; 

 this trigger can be activated once


So this will cover the situation if player goes in room but left it without taking the item in inventory. I don't think that you want your enemy to suicide in that case as well :)

 

 _itemsplayer = items player;

 

i don't understand the WIKI

 

How is the right way to fill this line 

The player is called BOSS

the Intel is called PHOTO

Share this post


Link to post
Share on other sites

ok thanks to you I know now there is objects which creates diary records and called "Intel" and can be created by bis_fnc_initIntelObject :)
I beleive you used the objects under "Things" > "Intel" which has already bis_fnc_initIntelObject  setup by default.

 

So here is the solution for you

 

1- Trigger #1
    Activation: Blufor Present  in room
    Condition : this && alive BOSS
    on Activation: Hint "Intel is on table";
    this trigger can be activated multiple time 
 
2- Trigger #2
   Activation: Blufor Present (just right after the door of the room. So it will fire when a unit enters or leaves the room)  
   Condition: !alive PHOTO
   on Activation: Boss setdamage 1; 
   this trigger can be activated once

 

 

Share this post


Link to post
Share on other sites
36 minutes ago, Devastator_cm said:

ok thanks to you I know now there is objects which creates diary records and called "Intel" and can be created by bis_fnc_initIntelObject :)
I beleive you used the objects under "Things" > "Intel" which has already bis_fnc_initIntelObject  setup by default.

 

So here is the solution for you

 

1- Trigger #1
    Activation: Blufor Present  in room
    Condition : this && alive BOSS
    on Activation: Hint "Intel is on table";
    this trigger can be activated multiple time 
 
2- Trigger #2
   Activation: Blufor Present (just right after the door of the room. So it will fire when a unit enters or leaves the room)  
   Condition: !alive PHOTO
   on Activation: Boss setdamage 1; 
   this trigger can be activated once

 

 

it does not work when i activated trigger 1 and pick up the PHOTO trigger 2 kills the enemy with out me walking out of the room.

 

i edit on the map UTES from CUP

 

I walk up to a building and goes true a door into a room true that room into another room, where i find the enemy on the floor (done with 3den Enhanced tools) there is a tabel in the room where the Photo is on.

when i leave the room i want the enemy to "shot" him self on my way out when i leave room 2 WITH the photo.

 

i walk from hallway to room 2 to room 1, picture in dropbox link

in room 1 is the enemy 

want him to die when i go out room 2

 

I do walk tru trigger2 on my way to trigger1, can that have anything to do with it..

My player is called boss and the enemy is called deadman intel is called Photo

https://www.dropbox.com/sh/wtk12ke5npca5ty/AABsePn3HMKtpoZ6N9miV1qRa?dl=0

THX for your time

Share this post


Link to post
Share on other sites
4 minutes ago, Devastator_cm said:

my mistake...

set the contion to Condition: this && !alive PHOTO

WHEE it did work 

 

THX for the help

this is what it ended up with for my triggers..


 1- Trigger #1
    Activation: Blufor Present  in room
    Condition : this && alive deadman

    on Activation: Hint "PHOTO is on table";
    this trigger can be activated multiple time 
 
2- Trigger #2
   Activation: Blufor Present (just right after the door of the room. So it will fire when a unit enters or leaves the room)  
   Condition: this && !alive PHOTO  <- the name of my intelobjekt
   on Activation: deadman setdamage 1; 
   this trigger can be activated once

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×