Hi peoples,
I have a small question: In Lua I want to check, if an event is "ready" to happen, and then start it from code if so. So e.g. The event "feast" can only happen if the event "hunt" was succesful in the past few turns.
In the file "GameEventsTable.xml" there are several functions, that judging from name should do that, but I cant geht any of them to work (Player:IsEventChoiceActive; Player:IsEventChoiceValid...)
It tried this code:
(with eventchoice and event being determined before this). Lua.log states : "GatherAndHunt.lua:178: attempt to call method 'IsCityEventChoiceActive' (a nil value)"
Any ideas for this? Thanx in advance!
I have a small question: In Lua I want to check, if an event is "ready" to happen, and then start it from code if so. So e.g. The event "feast" can only happen if the event "hunt" was succesful in the past few turns.
In the file "GameEventsTable.xml" there are several functions, that judging from name should do that, but I cant geht any of them to work (Player:IsEventChoiceActive; Player:IsEventChoiceValid...)
It tried this code:
if (player:IsCityEventChoiceActive(eventchoice) == true) then
print ("can be used")
player: DoStartEvent(event);
(with eventchoice and event being determined before this). Lua.log states : "GatherAndHunt.lua:178: attempt to call method 'IsCityEventChoiceActive' (a nil value)"
Any ideas for this? Thanx in advance!
Last edited: