Jump to content

Home

Problem with equipping items


harIII

Recommended Posts

I'm having a problem with this script. The point is to equip several npcs with a custom helmet by adding the helmet to their inventory and then equipping it. When it fires (onSpawn to the module) it looks like the script is adding the custom helmet to the inventory but nothing is being equipped.

 

Does anyone see what is not happening correctly in the script or know of a better way to do this?

 

Also I have tried equipping them through the KGFF Editor and that too doesn't do anything.

 

void main() {

 

object oNPC1 = GetObjectByTag("reb_soldier1");

object oNPC2 = GetObjectByTag("reb_soldier2");

object oNPC3 = GetObjectByTag("reb_soldier3");

object oNPC4 = GetObjectByTag("reb_soldier4");

object oNPC5 = GetObjectByTag("reb_soldier5");

object oNPC6 = GetObjectByTag("reb_soldier5a");

object oNPC7 = GetObjectByTag("reb_soldier5b");

object oNPC8 = GetObjectByTag("reb_soldier5c");

object oNPC9 = GetObjectByTag("reb_soldier6");

object oNPC10 = GetObjectByTag("reb_soldiera1");

object oNPC11 = GetObjectByTag("reb_soldiera2");

object oNPC12 = GetObjectByTag("reb_soldiera3");

object oNPC13 = GetObjectByTag("reb_soldiera4");

 

object oHelmet1 = CreateItemOnObject("a_helmet58",oNPC1);

object oHelmet2 = CreateItemOnObject("a_helmet58",oNPC2);

object oHelmet3 = CreateItemOnObject("a_helmet58",oNPC3);

object oHelmet4 = CreateItemOnObject("a_helmet58",oNPC4);

object oHelmet5 = CreateItemOnObject("a_helmet58",oNPC5);

object oHelmet6 = CreateItemOnObject("a_helmet58",oNPC6);

object oHelmet7 = CreateItemOnObject("a_helmet58",oNPC7);

object oHelmet8 = CreateItemOnObject("a_helmet58",oNPC8);

object oHelmet9 = CreateItemOnObject("a_helmet58",oNPC9);

object oHelmet10 = CreateItemOnObject("a_helmet58",oNPC10);

object oHelmet11 = CreateItemOnObject("a_helmet58",oNPC11);

object oHelmet12 = CreateItemOnObject("a_helmet58",oNPC12);

object oHelmet13 = CreateItemOnObject("a_helmet58",oNPC13);

 

AssignCommand (oNPC1, ActionEquipItem(oHelmet1, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC2, ActionEquipItem(oHelmet2, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC3, ActionEquipItem(oHelmet3, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC4, ActionEquipItem(oHelmet4, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC5, ActionEquipItem(oHelmet5, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC6, ActionEquipItem(oHelmet6, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC7, ActionEquipItem(oHelmet7, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC8, ActionEquipItem(oHelmet8, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC9, ActionEquipItem(oHelmet9, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC10, ActionEquipItem(oHelmet10, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC11, ActionEquipItem(oHelmet11, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC12, ActionEquipItem(oHelmet12, INVENTORY_SLOT_HEAD));

AssignCommand (oNPC13, ActionEquipItem(oHelmet13, INVENTORY_SLOT_HEAD));

 

}

Link to comment
Share on other sites

Does your custom Helmet have any restrictions? to keep the NPC from being able to where the helmet. The only other thing you may try is to add a "delay" command to the equiping of the helmet.

 

DelayCommand(0.5, AssignCommand (oNPC13, ActionEquipItem(oHelmet13, INVENTORY_SLOT_HEAD)));

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...