Home   Help Search Login Register  

Author Topic: Mission ending intitiated by a script, how?  (Read 1940 times)

0 Members and 1 Guest are viewing this topic.

1stJemHadar

  • Guest
Mission ending intitiated by a script, how?
« on: 22 Aug 2002, 14:46:15 »
Hi everyone.

I need some help with a mission I'm working on.

You see, I have a script which checks the status of the different objectives.
Now, if the player get's too close to a gamelogic that I have placed on the map, I wan't the player to loose the mission. But what is the command for use in scripts that makes the player loose the game?

Thanks.

mikeb

  • Guest
Re:Mission ending intitiated by a script, how?
« Reply #1 on: 22 Aug 2002, 14:49:31 »
Can't see anything in the comref.  Can't you just create a trigger with a condition that doesn't let the unit get within a certain distance and if he does then the trigger (loose) will be activated?

Or have I misunderstood what you're doing?

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Mission ending intitiated by a script, how?
« Reply #2 on: 22 Aug 2002, 15:20:44 »
The way I generally do it looks a bit like this:

Script

...
? player distance logic < 50: loose = true
...

Trigger

Radius: 0,0
Condition: none
Type: End Loose
Condition Field: loose

That will activate the trigger as soon as loose becomes true (which happens in the script, if the player is less than 50m from logic)

The specific name loose isn't important, this is just a variable. You can use whatever name you like (apart from a few reserved words).
Just rememeber to define the variable (ie. put loose = false) in your init.sqs or in the init field of a unit somewhere ;)

1stJemHadar

  • Guest
Re:Mission ending intitiated by a script, how?
« Reply #3 on: 22 Aug 2002, 22:36:01 »
mikeb -
Normally I could do that, but I do not believe I can use only triggers in this case. That is, it there isn't some way to deactivate a trigger.



Sui -
Great, thanks ;D
That solved my problem.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Mission ending intitiated by a script, how?
« Reply #4 on: 23 Aug 2002, 04:17:31 »
No Worries mate :)

Do you think you could use the Problem Solved button please (Top right by the quote button).

That way the lovely and talented FAQ Guys will see that this topic's been solved when they come round collecting for the Editing Depot. Thanks ;)
« Last Edit: 23 Aug 2002, 04:18:17 by Sui »

1stJemHadar

  • Guest
Re:Mission ending intitiated by a script, how?
« Reply #5 on: 23 Aug 2002, 15:51:18 »
Oh, certainly. Didn't know such a button existed.