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

EvalEvent question

Wed Jul 08, 2009 8:14 pm

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

User avatar
PhilThib
Posts: 13705
Joined: Tue Oct 18, 2005 5:21 pm
Location: Meylan (France)

Thu Jul 09, 2009 6:49 am

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 ;)
Image

User avatar
Gray_Lensman
Posts: 497
Joined: Mon Jun 18, 2007 4:04 am
Location: Who is John Galt?

Thu Jul 09, 2009 7:18 am

deleted

User avatar
Gray_Lensman
Posts: 497
Joined: Mon Jun 18, 2007 4:04 am
Location: Who is John Galt?

Thu Jul 09, 2009 7:38 am

deleted

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

Thu Jul 09, 2009 12:00 pm

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

User avatar
Gray_Lensman
Posts: 497
Joined: Mon Jun 18, 2007 4:04 am
Location: Who is John Galt?

Thu Jul 09, 2009 7:20 pm

deleted

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

Thu Jul 09, 2009 8:14 pm

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
Attachments

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


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

Fri Jul 10, 2009 11:09 am

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

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

Fri Jul 10, 2009 3:54 pm

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

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

Fri Jul 10, 2009 4:49 pm

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)
Image


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

User avatar
Gray_Lensman
Posts: 497
Joined: Mon Jun 18, 2007 4:04 am
Location: Who is John Galt?

Fri Jul 10, 2009 5:49 pm

deleted

User avatar
Generalisimo
Posts: 4176
Joined: Wed Jun 07, 2006 10:03 pm
Location: Buenos Aires, Argentina
Contact: ICQ WLM

Fri Jul 10, 2009 6:03 pm

Gray_Lensman wrote:I personally do not possess the Vulcan mind meld capability. :D

It's your fault then... Image
"History is the version of past events that people have decided to agree upon."
Napoleon Bonaparte


BOA-AAR: ¡Abajo el imperialismo Británico! (en español)

AGEOD Facebook Fanpage - news & screenshots about the upcoming games!

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

Fri Jul 10, 2009 6:27 pm

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

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

Fri Jul 10, 2009 10:25 pm

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

User avatar
Rafiki
Posts: 5811
Joined: Thu Aug 24, 2006 9:19 am
Location: Oslo, Norway

Sat Jul 11, 2009 9:35 am

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* :(
[CENTER]Latest patches: AACW :: NCP :: WIA :: ROP :: RUS :: PON :: AJE
Visit AGEWiki - your increasingly comprehensive source for information about AGE games
[SIGPIC][/SIGPIC]
[/CENTER]

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

Sat Jul 11, 2009 10:21 am

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

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

Mon Jul 13, 2009 3:04 pm

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...
Image


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

User avatar
Rafiki
Posts: 5811
Joined: Thu Aug 24, 2006 9:19 am
Location: Oslo, Norway

Mon Jul 13, 2009 6:53 pm

If I am not able to see the error of your ways, perhaps my friend here might be able to?

[ATTACH]8435[/ATTACH]

;)
Attachments
Mrs_Pocus.jpg
[CENTER]Latest patches: AACW :: NCP :: WIA :: ROP :: RUS :: PON :: AJE

Visit AGEWiki - your increasingly comprehensive source for information about AGE games

[SIGPIC][/SIGPIC]

[/CENTER]

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

Wed Jul 15, 2009 5:22 pm

Ah the majesty of Her nose and the shining white of Her teeth :neener:
Image


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

Return to “Modding AGE engine games”

Who is online

Users browsing this forum: No registered users and 20 guests