Home   Help Search Login Register  

Author Topic: Question about Condition of presence  (Read 1432 times)

0 Members and 1 Guest are viewing this topic.

Offline Rytuklis

  • Members
  • *
Question about Condition of presence
« on: 12 Sep 2011, 19:39:41 »
Alright so i have one question. I have put East Guards around the Montignac, and i make a couple of cutscenes, then in cutscene script i type in "sovSold1 (soviet soldier) setDamage"

After that, i put some resistance and in their conditon of presence i put NOT ALIVE sovSold1

They do not appear after SovSold1 takes damage . Can you help me?

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Question about Condition of presence
« Reply #1 on: 12 Sep 2011, 20:40:41 »
I think the best way to have some resistance soldiers appear as a result of sovSold1 dying is to use the getdammage command in conjunction with the createunit command. For example:

Create a script which loops from the beginning:

Code: [Select]

#LOOP

? (getdammage sovSold1) > 0.9: goto "SUB"

goto "LOOP"

#SUB

"soldierGB" createUnit [getMarkerPos "spawnmarker", guergrp1,"", 1, "corporal"]
"soldierGB" createUnit [getMarkerPos "spawnmarker", guergrp1,"", 1, "corporal"]
"soldierGB" createUnit [getMarkerPos "spawnmarker", guergrp1,"", 1, "corporal"]
"soldierGB" createUnit [getMarkerPos "spawnmarker", guergrp1,"", 1, "corporal"]

exit


You could replace sovSold1 in this script with _soldier, so that the script can be used with more than one soldier.

The 'spawnmarker' can be placed wherever you want the guerillas to appear, and 'guergrp1' is the pre-defined group name.

The script can be run from the init.sqs

Hope this helps

Gruntage
"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

Walter_E_Kurtz

  • Guest
Re: Question about Condition of presence
« Reply #2 on: 13 Sep 2011, 00:16:40 »
An exploratory search for "Condition of Presence" would give you some hints:

The condition of presence is a boolean.  What I have found about that field is:

- the OFP engine resolves that value before running init.sqs so putting a variable in there does not help control which units are created.
- the not condition needs to be used with care (eg not (alive unit1) will always resolve as false and the unit will never appear)
         in other words

condition of presence has to be something that is true or false at mission load. It can NOT be something that happens later in the mission

Use a variable rather than setDammage-ing a unit, eg. NowSpawn = true.

Then you can EITHER spawn them as described by Gruntage (though the loop ought to have a delay in it) OR have them present from the start of the mission and setPos them into position.