Page 1 of 1

ChangeStrucType

Posted: Fri Oct 31, 2008 2:33 pm
by Hobbes
Hi chaps, can anyone speed me on my way by answering this?

If I have $Lackawanna as the location id of the StartEvent
I assume I wouldn’t need to include it in a ChangeStrucType command?

ChangeStrucType $Village|$Fort|null| REG $Lackawanna

I would need to keep REG but not $Lackawanna?

What is the null for in the above ChangeStrucType command?

If I want to remove a Structure_Stockade from the game would I be able to do this using ChangeStrucType?

Many thanks,
Chris

Posted: Fri Oct 31, 2008 2:40 pm
by lodilefty
Both use same syntax...
Structure force pool is only available for VGN+, the rest can be used elsewhere.

The purpose is to allow changes from technologies or doctrines mostly. Taking the VGN example, if you have Early Industrial Factories and pay for the conversion, then you have to change both on map and in the force pool the 'Early factory Structure Type' to the 'Late Industrial' type.

The same thing apply on units. If you have units which represents 1850 Infantry Corps, you want them to change in due time to 1870 Infantry Corps. This is necessary so that when they get replacements, they get the right model.

The syntax is:

ChangeUnitType = <OldUnitDef>;<NewUnitDef>[;FP][;REGorAREA_AreaUID]

all params can go in the first column in excel, separated by a pipe |
[] means optional
If REG is specified, then the script expect that a region was selected before (with SelectRegion)
if AREA is specified, then follows an area UID
if nothing is specified, then it applies on the whole MAP.


examples:
ChangeUnitType = $Inf1850|$Inf1870
it will changes on the whole map all units (not the actual elements in it!) to this type.
ChangeUnitType = $Warriors|$Warbands|FP|Area $aeaWest
It will change all Warriors in the West area into Warbands, including in the force pool.
ChangeStrucType = $Redoubt $BrickFort
Will change all redoubts on map with BrickForts.


[color="Red"]ChangeStrucType = <OldStructDef>;<NewStructDef>[;FP][;REGorAREA_AreaUID][/color]
You must repeat the REG portion, I think.
NULL is placeholder for the [VGN only] FP variable. Probably not needed.

Dunno if you can remove structure with it! Try it with NULL as second parameter :blink: [ducks and runs for cover]

Posted: Sat Nov 01, 2008 10:23 am
by Pocus
No I don't think we have a command to remove a structure, would be handy though...

Posted: Sun Mar 29, 2009 12:30 pm
by lodilefty
It would still be nice to have a way to remove a structure... :D

...and, a way to rename a structure by event ;) :love:

Posted: Mon Mar 30, 2009 5:32 pm
by Pocus
Remind me of that in a fortnight then, I'm too busy and late right now. ;)

Posted: Thu Jun 04, 2009 11:01 am
by paw1776
Hello,

I am looking to do the same thing. I want to change a settlement into a City.

If I want my City to be level 3, I assume I would have to remove structure
1st.

Whereas, if I went from a level 1 Setlement to Level 1 City, I can use ChangeStrucType.

Which would work, if there is the ability to increase a City from level 1 to level 2 or 3 or 4.

1st Event:
Create Settlement (once discovered) CreateStruc
Upgrade Settlement to City (once settled) ChangeStrucType
Upgrade City to Level 3. ???? Remove then CreateStruc? Or is there another way?


PS - For POCUS - Did you do a remove command as suggested here (and rename)? :w00t:

ChangeStrucType - Remove Structure

Posted: Fri Jun 05, 2009 9:49 am
by paw1776

Posted: Fri Jun 05, 2009 11:10 am
by Rafiki
[color="Blue"]The best place to bump a thread is in the thread itself. Merged :) [/color]

Also, I know that Pocus is quite busy these days, so I'm afraid it can be good to allow for more than a day to get a reply.

Posted: Fri Jun 05, 2009 11:56 am
by lodilefty
Once the 1.05 version is ready we will have ability to remove a structure.
Thus removing and 'rebuilding' will allow rename and upgrades:

EvalRgnOwned = $Tajacook
MinDate = 1755/09/01
EvalRgnStruc = $Tajacook;FACALL;STRUCDEF $Village
EvalRgnStruc = $Tajacook;FACALL;STRUCDEF $Fort;NOT
CountUnits = $Tajacook;-1;$GBR;-1;>=;4

Actions
[color="Red"]RemoveStructure = ByDefUID $Village;ALL;ANYFAC[/color]
SelectFaction = $GBR

CreateStruc
SetType = $Fort
SetLevel = 1
SetName = Fort Edward
Apply


Hilighted is new command for 1.05

RemoveStructure = <SelectionType(=ByDefUID or ByAttrib or ByKind) Value>;<ALL_OR_RANDOM_KEYWORD>;<ANYFAC_OR_SINGLEFAC_KEYWORD>

Posted: Sat Jun 06, 2009 12:14 am
by paw1776
Lodi,

Excellent!!!! :thumbsup:

Thx again!

Too Cool!

Posted: Thu Jul 09, 2009 9:47 am
by Hobbes
Can anyone confirm if I understand the RemoveStructure syntax correctly :-

Command: RemoveStructure
Param0: $Village|ALL|IND
Param4: $Region

What does the ALL do?

I really need to change the control of a structure but I don’t think there is a way to do this?
Only the region control can be changed I think with SetControl – so instead I can delete the structure.

Thanks, Chris

Posted: Thu Jul 09, 2009 7:38 pm
by Hobbes
I gave it a try but got an error. Has anyone done this successfully?
As far as I understand I have 3 parameters $Village, ALL and IND

Line 3070: => RemoveStructure, need to have 3 parameters: RemoveStructure = <SelectionType(=ByDefUID or ByAttrib or ByKind) Value>;<ALL_OR_RANDOM_KEYWORD>;<ANYFAC_OR_SINGLEFAC_KEYWORD>

Cheers, Chris

Posted: Thu Jul 09, 2009 11:19 pm
by lodilefty
Hobbes wrote:I gave it a try but got an error. Has anyone done this successfully?
As far as I understand I have 3 parameters $Village, ALL and IND

Line 3070: => RemoveStructure, need to have 3 parameters: RemoveStructure = <SelectionType(=ByDefUID or ByAttrib or ByKind) Value>;<ALL_OR_RANDOM_KEYWORD>;<ANYFAC_OR_SINGLEFAC_KEYWORD>

Cheers, Chris


Command: RemoveStructure
Param0: [color="Red"]ByDefUID[/color] $Village|ALL|[color="red"]$[/color]IND
Param4: $Region

Posted: Fri Jul 10, 2009 8:11 am
by Hobbes
Hi Lodi, I tried :-

Param0: ByDefUID $Village|ALL|$IND
Param0: ByKind $Village|ALL|$IND
Param0: $Village|ALL|$IND

But all of these variations still give the same error I had above.

Cheers, Chris

Posted: Fri Jul 10, 2009 4:22 pm
by Pocus
I believe it is my fault... the command has an erroneous check in the current version.

Posted: Fri Jul 10, 2009 6:30 pm
by Hobbes
:coeurs:

Posted: Mon Jul 13, 2009 3:01 pm
by Pocus
Do you want a new executable for your tests?

Posted: Mon Jul 13, 2009 3:25 pm
by lodilefty
Pocus wrote:Do you want a new executable for your tests?


How about part of new beta patch? :D

Posted: Sat Aug 01, 2009 8:55 am
by Hobbes
I missed the last two replies. Lodi - is this fix in the new 1.05 RC6 beta?

Cheers, Chris