Re: Need help for Cordyc (pie menu upgrade system)
A self variable declared in the update function is not accessible from the pie-menu script.
Another, unrelated problem is that you have copied the entire contents if the HumanAI file to you actors. This will overwrite the global table called HumanAI, redefine all behaviors and all AHumans in the game will potentially use your behaviors instead. I realize that this was bound to happen because of how I coded it and will try to fix it in future versions.
You only need to copy the Create and UpdateAI functions, and if you want to create a behavior unique to your actor just store it in a table of your own like this:
Code:
MyAiStuff = {}
function MyAiStuff.GoToWpt(self)
...
end
and then you find the function
CreateGoToBehavior in Create() and replace
self.NextGoTo = coroutine.create(HumanAI.GoToWpt) with
self.NextGoTo = coroutine.create(MyAiStuff.GoToWpt).