Page 1 of 1

EvalUnqUnit Question

Posted: Sun Dec 28, 2008 7:31 pm
by Hobbes
Hi chaps, just wondering if there is a way to evaluate if a unit doesn't exist in a certain region? I would like to add a captive (merchandise) unit to an Indian village if there is not already one there.

EvalUnqUnit|0|NOT seems to fit the bill but I would like the event to fire inside an event that has an event line with a different location ID.
(i.e. a settlement is taken by Indians at location a and then a captive unit is placed into location b if there is not already a captive unit there).

I can test this myself but I'm tired tonight - so just thought I would ask in case anyone has a ready answer (normally Lodi :) ).

If I put a location in param4 such as $Le Detroit will this always make that bit of an event evaluate that location or does that depend on the script command?

Thanks, Chris

Posted: Mon Dec 29, 2008 12:21 am
by lodilefty
Um, gonna let ya down here :(

No idea :confused:

Posted: Tue Dec 30, 2008 9:10 am
by Pocus
Shame on you, I had to fire Delphi during my holidays, Chris!! :)

Use instead the much more powerful
SelectSubUnits

and then do an evaluation on the count:
EvalSubUnitCount

Posted: Thu Jan 01, 2009 1:52 pm
by Hobbes
Pocus wrote:Shame on you, I had to fire Delphi during my holidays, Chris!! :)

Use instead the much more powerful
SelectSubUnits

and then do an evaluation on the count:
EvalSubUnitCount


Thanks Philippe!
Happy New Year to you both.

Chris

Posted: Fri Jan 02, 2009 10:23 am
by Pocus
And to you two too ;)

Posted: Sat Jan 03, 2009 10:39 pm
by Hobbes
Hi chaps, with these three events (attached file) I'm trying to put a captive British settler unit (merchandise) into an Indian village when Indians take control of a British settlement. The event works fine but should only happen once - if there is already a captive unit in the Indian village the event should not fire again (as per above posts) should the Indians take a second settlement.

I have 2 conditions :-

SelectSubUnits Region $Saint Stephane|Models $mdl_IND_CapPW
EvalSubUnitCount =|0

However, if the Indians take more than one settlement it seems that the EvalSubUnitCount =|0 in the Indian village located in Saint Stephane is ignored and a second captive unit is placed in the village. I can't work out why. Any ideas?

Thanks, Chris

Posted: Sun Jan 04, 2009 2:08 am
by lodilefty
Hobbes wrote:Hi chaps, with these three events (attached file) I'm trying to put a captive British settler unit (merchandise) into an Indian village when Indians take control of a British settlement. The event works fine but should only happen once - if there is already a captive unit in the Indian village the event should not fire again (as per above posts) should the Indians take a second settlement.

I have 2 conditions :-

SelectSubUnits Region $Saint Stephane|Models $mdl_IND_CapPW
EvalSubUnitCount =|0

However, if the Indians take more than one settlement it seems that the EvalSubUnitCount =|0 in the Indian village located in Saint Stephane is ignored and a second captive unit is placed in the village. I can't work out why. Any ideas?

Thanks, Chris


There is nothing to stop the other two from triggering...

You'll need to add two actions to each that set the other two event MaxOccurs = 0 [or set the other two event occurrances to 1]. Then whichever event triggers first, it will disable the other two.

For one example, look at the evt_nam_Warplan_Off event in the 1778 Full Campaign to see how to disable another event.

Posted: Sun Jan 04, 2009 9:59 am
by Hobbes
lodilefty wrote:There is nothing to stop the other two from triggering...

You'll need to add two actions to each that set the other two event MaxOccurs = 0 [or set the other two event occurrances to 1]. Then whichever event triggers first, it will disable the other two.

For one example, look at the evt_nam_Warplan_Off event in the 1778 Full Campaign to see how to disable another event.


I don't understand why the =|0 doesn't stop a second event from triggering. Once a captive unit exists at Saint Stephen no other event should fire surely?

Cheers, Chris

Posted: Sun Jan 04, 2009 1:31 pm
by lodilefty
hm, dunno. :confused:

Try setting param as <|1 to see if it works.....

Posted: Sun Jan 04, 2009 2:34 pm
by Hobbes
Thanks Lodi, <|1 works =|0 does not. A bug (or maybe some problem with the ' prefix I entered)?

Cheers, Chris

Posted: Sun Jan 04, 2009 3:08 pm
by lodilefty
:tournepas
:thumbsup: