[closed] How to modify unit using lua
Moderator: Forum Moderators
- ZombieKnight
- Posts: 250
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
[closed] How to modify unit using lua
I'd like to change some variables stored in units (namely attack.specials.dummy.name)
How to read and rewrite these variables stored in units stored in lua?
How to read and rewrite these variables stored in units stored in lua?
Last edited by ZombieKnight on March 31st, 2024, 12:31 pm, edited 1 time in total.
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
-
- Posts: 1288
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: How to modify unit using lua
Check this out
https://wiki.wesnoth.org/LuaAPI/wml#wml.variables
Note the example executes store_unit from lua, while in your question I think you have already done that in wml.
https://wiki.wesnoth.org/LuaAPI/wml#wml.variables
Note the example executes store_unit from lua, while in your question I think you have already done that in wml.
Speak softly, and carry Doombringer.
- ZombieKnight
- Posts: 250
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: How to modify unit using lua
Oh didn't got that I can store a unit into a variable and then unstore it... thanks!
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- ZombieKnight
- Posts: 250
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: How to modify unit using lua
Jup turned out you can change some things directly... but spacials id can't be changed directly.
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills