Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / AddCommand extension
- - By Carli [de] Date 2009-07-27 14:17
AddCommand is a weird Callback. When you have to set the ExtraData, you have to fill all other parameters with 0 and have to count how many 0's (I think there were 8 of them) and the datatypes are not clear (A Script Call needs casted types)
An other manko is that you cannot define your own AI-Commands (AttackBow, Guard) (you have to write helper callbacks)
My Suggestion is that the Parameters are stored into an array and you can define your own Commands:

AddCommand (object Clonk, string Command, array Params, int Timeout)

with the new Callbacks
function CommandAttackBow(object Clonk, array Params, bool& Done)
This function is called every 10 Frames till Done is true or 'Timeout' frames are over.
Parent - - By Günther [de] Date 2009-07-27 17:59
No, AddCommand is not a callback, it's a global function. And this is something you can already do as a script function. Simply reissue a call command every time it's executed before calling the callback.
Reply
Parent - By Carli [de] Date 2009-07-27 19:32
Yes, but an Overloading is not such a good way, an Engine function would be better.
Up Topic Development / Developer's Corner / AddCommand extension

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill