Home   Help Search Login Register  

Author Topic: How to stop a script!?  (Read 1808 times)

0 Members and 3 Guests are viewing this topic.

Offline Luminous

  • Members
  • *
How to stop a script!?
« on: 17 Jan 2008, 15:39:34 »
Afternoon Chaps

I am creating a mission which involves a suicide bomber how it works is blufor presence activates trigger activating a script set on the bomber boom he blows up!

But if he is dead already i want to stop the script from activating when blufor hit the trigger or remove the trigger whichever way round is possible!

Obviously why im here i dont know how to do it where to put it etc im a noob to scripting but i know !alive means Dead but dont know what to put after that or where if u could help that would be fantastic!

Thanks in advance

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to stop a script!?
« Reply #1 on: 17 Jan 2008, 16:21:24 »
well, you've partly answered your own question. in the trigger's condition field, you'll see 'this'. change the field to read

Code: [Select]
this and not (alive suicide_bomber_name)
obviously the suicide bomber unit needs to have a name entered in the name field. untested, but it should work.

and don't worry about noobness - we were all new once ;)

Offline Luminous

  • Members
  • *
Re: How to stop a script!?
« Reply #2 on: 17 Jan 2008, 16:50:37 »
Thanks very much ill try that when i get in! Im slowly getting the hang of the commands :)

Offline Luminous

  • Members
  • *
Re: How to stop a script!?
« Reply #3 on: 17 Jan 2008, 19:53:53 »
well, you've partly answered your own question. in the trigger's condition field, you'll see 'this'. change the field to read

Code: [Select]
this and not (alive suicide_bomber_name)
obviously the suicide bomber unit needs to have a name entered in the name field. untested, but it should work.

and don't worry about noobness - we were all new once ;)

Alright ive just tried that code but unfortunately doesnt work unless he is dead!  :) I want it NOT to work when he is dead but work when he is alive! Cheers anyway

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: How to stop a script!?
« Reply #4 on: 17 Jan 2008, 20:45:28 »
Well, heh. :D bedges did a little miss there: just remove the not and it'll work.

What you're doing here is not per say "stopping" the script: you're simply giving it more conditions to meet before it can work. For instance if the dead man suddenly came back to life after being killed, the trigger would miraculously work again. ;)

"this" in this (no pun intended) case simply means "the default thing that triggers this trigger". Which is probably something like (as you've put it above) "blufor present".

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: How to stop a script!?
« Reply #5 on: 17 Jan 2008, 20:46:46 »
Quote
this && alive unitName

-Put the above line in the Condition field of a trigger which is activated by...Blufor 'Present' for example

& the trigger will only activate if the passed unit is alive.

***However you could achieve the same result by grouping a Unit to a trigger (condition field > 'this') & setting the activation field of the said trigger to Vehicle||Group Leader||Any Group Member||etc, 'Present'. Since im figuring that the unit has to be alive to activate the trigger in this case, the trigger will activate because - by the Unit being present, the Unit is alive....however, if you want the trigger to activate when the Unit is dead simply change the activation field to 'Not Present", becasue when the Unit is dead within the trigger he is then 'Not Present'...obviously because he is Dead > Not Alive, therefore > Not Present.
« Last Edit: 17 Jan 2008, 21:22:59 by Carroll »

Offline Luminous

  • Members
  • *
Re: How to stop a script!?
« Reply #6 on: 17 Jan 2008, 22:31:36 »
-Put the above line in the Condition field of a trigger which is activated by...Blufor 'Present' for example

& the trigger will only activate if the passed unit is alive.

***However you could achieve the same result by grouping a Unit to a trigger (condition field > 'this') & setting the activation field of the said trigger to Vehicle||Group Leader||Any Group Member||etc, 'Present'. Since im figuring that the unit has to be alive to activate the trigger in this case, the trigger will activate because - by the Unit being present, the Unit is alive....however, if you want the trigger to activate when the Unit is dead simply change the activation field to 'Not Present", becasue when the Unit is dead within the trigger he is then 'Not Present'...obviously because he is Dead > Not Alive, therefore > Not Present.

Just tried this code works great thanks very much guys much appreciated!  :clap: ;)