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

ChangeStrucLevel

Mon Nov 10, 2008 4:07 pm

Available starting now in all subsequent patches of the AGE engine games (november 10, 2008 and onward)

Syntax:
ChangeStrucLevel = <SelectionType Value>;<LevelChange>

SelectionType can be one of these 3 literal expressions:

'ByDefUID': you specify the UID of the structure, as per the structure DB.

'ByAttribute': you specify an attribute of the structure, as per the structure DB. Note: as you can create your own attributes, you can really do anything as a condition here.

'ByKind': The structure must have this kind. Kinds are only used for VGN (but they can work in others games, if the data are updated).

You must have a faction and region selected for the command to works.
Image


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

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Mon Nov 10, 2008 5:53 pm

Pocus wrote:Available starting now in all subsequent patches of the AGE engine games (november 10, 2008 and onward)

Syntax:
ChangeStrucLevel = <SelectionType Value>;<LevelChange>

SelectionType can be one of these 3 literal expressions:

'ByDefUID': you specify the UID of the structure, as per the structure DB.

'ByAttribute': you specify an attribute of the structure, as per the structure DB. Note: as you can create your own attributes, you can really do anything as a condition here.

'ByKind': The structure must have this kind. Kinds are only used for VGN (but they can work in others games, if the data are updated).

You must have a faction and region selected for the command to works.



Great!
While waiting for the updated patch I please you to clarify some points.....

1. "Structure DB2: I have no such file in NCP DB!
Where to get an eaxample"

2. To have the command works we have to report the region: where?
In the events first line?
or by a select region/add to Region list command?

3. A working example could be very usefull: for example the way to go from a depot level one to a depot level four.

4. Is the level of the on map structure to be modified to be enlisted ?
If so what with depot level one that can be created during the game?

Thanks in advance
Ney: The army will not move!
Napoleon: The army will obey me!
Ney: The army will obey to its Generals’ orders!

[SIZE="1"]Fontainebleau, April 1814[/size]

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

Mon Nov 10, 2008 6:24 pm

1. There is no structure DB file in games previous to VGN, but this is the same underlaying principle: open a structure file, you will see its UID (this is also the number at the start of the file, so 2 for depots in NCP).

2. Yes event first line is ok, or with a SelectRegion.

3. Once a region is selected, just write that in the command column: ChangeStrucLevel, and then that in the Params0 column: 2 3

Note that 2 is the depot UID, but if you prefer, for clarity purpose, you can create aliases, like $stcDepot = 2 in the aliases directory.

4. Not sure about the question. Enlisted is not the proper word I think. You can edit any structure that you pick.

Edit: I just saw that the depot max level is set to 1, this has to be changed to 4, in the depot file.

Don't hesitate to report problems, as I did not test the command, I admit (shame on me :) ).
Image


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

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

Mon Nov 10, 2008 6:57 pm

Does setting ChangeStrucLevel = 0 remove the structure?

Can cities be altered also?
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: 4438
Joined: Sat Mar 11, 2006 12:18 am
Location: UK

Mon Nov 10, 2008 8:33 pm

lodilefty wrote:Does setting ChangeStrucLevel = 0 remove the structure?

Can cities be altered also?


I'm hoping this is the case!

User avatar
Primasprit
Posts: 1614
Joined: Mon Jun 19, 2006 7:44 pm
Location: Germany

Tue Nov 11, 2008 1:04 am

lodilefty wrote:Does setting ChangeStrucLevel = 0 remove the structure?

No, the parameter <LevelChange> does not set the structure level to the value but changes it by the given value. You can't change the level below 1 or above the allowed maximum.

Can cities be altered also?
Yes.

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

Tue Nov 11, 2008 9:16 am

Removing structures... planned but not done.
Image


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

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Wed Nov 12, 2008 3:54 pm

Testing ChangeStrucLevel over NCP Peninsular War scenario: Bayonne is a FRA level 4 depot at scenario start.

StartEvent; 1
Conditions; NULL
FixedDate; 1808/05/08
Actions NULL
DescEvent; evt_desc_Depotchange1
SelectRegion; $Bayonne
ChangeStrucLevel; 2|-3
EndEvent; NULL

I edited -3 change going after PrimaSprint observation: No, the parameter <LevelChange> does not set the structure level to the value but changes it by the given value. You can't change the level below 1 or above the allowed maximum.


ScriptReport file:

Line 3: SelectFactions, 1 Faction selected: French Empire
Line 5: SelectFactions, 1 Faction selected: French Empire
Line 6: Started processing event: evt_nam_Depotchange1
Line 6: This event is not yet referenced, base number of allowed occurences 1
Line 9: Fixed date evaluated: 1808/05/08 converted to turn 2802 current turn 2802 True
Line 11: Entering triggered actions for event evt_nam_Depotchange1
Line 13: SelectRegion, 198 Bayonne selected (simple mode)
[color="Red"]Line 14: => ChangeStrucLevel command, Level Change is not valid.[/color]
Line 16: Finished processing event: evt_nam_Depotchange1

Anyway it does not work. :(



In the second test I edited ChangeStrucLevel; 2|1 where 1 stands for depot level one: I was till attempting to downgrade a level 4 to level one depot!

StartEvent; 1
Conditions; NULL
FixedDate; 1808/05/08
Actions NULL
DescEvent; evt_desc_Depotchange1
SelectRegion; $Bayonne
ChangeStrucLevel; 2|1
EndEvent; NULL


ScriptReport file:

Line 3: SelectFactions, 1 Faction selected: French Empire
Line 5: SelectFactions, 1 Faction selected: French Empire
Line 6: Started processing event: evt_nam_Depotchange1
Line 6: This event is not yet referenced, base number of allowed occurences 1
Line 9: Fixed date evaluated: 1808/05/08 converted to turn 2802 current turn 2802 True
Line 11: Entering triggered actions for event evt_nam_Depotchange1
Line 13: SelectRegion, 198 Bayonne selected (simple mode)
[color="red"]Line 14: => ChangeStrucLevel command, no selection type selected[/color]
Line 16: Finished processing event: evt_nam_Depotchange1

I was notified with an error too! :( :(


I modded setup file changing starting depot in bayonne to level 1, then I tried increasing it by 2 level, (or modding ot to level 2?:confused :)


StartEvent; 1
Conditions; NULL
FixedDate; 1808/05/08
Actions NULL
DescEvent; evt_desc_Depotchange1
SelectRegion; $Bayonne
ChangeStrucLevel; 2|2
EndEvent; NULL


ScriptReport file:

Line 3: SelectFactions, 1 Faction selected: French Empire
Line 5: SelectFactions, 1 Faction selected: French Empire
Line 6: Started processing event: evt_nam_Depotchange1
Line 6: This event is not yet referenced, base number of allowed occurences 1
Line 9: Fixed date evaluated: 1808/05/08 converted to turn 2802 current turn 2802 True
Line 11: Entering triggered actions for event evt_nam_Depotchange1
Line 13: SelectRegion, 198 Bayonne selected (simple mode)
[color="red"]Line 14: => ChangeStrucLevel command, no selection type selected[/color]
Line 16: Finished processing event: evt_nam_Depotchange1

Had error notification again! :( :( :(

What is wrong in my editing?

Attached EXL file is relative to mine 3rd test........
Attachments

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

Ney: The army will not move!

Napoleon: The army will obey me!

Ney: The army will obey to its Generals’ orders!



[SIZE="1"]Fontainebleau, April 1814[/size]

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

Wed Nov 12, 2008 6:01 pm

My fault, for now the code will reject negative level changes, for the rest the first syntax is correct.
Image


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

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Wed Nov 12, 2008 6:39 pm

Pocus wrote:My fault, for now the code will reject negative level changes, for the rest the first syntax is correct.



If so we have a trouble! :(
3rd example, using positive level changes did not work too! :blink:
Ney: The army will not move!

Napoleon: The army will obey me!

Ney: The army will obey to its Generals’ orders!



[SIZE="1"]Fontainebleau, April 1814[/size]

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Fri Nov 14, 2008 11:29 pm

Pocus wrote:...Once a region is selected, just write that in the command column: ChangeStrucLevel, and then that in the Params0 column: 2 3

Edit: I just saw that the depot max level is set to 1, this has to be changed to 4, in the depot file.

Don't hesitate to report problems, as I did not test the command, I admit (shame on me :) ).


Going after your indication and with last modded NCP.exe I tried the attached event.

I get the following error notification:

Line 725: SelectFactions, 1 Faction selected: French Empire
Line 727: Started processing event: evt_nam_FRA_Depotlevel_change
Line 727: This event is not yet referenced, base number of allowed occurences 1
Line 730: Fixed date evaluated: 1809/04/08 converted to turn 2846 current turn 2846 True
Line 732: Entering triggered actions for event evt_nam_FRA_Depotlevel_change
Line 734: SelectRegion, 502 Nurnberg selected (simple mode)
[color="Red"]Line 735: => ChangeStrucLevel, need to have 2 parameters: ChangeStrucLevel = <SelectionType Value>;<LevelChange>[/color]
Line 737: Finished processing event: evt_nam_FRA_Depotlevel_change

Notice: depot max level has been changed to 4, in the depot file.

I cannot say what was wrong with my syntax!
Attachments

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

Ney: The army will not move!

Napoleon: The army will obey me!

Ney: The army will obey to its Generals’ orders!



[SIZE="1"]Fontainebleau, April 1814[/size]

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

Sat Nov 15, 2008 2:53 pm

Put a pipe between the 2 and the 3
Image


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

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Sat Nov 15, 2008 3:10 pm

Pocus wrote:Put a pipe between the 2 and the 3


[color="royalblue"]ChangeStrucLevel; 2|3[/color]

This one?
No space between 2 and 3: just a pipeline?
Guess I have already tried it!
I'll try again, anyway.....
Ney: The army will not move!

Napoleon: The army will obey me!

Ney: The army will obey to its Generals’ orders!



[SIZE="1"]Fontainebleau, April 1814[/size]

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Sat Nov 15, 2008 8:22 pm

Now it works!

Notice I tested ChangeStrucLevel over a NCP.exe version edited in date: 12/11/08.

1.
2Depot.STR file was modded to set "MaxLevel = 4"

2.
[color="RoyalBlue"]SelectRegion; $Nurnberg
ChangeStrucLevel; ByDefUID 2|3[/color]

In the Example, existing level 1 depot one in Nurnberg is changed to level 4 Depot!

3.
[color="royalblue"]SelectRegion; $Strasbourg
ChangeStrucLevel; ByDefUID 2|-2[/color]

In the Example, existing level 4 depot in Strasbourg is changed to level 2 Depot!

Notice:
I used ( ;) to remark separate, adjacent cells from same EXL command line.
ChangeStrucLevel is edited in Column C.
ByDefUID 2|-2 is edited in Column D.
Faction controlling the depot was edited in column A of line hosting ChangeStrucLevel command.
Reporting in Column I the region, as $Region-name, rather than NULL was uninfluent in my tests.

I did not tried ChangeStrucLevel without editing Faction controlling the depot in the same line: it could be interesting to try ti........... With that we could change structure level misregarding faction controlling it! Indeed when changes occur at any turn during a scenario we cannot predict side/faction actually controll a region and relative structures!

Big thank to Pocus for all supported granted!
Ney: The army will not move!

Napoleon: The army will obey me!

Ney: The army will obey to its Generals’ orders!



[SIZE="1"]Fontainebleau, April 1814[/size]

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

Mon Nov 17, 2008 11:36 am

This is a sound remark, about the faction controlling the structure. I modified the code so that whatever the owner, all structures having the right criteria (at most 1 usually!) will have the level changed.
Image


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

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

ChangeStrucLevel: perspectives

Mon Nov 17, 2008 12:57 pm

At moment I'll make use of ChangeStrucLevel with 1813 GC scenario: it'll be restricted use, aimed to modify few depots level along the campaign.

With time we should improve ChangeStrucLevel use within AGEod games...
For example we could create a routine for random improvement of depots, may be in relation to faction accumulated supplies.
On the contrary, a routine could reduce by one the level of major depots any time depot control changes hands in a scenario.....

We have great opportunities at hand indeed! :neener:
Ney: The army will not move!

Napoleon: The army will obey me!

Ney: The army will obey to its Generals’ orders!



[SIZE="1"]Fontainebleau, April 1814[/size]

Return to “Modding AGE engine games”

Who is online

Users browsing this forum: No registered users and 8 guests