OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Blanco on 13 Apr 2005, 02:51:40

Title: condition of presence
Post by: Blanco on 13 Apr 2005, 02:51:40
There a field named "condition of presence" in the properties of a unit. I know what it means, but I don't know the usage.

I have 3 difficulty levels (easy, medium & hard) defined in a variable diff
? Diff == 0 means you are playing in easy mode
? Diff == 1 means you are playing in medium mode?
? Diff == 2 means you are playing in hard mode

There are some units on my map with 60% probability of presence, this is for the medium mode. When you play the mission on hard mode I want to change this in 100%
Am I in the right field for this and what do I have to write in it?
Title: Re:condition of presence
Post by: THobson on 13 Apr 2005, 07:41:48
There is a probability of presence and a condition of presence.

The probability is a sliding scale and I have found no way to change it other than in the editor.

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)

One possibility is:

Have different units for the hard, easy and medium, levels each with their own probabilities of presence.  When you establish the difficulty level then do a deleteVehicle on those you don't want.

Another option is to create all the units with 100% probability and then randomly delete some, the number you delete depending on the difficulty level.
Title: Re:condition of presence
Post by: Blanco on 13 Apr 2005, 07:56:45
Ok, thanks, I think I choose for that 2th option :)
Title: Re:condition of presence
Post by: bdfy1 on 14 Apr 2005, 11:36:21
You can type
Quote
!cadetmode
in unit's condition of presence line. Then this unit will appear only if you are playing veteran mode ;)