[closed] Where is current attack weapon stored/how it's marked?
Moderator: Forum Moderators
Re: Where is current attack weapon stored/how it's marked?
my_unit_stored_from_map name suggests it wont work, Lua unit API is designed around proxy units, not stored units.
If my_unit_stored_from_map is WML table (__cfg), then you need to adjust it with wml.x methods and unstore in the end.
If my_unit_stored_from_map is proxy unit, you can use Lua API, my_unit_stored_from_map:transform("Ghoul").
If my_unit_stored_from_map is WML table (__cfg), then you need to adjust it with wml.x methods and unstore in the end.
If my_unit_stored_from_map is proxy unit, you can use Lua API, my_unit_stored_from_map:transform("Ghoul").
- ZombieKnight
- Posts: 174
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Where is current attack weapon stored/how it's marked?
Sorry, what does proxy unit mean?
What are wml.x methods?
What are wml.x methods?
I had saurian in profile before, but I've merged my discord profile with forum one...
Re: Where is current attack weapon stored/how it's marked?
Proxy unit means variable of type userdata, which you create by using few LuaAPI functions such as wesnoth.units.get. Any change done to proxy is also done to unit map.
By wml.x I mean https://wiki.wesnoth.org/LuaAPI/wml. For example as table.insert(cfg.attack, wml.tag.attack{})
By wml.x I mean https://wiki.wesnoth.org/LuaAPI/wml. For example as table.insert(cfg.attack, wml.tag.attack{})
- ZombieKnight
- Posts: 174
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Where is current attack weapon stored/how it's marked?
So I can change maps on map directly using lua with wesnoth.units.get and then modifiing some values in it?
I had saurian in profile before, but I've merged my discord profile with forum one...