Author Topic: PC Skin and Polymorph  (Read 406 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
PC Skin and Polymorph
« on: November 20, 2011, 12:45:05 am »


               What exactly happens to the PC skin in response to a polymorph?

I assume the following:
(1) PC Skin is replaced by whatever is shown in the Hideitem column of polymorph.2da
(2) data on PC Skin is lost
(3) After polymorph the PC Skin replaces the Hideitem. (but has lost all data)

What happens if nothing was specified in the Hideitem column?

Is the data on the PC Skin migrated back and forth?

I want certain data to be set on the PC Skin rather than in a database (so that this data follows the character regardless of the database between modules), but am realizing this could be a tricky process if I need to write scripts to do it.

So my second question... is the application of the PC Skin hardcoded or in a script? If so, which script? (I mean other than x3_inc_skin or is SKIN_SupportEquipSkin the function to adjust for migrating data?)
               
               

               


                     Modifié par henesua, 20 novembre 2011 - 12:49 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC Skin and Polymorph
« Reply #1 on: November 20, 2011, 01:08:55 am »


               1) yes, this means that OnUnEquip fires with current Skin, and OnEquip runs with polymorph skin
2) nope, datas are still there and even though original Skin cannot be accessed via GetItemInSlot, it still can be accessed via GetLocalObject
3) when unpolymorph, OnUnEquip fires with polymorph skin and OnEquip fires with original skin, all datas are there

I think that Skin is unequipped even if there is nothing in HideItem collumn, though Im not absolutely sure it makes sense as other items are unequipped as well.

Data on PC skin are still there and can be accessed via GetLocalSomething(GetLocalObject(oPC,"skin"),"something");

And I strongly recommend not to use x3_inc_skin functions, rather make your own.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
PC Skin and Polymorph
« Reply #2 on: November 20, 2011, 01:30:50 am »


                Thanks, Shadow!

So this sounds like I can count on the skin retaining data. Very good.

What about x3_inc_skin is problematic? Have you improved this include in your community patch?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC Skin and Polymorph
« Reply #3 on: November 20, 2011, 01:40:41 am »


               Well I don't remember now what was my problem with this include and functions inside, but I know they didn't fit me when I was working with skin. But I guess its safe to use and I didn't improved it in my patch project.
               
               

               
            

Legacy_dragonvain

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
PC Skin and Polymorph
« Reply #4 on: November 26, 2011, 07:10:25 am »


               want script  would  you use  if you want to look like a full  orc
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
PC Skin and Polymorph
« Reply #5 on: November 27, 2011, 12:51:39 am »


                FYI - thanks for nudging me towards rewriting the x3_inc_skin script. I looked into it, and found a solution by the krit. Its been working well.
http://nwvault.ign.c....Detail&id=7697
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC Skin and Polymorph
« Reply #6 on: November 27, 2011, 05:10:56 pm »


               

henesua wrote...

 FYI - thanks for nudging me towards rewriting the x3_inc_skin script. I looked into it, and found a solution by the krit. Its been working well.
http://nwvault.ign.c....Detail&id=7697

just FYI, my unofficial patch fixes the issue as well but via different (and have to say that also more efficient) approach (not using x3_inc_skin inside x2_inc_spellhook at all). I was a bit skeptical about The Krit solution as he didn't provide reason (and explained the new behavior) for total library rewrite when the issue itself is elsewhere.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
PC Skin and Polymorph
« Reply #7 on: November 27, 2011, 06:15:37 pm »


               Does your patch provide a switch between a PC skin and an object in inventory?

Or in your opinion is the PC Skin not the problem?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC Skin and Polymorph
« Reply #8 on: November 27, 2011, 06:20:31 pm »


               My opinion is that the function GetIsMounted shouldnt call skin include.

EDIT: im not saying that he didnt fixed the PC properties in loot. He did. Im just saying that the cause of this issue is in my opinion elsewhere.

EDIT2: To make it clear. If your objective was to fix the PC properties in loot and you already uses my patch, then you don't need The Krit's solution. If your objective is to get better working skin include, then The Krit's skin include change is a good choice. My concerns are that the Krit didn't specified whats improved in his include (and if you compare default and his you will see that he changed it completely) and that he is proposing his change to fix in my opinion issue caused by another subject.
               
               

               


                     Modifié par ShaDoOoW, 27 novembre 2011 - 07:14 .