Data Realms Fan Forums
http://45.55.195.193/

Need help for Cordyc (pie menu upgrade system)
http://45.55.195.193/viewtopic.php?f=75&t=26131
Page 1 of 1

Author:  carriontrooper [ Sun Nov 06, 2011 4:44 pm ]
Post subject:  Need help for Cordyc (pie menu upgrade system)

So yeah, I need someone to take a look at my Lua files in Cordyc, and make the 'upgrade' process pie menu-able.
viewtopic.php?f=61&t=19123

I have tried it myself, but it won't work, as in it loads good, but it does nothing.
There's already pie menu graphics in Cordyc.rte/Sprites/piemenu, and there's remnants of my failed try at piemenu in Cordyc.rte/SparkleMagic/Piemenus.lua.

If you can reliably do it, I'll put your name in the credits. Thanks! :D

Author:  Abdul Alhazred [ Mon Nov 07, 2011 5:53 pm ]
Post subject:  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).

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/