Page 1 of 1

ChangeStrucLevel

Posted: Mon Nov 10, 2008 4:07 pm
by Pocus
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.

Posted: Mon Nov 10, 2008 5:53 pm
by jastaV
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

Posted: Mon Nov 10, 2008 6:24 pm
by Pocus
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 :) ).

Posted: Mon Nov 10, 2008 6:57 pm
by lodilefty
Does setting ChangeStrucLevel = 0 remove the structure?

Can cities be altered also?

Posted: Mon Nov 10, 2008 8:33 pm
by Hobbes
lodilefty wrote:Does setting ChangeStrucLevel = 0 remove the structure?

Can cities be altered also?


I'm hoping this is the case!

Posted: Tue Nov 11, 2008 1:04 am
by Primasprit
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.

Posted: Tue Nov 11, 2008 9:16 am
by Pocus
Removing structures... planned but not done.

Posted: Wed Nov 12, 2008 3:54 pm
by jastaV
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........

Posted: Wed Nov 12, 2008 6:01 pm
by Pocus
My fault, for now the code will reject negative level changes, for the rest the first syntax is correct.

Posted: Wed Nov 12, 2008 6:39 pm
by jastaV
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:

Posted: Fri Nov 14, 2008 11:29 pm
by jastaV
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!

Posted: Sat Nov 15, 2008 2:53 pm
by Pocus
Put a pipe between the 2 and the 3

Posted: Sat Nov 15, 2008 3:10 pm
by jastaV
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.....

Posted: Sat Nov 15, 2008 8:22 pm
by jastaV
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!

Posted: Mon Nov 17, 2008 11:36 am
by Pocus
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.

ChangeStrucLevel: perspectives

Posted: Mon Nov 17, 2008 12:57 pm
by jastaV
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: