Author Topic: PC Properties  (Read 676 times)

Legacy_mornnova

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
PC Properties
« on: March 26, 2016, 04:58:22 pm »


               

When a player dies then logs out after the gui panel pops up then respawns after relog a 'pc properties' skin gets placed in their inventory.


 


I have mounts in my module and so i'm wondering if this will affect the way mounts function...



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
PC Properties
« Reply #1 on: March 27, 2016, 05:17:23 pm »


               The skin is used to give the PC horse riding feats. It needs to be equipped, not removed.


http://www.nwnlexico...Guide_To_Horses
               
               

               
            

Legacy_mornnova

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
PC Properties
« Reply #2 on: March 27, 2016, 05:49:35 pm »


               

ok, i know it can be equipped if quick slotted, but what would be the best way to equip it via scripting?



               
               

               
            

Legacy_KMdS!

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +0/-0
PC Properties
« Reply #3 on: March 27, 2016, 07:11:07 pm »


               

The hard coded game can equip it to the CARMOUR slot but you cannot equip a skin to the proper slot w/o scripting it.


 


Here is a script that covers what you would need. Several checks you may or may not want/need, but best for you to decide. Modify it as required for your specific need. Documentation is located within the script code.



void EquipCArmorSlot(object oPC)
{
    // The resref of the skin you want equiped
    string sSkinResRef = "whatever resref you want";
    // Retrieve any existing item is slot CARMOUR
    object oSkin = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPC);
 
    // Check if anything is equipped in the creature armor slot
    int bSlotEquipped = oSkin!=OBJECT_INVALID;
    // if not, equip them
    if(!bSlotEquipped)
    {
        oSkin = CreateItemOnObject(sSkinResRef, oPC);
        AssignCommand(oPC, ActionEquipItem(oSkin,INVENTORY_SLOT_CARMOUR));
    }
    // Check to see if they have the skin I want them to have, if not....
    else if(GetResRef(oSkin) != sSkinResRef)
    {
        //Prepare to destroy the existing skin
        SetPlotFlag(oSkin, FALSE);
        AssignCommand(oSkin, SetIsDestroyable(TRUE, FALSE));
        //Destroy the skin 0.0 seconds after we complete this algorythm
        DestroyObject(oSkin);
        // create and equip the new skin
        oSkin = CreateItemOnObject(sSkinResRef, oPC);
        AssignCommand(oPC, ActionEquipItem(oSkin,INVENTORY_SLOT_CARMOUR));
    }
 
}


               
               

               
            

Legacy_mornnova

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
PC Properties
« Reply #4 on: March 27, 2016, 08:24:34 pm »


               

this is perfect, thanks again. you've saved me many hours.


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC Properties
« Reply #5 on: March 28, 2016, 11:13:02 am »


               


When a player dies then logs out after the gui panel pops up then respawns after relog a 'pc properties' skin gets placed in their inventory.




This is happening with polymorphed characters relogging too.


 


Its because your server has ILR or ELC verifications on and each of them is for some legacy reason destroying the player items in creature slots. Game is then recreating a new skin, but if player is dead or polymorphed game fails to equip it.


 


This is solved in community patch 1.71 with a 3second recurse for delayed equipping, but


 


there is also another problem is when player has full inventory in which case the new skin drops on ground.


 


This is solved in 1.72 beta.


 


Either way, without 1.71, the horse system tends to mess up mounted status after relog (idk if server restart must happen or not). Losing the skin = losing the data about being mounted and thus relogged player will end up being on horse and unable to dismount. At least in my tests this happened.


 


There are more horse-related issues (mounting horse in unaccessable area, skill decrease stacking...), but I think those were fixed in 1.72beta not 1.71 yet.


 


Anyway, the best solution is not to use ELC/ILR but well... its quite important for multiplayer as without it you need to protect your server against cheaters on your own. Custom ILR is on the other hand not so big deal, there are good choices you can find on vault.



               
               

               
            

Legacy_mornnova

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
PC Properties
« Reply #6 on: March 28, 2016, 02:04:56 pm »


               

do you have an estimate on when 1.72 will be released? i have 1.71, i haven't noticed any problems other than what i describe above. (i believe i fixed that using parts of the script kmds posted, but you said it's fixed with 1.71?) i always dismount when entering interiors, but haven't tested polymorph, or full inventory. i intend to only allow paladins and bg's to use horses, at the moment only paladins can use them.


 


are the messages players get that say "equipped item swapped out" over and over when entering the server to do with ELC/ILR? is this something that can be fixed without turning off ELC/ILR?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC Properties
« Reply #7 on: March 28, 2016, 03:29:23 pm »


               


do you have an estimate on when 1.72 will be released? i have 1.71, i haven't noticed any problems other than what i describe above. (i believe i fixed that using parts of the script kmds posted, but you said it's fixed with 1.71?) i always dismount when entering interiors, but haven't tested polymorph, or full inventory. i intend to only allow paladins and bg's to use horses, at the moment only paladins can use them.


 


are the messages players get that say "equipped item swapped out" over and over when entering the server to do with ELC/ILR? is this something that can be fixed without turning off ELC/ILR?




Well it should be fixed but the fix for this is in x3_def_mod_enter and x2_mod_def_equ, unequ, unaqu scripts. That means, that in new module which has these scripts in correct event it will be fixed but if your module has its own scripts, you will need to merge the new code from x2_mod_*scripts into yours to make it work. But yes, afaik it should be fixed in 1.71.


 


ETA on 1.72 is June, and the only way to avoid the issue would be via NWNX which is not in plan for now (even if it would be easier solution that workarounding all the issues with skin). However, this message actually means there are two skins in player inventory, one is already equipped and one is new. Thats issue itself and might be caused by 1.71 and custom scripts interaction. Im not sure. Whats your module event scripts?


               
               

               
            

Legacy_mornnova

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
PC Properties
« Reply #8 on: March 28, 2016, 04:31:38 pm »


               

an oce script which is merged with my own... i'm assuming its from x3_def_mod_enter, and x3_mod_def_hb, a modified x3_mod_def_load, and a onrest which has AssignCommand(oPC, HorseUnsummonPaladinMount()); ... no scripts in equip, unequip and unacquire.


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC Properties
« Reply #9 on: March 28, 2016, 06:20:30 pm »


               


an oce script which is merged with my own... i'm assuming its from x3_def_mod_enter, and x3_mod_def_hb, a modified x3_mod_def_load, and a onrest which has AssignCommand(oPC, HorseUnsummonPaladinMount()); ... no scripts in equip, unequip and unacquire.




if you have some module events empty as you have no custom code for them, use x2_mod_def_* scripts there. (except OnClientEnter where its x3 if you are allowing horses)


               
               

               
            

Legacy_mornnova

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
PC Properties
« Reply #10 on: March 28, 2016, 08:41:48 pm »


               

ok all done.


 


ty