[closed] How to modify unit using lua

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
User avatar
ZombieKnight
Posts: 157
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

[closed] How to modify unit using lua

Post by ZombieKnight »

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?
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...
white_haired_uncle
Posts: 1204
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: How to modify unit using lua

Post by white_haired_uncle »

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.
Speak softly, and carry Doombringer.
User avatar
ZombieKnight
Posts: 157
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to modify unit using lua

Post by ZombieKnight »

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...
User avatar
ZombieKnight
Posts: 157
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to modify unit using lua

Post by ZombieKnight »

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...
Post Reply