SKIN_Support Issues
#1
Posté 20 mars 2011 - 10:55
I have included both x3_mod_def_enter and x3_mod_def_hb in the corresponding module events (running first), and am using a standard nw_ skin. Here is my code for reference:
Code:
#include "x3_inc_skin"
void main()
{
object oPC = GetPCSpeaker();
object oSkin = CreateItemOnObject("nw_creitemvamp", oPC);
AssignCommand(oPC, SKIN_SupportEquipSkin(oSkin, 0));
SetSubRace(oPC, "Vampire");
}
I've tried several variations of this code, and the most successful I've been is using the SKIN_SupportGetSkin option, which creates a default skin when none is detected, and then adding itemproperties manually. While this works, I'd much rather have a skin loadout on the custom pallete. I appreciate any help on this issue.
#2
Posté 20 mars 2011 - 11:25
Both issues are gone with my community patch btw.
Also you should do this:
SetLocalObject(oPC,"oX3_Skin",oSkin);
Otherwise default horse scripts that also inflicted several AI/spell scripts may swap your skin with the 1.69 default one.
Modifié par ShaDoOoW, 20 mars 2011 - 11:28 .
#3
Posté 21 mars 2011 - 11:53
Modifié par Psynexus, 21 mars 2011 - 11:54 .
#4
Posté 22 mars 2011 - 08:48
#5
Posté 22 mars 2011 - 09:44
#6
Posté 22 mars 2011 - 11:22
#7
Posté 24 mars 2011 - 11:39
First your skin is custom right? cos default vampire skin have resref "nw_creitemvam"
Second, it looks that this function is "private" cos there is no definition and it don't work with custom content which is what you trying to do that. This function is apparently meant only for equpping default horse skin that came with 1.69 and so when it found out there is some skin already it destroys the one being equipped.
So, a workaround for it would be to destroy current PC skin OR if PC have skin already instead of changing it, you can add itemproperties from vampire skin into current one.
The first workaround would be done like this:
second would need to loop itemproperties in vampire skin, and copy them (and to create it on the ground instead and destroy immediately) or better manually input them via ItemProperty* functionsobject oCurrent = GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
if(GetIsObjectValid(oCurrent))
{
DestroyObject(oCurrent);
}
But really this function is not for what you are trying to do that.
You can try my function but its been a while since I used it so I cannot guarantee it will not mess with default skin (which is not present in my module at all).
//force equip the skin
void ActionForceEquipItem(object oItem, int
nInventorySlot);
void ActionForceEquipItemContinue(object oItem, int nInventorySlot)
{
object oSelf = OBJECT_SELF;
if(GetIsObjectValid(oSelf) && GetIsObjectValid(oItem))
{
if(!GetIdentified(oItem))
{
SetIdentified(oItem,TRUE);
}
if(!GetIsInSlot(nInventorySlot,oItem,oSelf))
{
if(GetLocalObject(oSelf,"ActionForceEquipItem_"+IntToString(nInventorySlot)) == oItem)
{
ClearAllActions();
ActionEquipItem(oItem,nInventorySlot);
DelayCommand(0.1,ActionForceEquipItemContinue(oItem,nInventorySlot));
}
}
else
{
DeleteLocalInt(oItem,"FIRST_TIME");
DeleteLocalInt(oItem,"ActionForceEquipItem");
DeleteLocalObject(oSelf,"ActionForceEquipItem_"+IntToString(nInventorySlot));
}
}
}
void ActionForceEquipItem(object oItem, int nInventorySlot)
{
if(!GetLocalInt(oItem,"ActionForceEquipItem"))
{
SetLocalObject(OBJECT_SELF,"ActionForceEquipItem_"+IntToString(nInventorySlot),oItem);
SetLocalInt(oItem,"ActionForceEquipItem",TRUE);
ActionForceEquipItemContinue(oItem,nInventorySlot);
}
}
#8
Posté 24 mars 2011 - 12:02
http://social.biowar...m/project/4141/





Retour en haut






