Aller au contenu

Photo

Contribution: Permanent Horse - Bug Fixes


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

I created a script to solve the Permanent Horse Bug (you are on a horse and you can't get off), below we have two evidences for who unknow:

 

1: Youtube Video

2: http://social.biowar...-4639905-1.html

 

You must add a command to execute the script in "on_respawn" and "on_client_enter" module events.

    //object oPC = GetEnteringObject();
    //object oPC = GetLastRespawnButtonPresser();

    //Permanent Horse - Bug Fixes
    ExecuteScript("permanent_horse", oPC);

Also you need to create a script called permanent_horse and add this code:

 
#include "x3_inc_horse"

void main()
{
    object oPC = OBJECT_SELF;

    if(HorseGetIsMounted(oPC) == TRUE && GetPhenoType(oPC) != PHENOTYPE_NORMAL)
    {
    HorseInstantDismount(oPC);
    return;
    }
    if(HorseGetIsMounted(oPC) == FALSE && GetPhenoType(oPC) != PHENOTYPE_NORMAL)
    {
    //Shadooow debug code
    object oSkin=GetLocalObject(oPC,"oX3_Skin");
    int nPosition;
    if(!GetIsObjectValid(oSkin))
    {
    oSkin=GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
    nPosition = 2;
    }
    else
    {
    nPosition = 1;
    }
    if(!GetIsObjectValid(oSkin))
    {
    oSkin=GetItemPossessedBy(oPC,"x3_it_pchide");
    nPosition = 3;
    }
    WriteTimestampedLogEntry("PERMANENT HORSE BUG - oPC: "+GetName(oPC)+", has skin?: "+IntToString(GetIsObjectValid(oSkin))+", nPosition: "+IntToString(nPosition));
    ////////end debug code

    HorseInstantDismount(oPC);
    SetPhenoType(PHENOTYPE_NORMAL, oPC);
    SetCreatureTailType(CREATURE_TAIL_TYPE_NONE, oPC);
    }
}
To give a sense of reality, we are dismounting always when PC respawn/enter in module, so you can disable first condition.
 
WARNING: HorseInstantDismount does not protect Saddlebags so, it is recommended this only be used in conjunction with HorseInstantMount.   If you need to protect saddlebag contents use HorseDismount().

Modifié par WhiteTiger, 07 mai 2014 - 02:44 .


#2
Shadooow

Shadooow
  • Members
  • 4 471 messages

I dont understand, my fix doesn't work?

 

I though this is a "losing skin under ILR/ELC" issue. Which I prevented from in my community patch and in my testing the PC was considered mounted after relog.

 

Since you use my patch I wonder why its not working for you. Can you post your OnPlayerUnEquip code?


  • WhiteTiger aime ceci

#3
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

Yes, I do. This is for who still have trouble with the permanent horse bug and are searching for


Modifié par WhiteTiger, 04 mai 2014 - 06:08 .


#4
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

No problems with your fixes, but I considerate the possibility to make a new fix to a second choice. 



#5
Shadooow

Shadooow
  • Members
  • 4 471 messages

No problems with your fixes, but I considerate the possibility to make a new fix to a second choice. 

Of course. And your script does this job well. But I would like to know why my fix doesn't always works.

 

Could you add this code into your script?

if(HorseGetIsMounted(oPC) == FALSE && GetPhenoType(oPC) != PHENOTYPE_NORMAL)
    {
/////shadooow debug code
object oSkin=GetLocalObject(oPC,"oX3_Skin");
int nPosition;
 if(!GetIsObjectValid(oSkin))
 {
 oSkin=GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
 nPosition = 2;
 }
 else
 {
 nPosition = 1;
 }
 if(!GetIsObjectValid(oSkin))
 {
 oSkin=GetItemPossessedBy(oPC,"x3_it_pchide");
 nPosition = 3;
 }
WriteTimestampedLogEntry("PERMANENT HORSE BUG - oPC: "+GetName(oPC)+", has skin?: "+IntToString(GetIsObjectValid(oSkin))+", nPosition: "+IntToString(nPosition)); 
////////end debug code   
    //FloatingTextStringOnCreature("Permanent Horse - Bug Fixes", oPC);
    HorseInstantDismount(oPC);
    SetPhenoType(PHENOTYPE_NORMAL, oPC);
    SetCreatureTailType(CREATURE_TAIL_TYPE_NONE, oPC);
    }

Then check the logs occassionally and if you find a line with "PERMANENT HORSE BUG" please send it to me. Might help to reveal whats going on.


  • WhiteTiger aime ceci