User avatar
Citizen X
AGEod Veteran
Posts: 795
Joined: Tue Feb 02, 2010 1:34 pm

EvalStrucCount

Thu Sep 05, 2019 11:04 am

When I use EvalStrucCount in PON with the FACALL parameter, the game crashes at script execution.

Main log has the line

Code: Select all

09:54:53  [Critical ]  TScriptEngine.Parse                   Exception caught: Access violation at address 00858C03 in module 'PON.exe'. Read of address 0000022C while parsing line 2836 : EvalStrucCount



and the script log ends with

Code: Select all

Line 2833:  SelectFaction, selected: Great Britain
Line 2835:  RegInit 1
Line 2836:  EvalStrucCount Registry 1 used, adding 133 to it, for an end value of 133
------------------------------
Error(s) found: 291
Warning(s) found: 11
--------------END OF SCRIPT----------------


Same code with a faction tag instead of FACALL (parameter shows some sense of humor, btw) works fine

Any ideas?

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

Re: EvalStrucCount

Thu Sep 05, 2019 2:50 pm

https://www.leqg.org/doc/age/www.ageod. ... Count.html

FactionTag does not have $ in it....
https://www.leqg.org/doc/age/www.ageod. ... onTag.html

So I'm guessing something to do with that...

Please post the actual script code you are using...

User avatar
Citizen X
AGEod Veteran
Posts: 795
Joined: Tue Feb 02, 2010 1:34 pm

Re: EvalStrucCount

Thu Sep 05, 2019 7:07 pm

lodilefty wrote:https://www.leqg.org/doc/age/www.ageod.net/agewiki/EvalStrucCount.html

FactionTag does not have $ in it....
So I'm guessing something to do with that...

Please post the actual script code you are using...



I don't use faction tags with $. But I tested with both.
This is an old script by JimNC that I am tossing around with so there might be something I am missing. Without the lines that contain the FACALL the game doesn't crash, although it seems to add up all buildings of that type on the entire map of all factions, not just the faction checked for. Every RegInit gets the same values. This works the same with both variants of faction tags.

I tested with several variants of the entire head, too,

Code: Select all

VARIANT 1 (original):
SelectFaction = $GBR

SelectRegion = $Anglia
StartEvent = evt_nam_NationalGeographic|999|0|NULL|NULL|$Anglia|NULL

Conditions
  RegInit = 1
  EvalStrucCount = MAP;FACALL;STRUCFAM $sfmColMajor;>=;0
  RegInit = 1
  EvalStrucCount = MAP;FACALL;STRUCSUB $stsColo;>=;0


etc etc

VARIANT 2:

SelectFaction = $CMN

SelectRegion = $Anglia
StartEvent = evt_nam_NationalGeographic|999|0|NULL|NULL|$Anglia|NULL

Conditions
  RegInit = 1
  EvalStrucCount = MAP;FACALL;STRUCFAM $sfmColMajor;>=;0
  RegInit = 1
  EvalStrucCount = MAP;FACALL;STRUCSUB $stsColo;>=;0
 
 
  etc etc etc
 
 VARIANT 3:

SelectFaction = $GBR

SelectRegion = $Anglia
StartEvent = evt_nam_NationalGeographic|999|0|NULL|NULL|$Anglia|NULL

Conditions
SelectFaction = $GBR
  RegInit = 1
  EvalStrucCount = MAP;FACALL;STRUCFAM $sfmColMajor;>=;0
  RegInit = 1
  EvalStrucCount = MAP;FACALL;STRUCSUB $stsColo;>=;0

SelectFaction = $GER
  RegInit = 2
  EvalStrucCount = MAP;GER;STRUCFAM $sfmColMajor;>=;0
  RegInit = 2
  EvalStrucCount = MAP;GER;STRUCSUB $stsColo;>=;0

SelectFaction = $FRA
  RegInit = 3
  EvalStrucCount = MAP;FRA;STRUCFAM $sfmColMajor;>=;0
  RegInit = 3
  EvalStrucCount = MAP;FRA;STRUCSUB $stsColo;>=;0

SelectFaction = $AUS
  RegInit = 4
  EvalStrucCount = MAP;AUS;STRUCFAM $sfmColMajor;>=;0
  RegInit = 4
  EvalStrucCount = MAP;AUS;STRUCSUB $stsColo;>=;0

SelectFaction = $USA
  RegInit = 5
  EvalStrucCount = MAP;USA;STRUCFAM $sfmColMajor;>=;0
  RegInit = 5
  EvalStrucCount = MAP;USA;STRUCSUB $stsColo;>=;0

SelectFaction = $RUS
  RegInit = 6
  EvalStrucCount = MAP;RUS;STRUCFAM $sfmColMajor;>=;0
  RegInit = 6
  EvalStrucCount = MAP;RUS;STRUCSUB $stsColo;>=;0

SelectFaction = $ITA
  RegInit = 7
  EvalStrucCount = MAP;ITA;STRUCFAM $sfmColMajor;>=;0
  RegInit = 7
  EvalStrucCount = MAP;ITA;STRUCSUB $stsColo;>=;0

SelectFaction = $JAP
  RegInit = 8
  EvalStrucCount = MAP;JAP;STRUCFAM $sfmColMajor;>=;0
  RegInit = 8
  EvalStrucCount = MAP;JAP;STRUCSUB $stsColo;>=;0

SelectFaction = $SWE
  RegInit = 9
  EvalStrucCount = MAP;SWE;STRUCFAM $sfmColMajor;>=;0
  RegInit = 9
  EvalStrucCount = MAP;SWE;STRUCSUB $stsColo;>=;0

SelectFaction = $POR
  RegInit = 10
  EvalStrucCount = MAP;POR;STRUCFAM $sfmColMajor;>=;0
  RegInit = 10
  EvalStrucCount = MAP;POR;STRUCSUB $stsColo;>=;0

SelectFaction = $SPA
  RegInit = 11
  EvalStrucCount = MAP;SPA;STRUCFAM $sfmColMajor;>=;0
  RegInit = 11
  EvalStrucCount = MAP;SPA;STRUCSUB $stsColo;>=;0

SelectFaction = $BRZ
  RegInit = 12
  EvalStrucCount = MAP;BRZ;STRUCFAM $sfmColMajor;>=;0
  RegInit = 12
  EvalStrucCount = MAP;BRZ;STRUCSUB $stsColo;>=;0

SelectFaction = $CHI
  RegInit = 13
  EvalStrucCount = MAP;CHI;STRUCFAM $sfmColMajor;>=;0
  RegInit = 13
  EvalStrucCount = MAP;CHI;STRUCSUB $stsColo;>=;0

SelectFaction = $BEL
  RegInit = 14
  EvalStrucCount = MAP;BEL;STRUCFAM $sfmColMajor;>=;0
  RegInit = 14
  EvalStrucCount = MAP;BEL;STRUCSUB $stsColo;>=;0

SelectFaction = $HOL
  RegInit = 14
  EvalStrucCount = MAP;HOL;STRUCFAM $sfmColMajor;>=;0
  RegInit = 14
  EvalStrucCount = MAP;HOL;STRUCSUB $stsColo;>=;0

SelectFaction = $DAN
  RegInit = 15
  EvalStrucCount = MAP;DAN;STRUCFAM $sfmColMajor;>=;0
  RegInit = 15
  EvalStrucCount = MAP;DAN;STRUCSUB $stsColo;>=;0

SelectFaction = $PER
  RegInit = 16
  EvalStrucCount = MAP;PER;STRUCFAM $sfmColMajor;>=;0
  RegInit = 16
  EvalStrucCount = MAP;PER;STRUCSUB $stsColo;>=;0

SelectFaction = $MEX
  RegInit = 17
  EvalStrucCount = MAP;MEX;STRUCFAM $sfmColMajor;>=;0
  RegInit = 17
  EvalStrucCount = MAP;MEX;STRUCSUB $stsColo;>=;0

  RegDeactivate = NULL

Actions
EndEvent

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

Re: EvalStrucCount

Fri Sep 06, 2019 1:15 pm

Hmm. I've expended all my feeble brain cells. We need "the Master" to look. [Pocus]

You might try a PM to him to bring this to his attention, as he's busy with FOG:E at this time...

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

Re: EvalStrucCount

Sun Sep 08, 2019 9:39 am

I'm there but I can't say either just by looking at the script what can be wrong.

The only one I know still doing scripts is Bohemond, he is your best bet.

User avatar
Nikel
Posts: 2890
Joined: Sun Apr 20, 2008 8:38 pm

Re: EvalStrucCount

Sun Sep 08, 2019 3:20 pm

Besides Bohemond knowledge as a modder.


Have you ever tried Berto's apps, AGElint and AGEpp?

User avatar
Citizen X
AGEod Veteran
Posts: 795
Joined: Tue Feb 02, 2010 1:34 pm

Re: EvalStrucCount

Sun Sep 08, 2019 4:45 pm

Nikel wrote:Besides Bohemond knowledge as a modder.


Have you ever tried Berto's apps, AGElint and AGEpp?


No, never. Thx for pointing out

User avatar
Nikel
Posts: 2890
Joined: Sun Apr 20, 2008 8:38 pm

Re: EvalStrucCount

Sun Sep 08, 2019 4:49 pm

This is the link in Matrix games.

No idea of how they work.

https://www.matrixgames.com/forums/tm.asp?m=2978333

User avatar
Bohémond
Posts: 2799
Joined: Wed May 14, 2008 8:47 pm

Re: EvalStrucCount

Sun Sep 08, 2019 5:07 pm

Hi guys,

The EvalStrucCount scriptscommand with registry hadling is used in several AGEOD games ( AJE, WSS, WON, ...).

I recall having the same issue that you report with some WON events.

I will be travelling for the next 2 weeks so I will have a look at it upon my return,

Could you try to remove the Reginit command from your script ?

Regards

User avatar
Bohémond
Posts: 2799
Joined: Wed May 14, 2008 8:47 pm

Re: EvalStrucCount

Sun Sep 22, 2019 11:26 pm

I did make a few tests on AJE, WSS and WON.

EvalStrucCount is working as designed in AJE using FACALL or a specific Faction TAG.
For WSS and WON, it is not working unless there is a faction TAG. FACALL, FriendandSelf, etc will make the game crash.

The use, or not, of registry is not the cause of the crash.

So it does not help to fix the issue but at least we know that it should working with previous version of PON.

Regards

User avatar
Citizen X
AGEod Veteran
Posts: 795
Joined: Tue Feb 02, 2010 1:34 pm

Re: EvalStrucCount

Mon Sep 23, 2019 12:20 pm

That is what I feared. Thx for looking into it.
I did a lot of testing with various settings to no avail and I hoped I might have missed something fundamental.

Return to “PON Technical Support / Aide Technique”

Who is online

Users browsing this forum: No registered users and 8 guests