Home   Help Search Login Register  

Author Topic: Activating script on condition and hiding markers  (Read 596 times)

0 Members and 1 Guest are viewing this topic.

BHD Mod

  • Guest
Activating script on condition and hiding markers
« on: 16 Jun 2004, 03:53:06 »
Is there a way to activate a script only if another specified script is activated? "scriptname.sqs" true in condition field??? Also, does anyone know how to hide and unhide markers?
Thanks in advance
« Last Edit: 16 Jun 2004, 07:04:05 by BHD Mod »

Mr.BoDean

  • Guest
Re:Activating A Script on a condition
« Reply #1 on: 16 Jun 2004, 06:59:48 »
In short, yes.  :) Me explaining it correctly ...  :-X  but I'll try.

By using a global variable you can pass it to another script.

I use the following for a mission to get a chopper to cycle on a route, drop troops, go to a holding area and wait to move and drop more troops.

In the Heli move script:

Code: [Select]
Hold = false
In the troop dropping script:
Heli drops troops .... then

Code: [Select]
#wait1
Hold = true
?("alive _x" count units paragroup0 == 0) || ("alive _x" count units paragroup1 == 0): goto "waitcount"
~3
goto "wait1"


#waitcount
Hold = false

This works great for me, so you might use the same idea.  ;)

BHD Mod

  • Guest
Re:Activating A Script on a condition
« Reply #2 on: 16 Jun 2004, 07:01:24 »
thanks i'll try that

ponq

  • Guest
Re:Activating script on condition and hiding markers
« Reply #3 on: 16 Jun 2004, 09:31:37 »
You can set an markter hidden like this:

-create a marker in the editor, name it marker1

-in the init.sqs set
Code: [Select]
"marker1" SetMarkerType "Empty"
-then in a script once you need the marker to be visible:
Code: [Select]
"marker1" setMarkterType "Destroy" or to a type that you need

gl
(search this site for some more info, there's a nice tute on this)
« Last Edit: 16 Jun 2004, 09:32:42 by ponq »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Activating script on condition and hiding markers
« Reply #4 on: 16 Jun 2004, 11:36:55 »
You can also call a script from another script.

Alternatively, you can use variables in triggers to ensure that the second script can only be called if the first one already has been.

Plenty of reviewed ArmA missions for you to play

BHD Mod

  • Guest
Re:Activating script on condition and hiding markers
« Reply #5 on: 16 Jun 2004, 19:40:03 »
thanks all, but how can i use variables to make is so that a script can only be activated if another one can like what Macguba said? thanks again

Mr.BoDean

  • Guest
Re:Activating script on condition and hiding markers
« Reply #6 on: 16 Jun 2004, 21:59:17 »
Well, decide what you want to activate that second script.  The first script? Why not just run the second script from a line in the first script?

Example 1

Script1.sqs
papabear sidechat "Reinforcements are on the way!"
group1 move getpos maingroup

[] exec "Script2.sqs"


Example 2 is like my example above:

In INIT.sqs:
Script2 = false

In a trigger's On Activation line:
Script 2 = true

OR

In Script1.sqs:
papabear sidechat "Reinforcements are on the way!"
group1 move getpos maingroup

Script2 = true


Script2.sqs:
#Wait
?Script2 : goto "start"
~1
goto "wait"

#start
.....rest of script....


 

BHD Mod

  • Guest
Re:Activating script on condition and hiding markers
« Reply #7 on: 18 Jun 2004, 02:50:51 »
thanks all