on_event context does not give me
Moderator: Forum Moderators
on_event context does not give me
Hi, my code here:
The error says that "weapon" is a nil value. It also said so if i "data" is a nil value i tried "ctx.data.weapon.damage".
Can somebody help mE?
Code: Select all
local function attack_start_event(ctx)
less_random_tmp_att = ctx.weapon.damage
less_random_tmp_def = ctx.second_weapon.damage
end
on_event("attack", attack_start_event)
Can somebody help mE?
Re: on_event context does not give me
You can look at ctx with
wesnoth.interface.add_chat_message(wesnoth.as_text(ctx))
then you'll probably see that it is not the lua table you expected. You might want to use the wml
module to work with it."If gameplay requires it, they can be made to live on Venus." -- scott
Re: on_event context does not give me
Thank you for the help!!!