Save Editing: How to edit unit defense?
Moderator: Forum Moderators
Save Editing: How to edit unit defense?
Can you tell me how to edit units movement cost or terrain defense.
Editing directly on the [defense] is work but is lost on level up so i need to add permanent code to the units traits.
only problem i don't know how but i know basics. so if you can give me a hand i would be grateful.
Editing directly on the [defense] is work but is lost on level up so i need to add permanent code to the units traits.
only problem i don't know how but i know basics. so if you can give me a hand i would be grateful.
Re: Save Editing: How to edit unit defense?
It is lost on level up because their level ups don't have that defense. So there are two things you can do:
1) You can code level ups to have same defense / movement cost, so that defense won't be lost on level up
2) You can edit defense in units.cfg in core, so all units with that movement type will have the same defense on the same type of terrain.
1) You can code level ups to have same defense / movement cost, so that defense won't be lost on level up
2) You can edit defense in units.cfg in core, so all units with that movement type will have the same defense on the same type of terrain.
Re: Save Editing: How to edit unit defense?
2) no its not what i have asked for.
[trait]
.
.
.
.
[effect]
apply_to="defense"
replace=yes
[defense]
forest=20
[/defense]
[/effect]
[/trait]
should have work but is not working
[trait]
.
.
.
.
[effect]
apply_to="defense"
replace=yes
[defense]
forest=20
[/defense]
[/effect]
[/trait]
should have work but is not working
Re: Save Editing: How to edit unit defense?
You mean if you change both directly, and add trait too? I expect that some tags are only used when rebuilding unit, while current stats are stored in transient fields.
Re: Save Editing: How to edit unit defense?
Changing directly works but the change is lost upon level up
Adding trait( modifying one) is permanent but i cant get it to work.
It should have work but it didnt.
Re: Save Editing: How to edit unit defense?
Is there any reason you want to edit it by save file rather than debug mode?
Re: Save Editing: How to edit unit defense?
How can i make this possible with the debug mode can you give me the command?
For example i want the selected unit to have 70 forest defense.
Thank you again i willalso try this
Edit: I now realised even if you add trait via save editing you still have to manually change units core stats to make change effective.
SO RESULTS:;
1) adding trait:
only visual on units trait description so no actual change
2) editing unit directly:
only actual change, you can't see the change on units trait bar on the right also effect is lost on level up.
3) adding trait and editing unit:
both visual and real value change on unit but i will test stats after level up (i think they will keep it).
tweaking with files is so much fun.
Re: Save Editing: How to edit unit defense?
I confirm 3. is working on level ups also i was right i managed to get it worked about defense.
[effect]
apply_to="defense"
replace=yes
[defense]
forest=20
[/defense]
[/effect]
[/trait]
was correct now i will test for modifying unit movement costs.
[effect]
apply_to="defense"
replace=yes
[defense]
forest=20
[/defense]
[/effect]
[/trait]
was correct now i will test for modifying unit movement costs.
Re: Save Editing: How to edit unit defense?
You don't need traits. You can just give the unit a [modifications] tag. If you need an example, go to HttT S4, pick up the storm trident, and then do :inspect and look at the unit's WML in the inspect window. Here's an example from the test scenario:
Code: Select all
[unit]
x,y=18,12
type="Ghost"
name="Steadfast tester"
[modifications]
[object]
[effect]
apply_to=new_ability
[abilities]
{ABILITY_STEADFAST}
[/abilities]
[/effect]
[/object]
[/modifications]
[/unit]
Re: Save Editing: How to edit unit defense?
wow, do i need to add these lines;josteph wrote: ↑July 18th, 2019, 1:19 pm You don't need traits. You can just give the unit a [modifications] tag. If you need an example, go to HttT S4, pick up the storm trident, and then do :inspect and look at the unit's WML in the inspect window. Here's an example from the test scenario:
Code: Select all
[unit] x,y=18,12 type="Ghost" name="Steadfast tester" [modifications] [object] [effect] apply_to=new_ability [abilities] {ABILITY_STEADFAST} [/abilities] [/effect] [/object] [/modifications] [/unit]
x,y=18,12
type="Ghost"
name="Steadfast tester"
can i just skip to the [modifications] ... [/modifications] part?
also do i need the [/object] part?
my idea:
Code: Select all
[modifications]
[effect]
apply_to="defense"
[defense]
hills=-10
mountains=-10
[/defense]
[/effect]
[effect]
apply_to="movement_costs"
[movement_costs]
hills=-1
mountains=-1
[/movement_costs]
[/effect]
[/modifications]
Re: Save Editing: How to edit unit defense?
Just copy the [modifications]..[/modifications] lines into the unit definition in the savefile. The other three lines are there because that example creates a unit with an object, you're asking how to add an object to an existing unit.
edit: I see your edit. Do add the [object] and [/object] lines, that sort of thing generally matters.
edit: I see your edit. Do add the [object] and [/object] lines, that sort of thing generally matters.
Re: Save Editing: How to edit unit defense?
one last question how can make "-1" number to show in green color?
i want "+10" as green ?
Code: Select all
description= _ "hills & mountains defense +10"+_"
hills & mountains movement cost -1"
Re: Save Editing: How to edit unit defense?
description= _ "hills & mountains defense <span color='green'>+10</span>."
different example which does not include the color in the string for translators:
description= _ "hills & mountains defense" + " " + <span color='#6-digit-hexcode-here_including_hash sign'>+10</span> + "."
Note that your example code will leave no space between the +10 and the next word.
Try out the dark board theme.