OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: edge2 on 01 Aug 2008, 16:34:30
-
Hey, I'm having a problem with conditions. As far as I know, its possible to define something like thatcondition = true/false in a script... well anyway the point is that I have a trigger that I don't need to be activated unless another script has activated. I just thought that writting mycondition = false in init.sqs and in the triggers condition field writting mycondition = true. And in the second script there is mycondition = true, so when that script is activated, it's possible to activate the trigger... Im quite new with conditions and my technique just looked too simple to work,
Please help :)
Thanks
-
I don't know if this will work as a solution, but I know that I don't like the true/false system and instead replace it with numbers. So you could change it to mycondition = 1.
Also, it may be important to remember the difference between = and ==.
Heres the two in examples to clear up what they mean:
mycondition = 1This means that mycondition is set to a value of 1
mycondition == 1This checks if mycondition equals 1.
You could try this, and if it doesn't work then maybe someone else could have a solution.
-=GC=-Funguns1999
-
Thanks for the help, but when I use this method... when mycondition = 1 the trigger starts even without my presence. Although that might be useful later, but not exactly what I need now. Or I'm doing it incorrectly? ???
-
I don't know if I got it right but AFAIK in the condition field, when using true/false system, you should only type mycondition (withouth the "=true")
So I think it should work
in init.sqs:
mycondition=false (but i'm not sure if this is needed at all, i use it always - newbie)
in the script somewhere
mycondition=true
and in the trigger's condition field:
mycondition
-
Nope, the trigger automatically starts when the script is executed >:(
-
Yes, that's what I had in mind :D
Sorry, I still don't understand the problem, a bit tired here
well anyway the point is that I have a trigger that I don't need to be activated unless another script has activated.
So, you want a trigger to remain silent until the script with trigger's condition "trues" the condition?
Could you give an example
-
I thought that it'll sound with no sense. :-[
I have a trigger, which has to be activated by the player. Problem is that I need that trigger to be idle for a while and then active. Because if it is possible to activate the trigger at any time, it'll most likely mess up the mission. (Active as I can activate it by walking close to it, because with that method I can be 5 km away from the trigger and it will still start.) Hope you get the idea
-
Okay this is what I'd do
in init.sqs put
mycondition=true
in trigger - say you put a radius and you want to activate it when West is present, so
west/present
in condition field
this
in On activation field
[] exec "check.sqs"
make check.sqs in mission folder
and in check.sqs try this
#loop
?not mycondition : goto "execute"
goto "loop"
#execute
t1 setdammage 1 (or some other consequence)
exit
THEN make another trigger which will set, say on RadioAlpha
mycondition=false
What this does:
I made a small mission to test it. Placed a Shilka with a name t1 and a player nearby.
Placed the trigger with a radius and activation west/present, so that the player would activate it.
Placed another trigger with RadioAlpha as a condition and a mycondition=true in on activation field.
When i touched the radioalpha, shilka exploded
Summary:
check.sqs tests for mycondition=false using the loop
when it gets false it executes something
Hope this helps
-
I'll Test it a little later, but before you test something like that... well from my experience, it's best to be out of the triggers activation field to see if the shilka will explode... if yes - fail if no - success :D
-
Yes it should also work with the player out of the trigger's radius, since the mycondition=true is in the init.sqs.
-
That is what I don't need, might as well use a script if the trigger acts like that :dry:
EDIT: Right, all I needed was to write this AND mycondition = true in the condition field :banghead:
Thanks for the help though :good: