Modification can affect resistances & movement consts
Moderator: Forum Moderators
Modification can affect resistances & movement consts
See "Wose Traits": http://www.wesnoth.org/forum/viewtopic.php?t=11010
These threads are linked by nature.
Analysis for patch:
in unit.cpp:add_modification, merge the [movement_costs] and [defense] subelements into cfg_
I hope to have a working patch soon, but just in case I don't, this will allow the next person to get a warm start.
My complements on your design.
These threads are linked by nature.
Analysis for patch:
in unit.cpp:add_modification, merge the [movement_costs] and [defense] subelements into cfg_
I hope to have a working patch soon, but just in case I don't, this will allow the next person to get a warm start.
My complements on your design.
First patch. Allows for set new evasions, resistances, and movesment_costs.
Included a test campaign. Note the pre-existing wose has three weird traits.
Costs 2 mp to move in forest
80% blade resistance
60% evasion in forest
Enjoy :)
Included a test campaign. Note the pre-existing wose has three weird traits.
Costs 2 mp to move in forest
80% blade resistance
60% evasion in forest
Enjoy :)
- Attachments
-
- wesnothpatch1.txt
- [movetype] trait, version 1
- (602 Bytes) Downloaded 371 times
-
- test.zip
- Test campaign
- (1.79 KiB) Downloaded 338 times
Changed the patch to use deltas instead of new constants.
Couldn't do both. For some reason, the parser converts "+1" to "1".
Removal of modifications works.
Couldn't do both. For some reason, the parser converts "+1" to "1".
Removal of modifications works.
- Attachments
-
- wesnothpatch2.txt
- Patch (version 2)
- (3.51 KiB) Downloaded 384 times
-
- test.zip
- New test scenario.
- (1.72 KiB) Downloaded 340 times
-
- Retired Developer
- Posts: 2633
- Joined: March 22nd, 2004, 11:22 pm
- Location: An Earl's Roadstead
You could use two different tags, one for setting and one for modding.
"you can already do that with WML"
Fight Creeeping Biggerism!
http://www.wesnoth.org/forum/viewtopic. ... 760#131760
http://www.wesnoth.org/forum/viewtopic. ... 1358#11358
Excellent solution. And hey, that fixed the removal code (at least I think it did).
Syntax invented (I hope this posts right):
[trait]
id=hardy
name= _ "Hardy"
description = "Blade Resistant"
[effect]
apply_to=resistance
[resistance]
blade=-40
[/resistance]
[/effect]
[/trait]
[trait]
id=treeish
name = _ "Tree-ish"
description = "Hard to hit in forest"
[effect]
apply_to=defense
replace=yes
[defense]
forest=50
[/defense]
[/effect]
[/trait]
Particularly, notice "replace=yes" near the bottom. It defaults to no. If
set, the old value is discarded. If cleared, the value is added. Be
careful, to add resistances or defense, you must subtract (the
same is true everywhere else these values are visible in WML).
Patch, Take 3.
Syntax invented (I hope this posts right):
[trait]
id=hardy
name= _ "Hardy"
description = "Blade Resistant"
[effect]
apply_to=resistance
[resistance]
blade=-40
[/resistance]
[/effect]
[/trait]
[trait]
id=treeish
name = _ "Tree-ish"
description = "Hard to hit in forest"
[effect]
apply_to=defense
replace=yes
[defense]
forest=50
[/defense]
[/effect]
[/trait]
Particularly, notice "replace=yes" near the bottom. It defaults to no. If
set, the old value is discarded. If cleared, the value is added. Be
careful, to add resistances or defense, you must subtract (the
same is true everywhere else these values are visible in WML).
Patch, Take 3.
- Attachments
-
- test.zip
- Test for patch version 3
- (1.73 KiB) Downloaded 320 times
-
- wesnothpatch3.txt
- Patch version 3
- (3.78 KiB) Downloaded 375 times
Patch is now on patches.wesnoth.org. https://gna.org/patch/index.php?func=de ... tem_id=541