"upkeep=free" problem
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Re: "upkeep=free" problem
Changing base_income should be the easy way to modify income of all sides during game without having to check which sides exist.
Re: "upkeep=free" problem
You could do a lua loop that iterates over all sides and sets the income for each of them: see https://wiki.wesnoth.org/LuaWML/Sides#wesnoth.sides
Lua also has access to
Lua also has access to
wesnoth.game_config.base_income
as a read-only.Re: "upkeep=free" problem
Based on wiki it is read-write.
Re: "upkeep=free" problem
I stand corrected.
Re: "upkeep=free" problem
Be aware though that is is iirc not persistent In saves so.it has.to be set in preload events or other code that runs whenever saves are loaded.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
- Celtic_Minstrel
- Developer
- Posts: 2214
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: "upkeep=free" problem
Ravana: That Lua API actually writes straight to the global game config. (Makes me wonder if the config is properly reset every time you start a new scenario? Though it probably is...)
I just checked and it seems I was getting income confused with the village settings (gold/support) - the MP create screen doesn't appear to offer setting the base income as I thought, so for setting income it probably just uses
I do think the ability to override some of these keys on a per-scenario basis would be nice. You could actually implement it in Lua, I believe – use the onload hook to read the keys from the scenario and change them with the API Ravana pointed out. I opened issue #4440 for this.
I just checked and it seems I was getting income confused with the village settings (gold/support) - the MP create screen doesn't appear to offer setting the base income as I thought, so for setting income it probably just uses
[side]income=
.I do think the ability to override some of these keys on a per-scenario basis would be nice. You could actually implement it in Lua, I believe – use the onload hook to read the keys from the scenario and change them with the API Ravana pointed out. I opened issue #4440 for this.
Re: "upkeep=free" problem
I will have to check if changing poison value in orocia can break saves.
- lhybrideur
- Posts: 369
- Joined: July 9th, 2019, 1:46 pm
Re: "upkeep=free" problem
Don't know if that help, but [modify_unit] portrait= seems not to be conserved in saves. When I reload them, the portrait is gone. Might be the same for your poison modification, depending on how you implemented it.
- Celtic_Minstrel
- Developer
- Posts: 2214
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: "upkeep=free" problem
Usinglhybrideur wrote: ↑October 9th, 2019, 3:57 pm Don't know if that help, but [modify_unit] portrait= seems not to be conserved in saves. When I reload them, the portrait is gone. Might be the same for your poison modification, depending on how you implemented it.
[modify_unit]
like that for permanent effects isn't recommended because it doesn't mix well with the use of objects. What you should do instead is use [modify_unit][object]
with an [effect]apply_to=profile
- that'll have no issues in save files. In general you should try to use this approach for any permanent change.- lhybrideur
- Posts: 369
- Joined: July 9th, 2019, 1:46 pm
Re: "upkeep=free" problem
Thanks, I will try that when I have the time.
However I don't think in would work in Ravana's case as it's not a one-unit problem.
However I don't think in would work in Ravana's case as it's not a one-unit problem.