Author Topic: Hitching Post - Dismount  (Read 435 times)

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Hitching Post - Dismount
« on: February 13, 2011, 05:28:55 pm »


               I trying to get a dismount script that won't vanish the horse.  I would like to use the OnClick of the Hitching Post, dismount and have the horse stay in front of the hitching post to be used later. I've tried Google and the NWN Lexicon, but maybe I can't find a solution because I don't know what I'm looking for.



#include "x3_inc_horse"
void main()
{
   object oPC=GetLastUsedBy();
 }

               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Hitching Post - Dismount
« Reply #1 on: February 14, 2011, 12:59:04 am »


               doh.. I think watching Rocky IV has made me lose a few brain cells. Forgot the important part to the script.




void main()
{
   object oPC=GetLastUsedBy();
   HorseInstantDismount(oPC);
}



I get the same result for both OnUsed and OnClick.. Horse doesn't dismount me, it just vanishes. I am using the NWN horse, not the CEP.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Hitching Post - Dismount
« Reply #2 on: February 14, 2011, 05:09:25 am »


               The function you are using is working as its supposed to. It won't create the horse object after dismount. What you need is something like so:

#include "x3_inc_horse"
void main()
{
    object oCreature = GetLastUsedBy();
    int bAnim=!GetLocalInt(OBJECT_SELF,"bDismountFast");
    if (HorseGetIsMounted(oCreature)&&!HorseGetIsAMount(oCreature))
    { // is mounted
        AssignCommand(oCreature,ClearAllActions(TRUE));
        AssignCommand(oCreature,HORSE_SupportDismountWrapper(bAnim,TRUE));
    } // is mounted
}

Hope that helps.
               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Hitching Post - Dismount
« Reply #3 on: February 14, 2011, 05:48:08 am »


               It's true what they say.. You are a God. Thank you, it works perfectly!