Home   Help Search Login Register  

Author Topic: Condition of Presence and !alive  (Read 1359 times)

0 Members and 1 Guest are viewing this topic.

Offline snafu

  • Members
  • *
Condition of Presence and !alive
« on: 01 Mar 2018, 15:21:45 »
Hello all

I'm designing a mission and looking for easy ways to give it a degree of randomness. For example, I have an enemy group in an LP/OP where the leader's Probability of Presence is set to 30%. The soldiers in his group have alive e3 in their Condition of Presence field.

I thought I could use Condition of Presence to add some easy replay value to the mission. So, I placed a group and an MG vehicle with their Condition of Presence fields containing !alive e3, thinking that when e3 did not spawn they would do so instead.

I discovered during testing that this did not work and from reading I see it's a limitation of the Condition of Presence field.

Is there a simple way to work around this problem?  :hmmm:

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Condition of Presence and !alive
« Reply #1 on: 01 Mar 2018, 17:17:08 »
Go vice versa, delete the MG via a trigger or script in case e3 is alive.

Just remember that in OFP when you delete a vehicle with crew the crew doesn't get deleted so you need to jump additional hoops to get the gunner to disappear as well. Can't remember how it was done but IIRC you need to move the gunner out of the MG (however that was done) and delete 'him' after that, or maybe easier to delete him after the gun is gone..  :hmmm:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Condition of Presence and !alive
« Reply #2 on: 01 Mar 2018, 18:42:14 »
Following on from what h- said, if you want to get rid of the gunner and the mg, I'd have thought that...

Code: [Select]
_gunner = gunner _mg
deletevehicle _gunner
deletevehicle _mg

...would work. Though if you do in fact need to move the gunner out before deleting him, I suppose you could get him to do this:

Code: [Select]
_gunner = gunner _mg

_gunner action ["getout", _mg]
deletevehicle _gunner
deletevehicle _mg

Where I'm a bit hazy with this one though is whether _gunner is still usable when he's no longer in the mg. You could do all this with global variables, i.e. naming the unit you want to be in the mg. In which case the name of the unit is the same whether he's in the mg or not.

It's been a long time since I've done anything like this and I can't easily check what works and what doesn't. I do recall doing something similar to this.
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline snafu

  • Members
  • *
Re: Condition of Presence and !alive
« Reply #3 on: 02 Mar 2018, 00:04:47 »
Thank you for the assistance guys, I have it working nicely  :good: