User avatar
Hobbes
Posts: 4437
Joined: Sat Mar 11, 2006 12:18 am
Location: UK

EvalUnqUnit Question

Sun Dec 28, 2008 7:31 pm

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

User avatar
lodilefty
Posts: 7616
Joined: Sat Aug 11, 2007 3:27 pm
Location: Finger Lakes, NY GMT -5 US Eastern

Mon Dec 29, 2008 12:21 am

Um, gonna let ya down here :(

No idea :confused:
Always ask yourself: "Am I part of the Solution?" If you aren't, then you are part of the Problem!
[CENTER][/CENTER]
[CENTER]Visit AGEWiki - your increasingly comprehensive source for information about AGE games[/CENTER]

[CENTER]Rules for new members[/CENTER]
[CENTER]Forum Rules[/CENTER]

[CENTER]Help desk: support@slitherine.co.uk[/CENTER]

User avatar
Pocus
Posts: 25664
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Tue Dec 30, 2008 9:10 am

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
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Hobbes
Posts: 4437
Joined: Sat Mar 11, 2006 12:18 am
Location: UK

Thu Jan 01, 2009 1:52 pm

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

User avatar
Pocus
Posts: 25664
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Fri Jan 02, 2009 10:23 am

And to you two too ;)
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Hobbes
Posts: 4437
Joined: Sat Mar 11, 2006 12:18 am
Location: UK

Sat Jan 03, 2009 10:39 pm

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
Attachments

[The extension xls has been deactivated and can no longer be displayed.]


User avatar
lodilefty
Posts: 7616
Joined: Sat Aug 11, 2007 3:27 pm
Location: Finger Lakes, NY GMT -5 US Eastern

Sun Jan 04, 2009 2:08 am

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.
Always ask yourself: "Am I part of the Solution?" If you aren't, then you are part of the Problem!
[CENTER][/CENTER]

[CENTER]Visit AGEWiki - your increasingly comprehensive source for information about AGE games[/CENTER]



[CENTER]Rules for new members[/CENTER]

[CENTER]Forum Rules[/CENTER]



[CENTER]Help desk: support@slitherine.co.uk[/CENTER]

User avatar
Hobbes
Posts: 4437
Joined: Sat Mar 11, 2006 12:18 am
Location: UK

Sun Jan 04, 2009 9:59 am

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

User avatar
lodilefty
Posts: 7616
Joined: Sat Aug 11, 2007 3:27 pm
Location: Finger Lakes, NY GMT -5 US Eastern

Sun Jan 04, 2009 1:31 pm

hm, dunno. :confused:

Try setting param as <|1 to see if it works.....
Always ask yourself: "Am I part of the Solution?" If you aren't, then you are part of the Problem!
[CENTER][/CENTER]

[CENTER]Visit AGEWiki - your increasingly comprehensive source for information about AGE games[/CENTER]



[CENTER]Rules for new members[/CENTER]

[CENTER]Forum Rules[/CENTER]



[CENTER]Help desk: support@slitherine.co.uk[/CENTER]

User avatar
Hobbes
Posts: 4437
Joined: Sat Mar 11, 2006 12:18 am
Location: UK

Sun Jan 04, 2009 2:34 pm

Thanks Lodi, <|1 works =|0 does not. A bug (or maybe some problem with the ' prefix I entered)?

Cheers, Chris

User avatar
lodilefty
Posts: 7616
Joined: Sat Aug 11, 2007 3:27 pm
Location: Finger Lakes, NY GMT -5 US Eastern

Sun Jan 04, 2009 3:08 pm

:tournepas
:thumbsup:
Always ask yourself: "Am I part of the Solution?" If you aren't, then you are part of the Problem!
[CENTER][/CENTER]

[CENTER]Visit AGEWiki - your increasingly comprehensive source for information about AGE games[/CENTER]



[CENTER]Rules for new members[/CENTER]

[CENTER]Forum Rules[/CENTER]



[CENTER]Help desk: support@slitherine.co.uk[/CENTER]

Return to “WIA Mods”

Who is online

Users browsing this forum: No registered users and 4 guests