About Store Forum Documentation Contact
Donations:
179$/mo



Post Reply 
[Solved] Accessing slots?
Author Message
rstralberg Offline
Member

Post: #1
[Solved] Accessing slots?
Simple question. How do I access a slot from code?
(This post was last modified: 05-16-2015 09:34 PM by rstralberg.)
05-13-2015 11:55 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #2
RE: Accessing slots?
what do you mean by slot ?

if you mean the slot of the char, for example to have something equipped:

in the inventory tuto you can found this

Code:
void update(Player &owner) // handle moving items with mouse and setting equipped item matrixes
   {
      if(inv_gui)inv_gui.update(owner);

      // set matrixes for items in hands
      if(slot[SLOT_ARM_L].valid())
         if(C OrientP *point=owner.skel.findPoint(8"HandL"))
            slot[SLOT_ARM_L]().matrix(Matrix().setPosDir(point.pos, point.perp, point.dir));

      if(slot[SLOT_ARM_R].valid())
         if(C OrientP *point=owner.skel.findPoint(8"HandR"))
            slot[SLOT_ARM_R]().matrix(Matrix().setPosDir(point.pos, point.perp, point.dir));
   }

if(C OrientP *point=owner.skel.findPoint(8"HandL")) this is what i believe you are looking for.
(This post was last modified: 05-14-2015 03:52 AM by RedcrowProd.)
05-14-2015 03:44 AM
Find all posts by this user Quote this message in a reply
rstralberg Offline
Member

Post: #3
RE: Accessing slots?
Yep. That worked. It was this I was out for
owner.skel.findPoint(8"HandL"))
05-14-2015 08:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply