Re: Behaviour Tree PropClass
Mat Sutcliffe <[email protected]>
| Newsgroups | gmane.comp.graphics.crystalspace.devel |
|---|---|
| Message-ID | <CACE5BzJsjJnFa4FZdv68VWwRw7mYQ5VK-zma8fg9cmrO_Uvn_g@mail.gmail.com> |
>From what I can understand: Your app should be calling Set/GetProperty. You only need to override Set/GetPropertyIndexed if you want to perform some custom action when the property is modified or inspected (and in that case your app still calls Set/GetProperty). If you don't need that functionality, then you simply need to tell celPcCommon about your properties by calling AddProperty in your propclass constructor, and in both cases celPcCommon takes care of implementing Set/GetProperty for you. You give names (strings) to your properties when you call AddProperty, and to get the csStringID your application code needs to get the global iStringSet from the iObjectRegistry, as usual when working with csStringIDs. It would be nice if celPcCommon had better doxygen comments. Take a look in stdpcimp.cpp at the code for SetPropertyTemplated (which is called by SetProperty) to see the code path that things actually follow when a property is set, and it should begin to make more sense. My best guess :) On 29 June 2012 11:48, Sam Devlin <[email protected]> wrote: > Hello again, > I am having a little trouble finalising this deliverable. Could someone > please explain the difference between celPcCommon's SetPropertyIndexed > methods and iCelPropertyClass's SetProperty methods? > > How would I call either from inside an app? > > It seems that most propclasses override SetPropertyIndexed and not > SetProperty, but if I try to scfQueryInterface<celPcCommon> (tree) where > tree is a csRef<iBTNode> to call SetPropertyIndexed I get compile errors > and am unsure what to pass as the index given that the indexes are part of > a private enumerated type inside celPcBehaviourTree. > > Alternatively, using SetProperty I do not know how to use the csStringID > argument either to implement the method in celPcBehaviourTree or in my > example appbttest. > > Any comments at this stage are greatly appreciated. > Kind Regards, > Sam. > > > On Thu, Jun 28, 2012 at 5:11 PM, Sam Devlin <[email protected]> wrote: > >> Ok so removing the duplicate entry in .csplugin didn't seem to help but >> moving to the propclass folder does seem to have. The latest revision >> (r4915) now contains a working app_bttest with the behaviour tree now as a >> propclass attached to the player entity. >> >> Thank you both for all your input. I still need to do some work clearing >> this up a little, and perhaps adding to the properties settable and actions >> performable. >> >> Kind regards, >> Sam. >> >> >> On Wed, Jun 27, 2012 at 4:33 PM, Christian Van Brussel < >> [email protected]> wrote: >> >>> On Wed, 2012-06-27 at 16:14 +0100, Sam Devlin wrote: >>> > Following on though with the wrapper comment, should I keep >>> > celBehaviourTree as a special BT node (allowing trees to be created >>> > the old way) and write celPcBehaviourTree as just a propclass wrapper >>> > >>> > or >>> > >>> > should I carry on as I intended, with making celPcBehaviourTree and in >>> > doing so limit it's use (I think) to only when tied to an entity? >>> >>> That's true that limiting the use of a BT to an entity might be a good >>> idea, it's also in the spirit of CEL to put everything as a propclass >>> instead of as external tools. >>> >>> Therefore, probably continue as you intended, just ignore my comment >>> about that. >>> >>> You might still try to remove the description of >>> "cel.pcfactory.behaviourtree" from your "behaviourtree.csplugin" though, >>> that may be linked to the problem you face. >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Crystal-develop mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/crystal-develop >>> >> >> > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Crystal-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crystal-develop > > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Crystal-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-develop