Page 1 of 1

EvalEvent question

Posted: Wed Jul 08, 2009 8:14 pm
by Hobbes
Hi chaps, if I have an _ON event which includes

EvalEvent evt_nam_IND_TESTPW_Check|=|0

Once the _Check event has fired once is there any way of resetting it later
in the _REGEN event so that EvalEvent evt_nam_IND_TESTPW_Check|=|0
becomes true once more?

I have tried ChgEvtOccurs evt_nam_GBR_TESTPW_Check|MaxOccurs|1
but this doesnt seem to affect the EvalEvent check.

Thanks, Chris

Posted: Thu Jul 09, 2009 6:49 am
by PhilThib
May be try with ChgEvtOccurs evt_nam_GBR_TESTPW_Check|CuOccurs|0

Well, it would 'tell' that the number of current occurences of the event is 0, i.e. it has not yet occured... should work IMHO ;)

Posted: Thu Jul 09, 2009 7:18 am
by Gray_Lensman
deleted

Posted: Thu Jul 09, 2009 7:38 am
by Gray_Lensman
deleted

Posted: Thu Jul 09, 2009 12:00 pm
by Hobbes
Thanks chaps. Without going into too much detail it sounds like CuOccurs wont be the solution for me (very useful info though). Instead I think I will stop using the EvalEvent check in _ON and instead use ChgEvtOccurs in _Regen to initialise the _AI _ON and _Check events.

I’m having a lot of problems trying to get options to only be available when all the criteria are met.
At the moment once the option condition arguments are all valid the option will always be available even if the conditions change.

For example I need to offer a player an option from May ’63 until Sep ’63 but only on turns where the conditions are still met (So I use an _OFF each turn and have a StartEvent of 999 on the _ON).
When _Check fires the _ON StartEvent is changed to 0. But then I need to give the same option to players the following spring and I need to know not if the option has been selected already this scenario, but if it has been selected since the last _regen.

Cheers, Chris

Posted: Thu Jul 09, 2009 7:20 pm
by Gray_Lensman
deleted

Posted: Thu Jul 09, 2009 8:14 pm
by Hobbes
If anyone has any ideas I have attached my test event. I thought this would work with the _ON event firing each turn until _Check is fired and ChgEvtOccurs evt_nam_IND_TESTPW_ON|MaxOccurs|0 then preventing _ON from firing again until the _Regen event is fired and sets
ChgEvtOccurs evt_nam_IND_TESTPW_ON|MaxOccurs|999.

However the ChgEvtOccurs in _Check seems to have no effect and _ON continues to fire each turn.

Confused! :confused:
Should ChgEvtOccurs evt_nam_IND_TESTPW_ON|MaxOccurs|0 not in effect change the _ON StartEvent to 0?

Cheers, Chris

Posted: Fri Jul 10, 2009 11:09 am
by Hobbes
I suppose the simple question I have is - if I have an _ON event with a StartEvent 999 is there any way of turning this off?

Once it has been checked I am using :-

ChgEvtOccurs to set MaxOccurs to 0 for the _ON event
I also set MaxUse to 0 in the ChangeActorPool command (should this have the same effect?)

Neither of these seem to have any effect and _ON fires again next turn.

Could this be a bug?

Cheers, Chris

Posted: Fri Jul 10, 2009 3:54 pm
by Hobbes
P.S. having thought about EvalEvent some more there really should be a way of resetting the number of times an event has fired back to zero (So that EvalEvent thinks =0 is true). If this cannot be done in a _Regen type event then it could cause quite a few problems when other events reference it using EvalEvent after a _Regen has fired.

For example I have an option event which is available once a year where Indians can seek out French and Spanish traders. This option can have several outcomes and depends on checking to see if other events have fired or not. I need to reset all the events that are part of this option at the start of each year (in _Regen) so that EvalEvent will again return zero for all events in this chain.

If I can’t do this it will be pointless to attempt to fire this option more than once.

So I'm pretty stuck at the moment. I can't see any way to stop an event with a StartEvent of 999 from firing or any way to reset the event counter back to zero. :(

Any ideas gratefully received!
Cheers, Chris

Posted: Fri Jul 10, 2009 4:49 pm
by Pocus
Have you tried ChgEvtOccurs = MyEvent|MaxOccurs|-999

to reduce to 0 (sleep mode) an event which can occurs 999 time?

Or alternatively

SetEvtOccurs = MyEvent|MaxOccurs|0

To set the max # of occurences to 0 (sleep mode)

There is also this one:
SetEvtOccurs = MyEvent|cuOccurs|0

Meaning that here the max # of occurrences don't change, but the event never fired (it has, but we reset to 0 the # of time it fired)

Posted: Fri Jul 10, 2009 5:49 pm
by Gray_Lensman
deleted

Posted: Fri Jul 10, 2009 6:03 pm
by Generalisimo
Gray_Lensman wrote:I personally do not possess the Vulcan mind meld capability. :D

It's your fault then... Image

Posted: Fri Jul 10, 2009 6:27 pm
by Hobbes
Pocus wrote:Have you tried ChgEvtOccurs = MyEvent|MaxOccurs|-999

to reduce to 0 (sleep mode) an event which can occurs 999 time?

Or alternatively

SetEvtOccurs = MyEvent|MaxOccurs|0

To set the max # of occurences to 0 (sleep mode)

There is also this one:
SetEvtOccurs = MyEvent|cuOccurs|0

Meaning that here the max # of occurrences don't change, but the event never fired (it has, but we reset to 0 the # of time it fired)


Bravo! Thanks for this treasure trove Philippe! :thumbsup:

Hopefully this will solve all of my problems. I'll post here when I have tested through.

Thanks, Chris

Posted: Fri Jul 10, 2009 10:25 pm
by Hobbes
Gray_Lensman wrote:This pretty much demonstrates the fact that someone needs to put together in a document or source thread, all the event syntax(s) and their varations. I personally do not possess the Vulcan mind meld capability. :D


I have a Pocus mind probe though so maybe I can put together something later in the year. The Mod guide is great - very useful but there are certainly many things that are not mentioned.

I keep thinking now I really understand it all and then realise it's not the case.

Chris

Posted: Sat Jul 11, 2009 9:35 am
by Rafiki
Gray_Lensman wrote:This pretty much demonstrates the fact that someone needs to put together in a document or source thread, all the event syntax(s) and their varations. I personally do not possess the Vulcan mind meld capability. :D

This is the exact purpose of AGEWiki

Anyone got some hours to lend me? *sigh* :(

Posted: Sat Jul 11, 2009 10:21 am
by Hobbes
Rafiki wrote:This is the exact purpose of AGEWiki

Anyone got some hours to lend me? *sigh* :(


I may have when the Pontiac scenario is completed - but if anyone wants to do this please go ahead!

I have tested my events with Philippe's suggestions and all work fine now.

Cheers, Chris

Posted: Mon Jul 13, 2009 3:04 pm
by Pocus
that's great!

Arne, I have some texts ready, but you know my issue... if I paste my word formated (or rtf...) into the wiki, it becomes unformated. And I don't feel like reformating (and learning the formating syntax), wiki way...

Posted: Mon Jul 13, 2009 6:53 pm
by Rafiki
If I am not able to see the error of your ways, perhaps my friend here might be able to?

[ATTACH]8435[/ATTACH]

;)

Posted: Wed Jul 15, 2009 5:22 pm
by Pocus
Ah the majesty of Her nose and the shining white of Her teeth :neener: