harIII Posted October 26, 2009 Share Posted October 26, 2009 I have absolutely no idea what is going on with this script: void main() { int nInventorySlot01 = ("INVENTORY_SLOT_HEAD"); int nInventorySlot02 = ("INVENTORY_SLOT_BODY"); AssignCommand(GetFirstPC(), ActionEquipItem("g_w_lghtsbr01", nInventorySlot01); AssignCommand(GetFirstPC(), ActionEquipItem("g_w_lghtsbr02", nInventorySlot02); } I keep getting an syntax error at line 7 and 9 with the ";" but I don't see anything that I can do with it. Does anybody have any suggestions? Link to comment Share on other sites More sharing options...
Laar_Dha Posted October 26, 2009 Share Posted October 26, 2009 It looks alike you forgot to close your first set of parentheses at the end of each line. Try it this way. AssignCommand(GetFirstPC(), ActionEquipItem("g_w_lghtsbr01", nInventorySlot01)); AssignCommand(GetFirstPC(), ActionEquipItem("g_w_lghtsbr02", nInventorySlot02)); [/Quote] Link to comment Share on other sites More sharing options...
harIII Posted October 26, 2009 Author Share Posted October 26, 2009 I'm sorry but I'm still getting some problems, there were about 8 errors; can you try compiling it? Link to comment Share on other sites More sharing options...
Laar_Dha Posted October 27, 2009 Share Posted October 27, 2009 Well, some progress. Errors reduced. The problem seems to be that the ActionEquipItem() commands wants an integer in the first parameter. Unfortunately, I have no I idea how to assign a value that will point to the lightsabers. This is what I came up with so far, but it needs more help. void main() { object oPC=GetFirstPC(); AssignCommand(oPC, ActionEquipItem("g_w_lghtsbr01", INVENTORY_SLOT_HEAD)); AssignCommand(oPC, ActionEquipItem("g_w_lghtsbr02", INVENTORY_SLOT_BODY)); } [/Quote] Link to comment Share on other sites More sharing options...
harIII Posted October 27, 2009 Author Share Posted October 27, 2009 Thanks Laar_Dha, but I still can't get it, if anybody else knows what to do, it will be greatly appreciated. Link to comment Share on other sites More sharing options...
DarthStoney Posted October 27, 2009 Share Posted October 27, 2009 Give this a shot and see if it's what you need,not sure but I don't think lightsabers will go into head or body inventory void main(){ object oPC=GetFirstPC(); object oLS2 = CreateItemOnObject("g_w_lghtsbr02", oPC, 1, 1); object oLS = CreateItemOnObject("g_w_lghtsbr01", oPC, 1, 1); AssignCommand(oPC, ActionEquipItem(oLS, INVENTORY_SLOT_RIGHTWEAPON)); AssignCommand(oPC, ActionEquipItem(oLS2, INVENTORY_SLOT_LEFTWEAPON)); } Link to comment Share on other sites More sharing options...
harIII Posted October 27, 2009 Author Share Posted October 27, 2009 I know that the items wouldn't go to the head and body but I didn't want to reveal what I going to do because I'm part of a project that hasn't been announced yet. It's compiling but I'm not seeing the items equip this is the ultimate script. It's suppose to give you the helmet and armor, equip both, and then start a conversation on spawn: void main() { object oPC=GetFirstPC(); object oLS2 = CreateItemOnObject("storm_helmet", oPC, 1, 1); object oLS = CreateItemOnObject("storm_armour", oPC, 1, 1); AssignCommand(oPC, ActionEquipItem(oLS, INVENTORY_SLOT_BODY)); AssignCommand(oPC, ActionEquipItem(oLS2, INVENTORY_SLOT_HEAD)); } It's compiling correctly but it's not equiping the items. Any ideas? Link to comment Share on other sites More sharing options...
DarthStoney Posted October 27, 2009 Share Posted October 27, 2009 Forgot the void main(){ ? [color="Red"]void main(){[/color] object oPC=GetFirstPC(); object oLS2 = CreateItemOnObject("storm_helmet", oPC, 1, 1); object oLS = CreateItemOnObject("storm_armour", oPC, 1, 1); AssignCommand(oPC, ActionEquipItem(oLS, INVENTORY_SLOT_BODY)); AssignCommand(oPC, ActionEquipItem(oLS2, INVENTORY_SLOT_HEAD)); } Link to comment Share on other sites More sharing options...
harIII Posted October 27, 2009 Author Share Posted October 27, 2009 That wouldn't allow me to compile. I had the void main in the script but simply forgot to copy everything. The problem is that it will compile but won't equip the items in the game. Link to comment Share on other sites More sharing options...
DarthStoney Posted October 27, 2009 Share Posted October 27, 2009 Oh,ok are you using the res_referance value for these; object oLS2 = CreateItemOnObject("[color="Red"]storm_helmet[/color]", oPC, 1, 1); object oLS = CreateItemOnObject("[color="red"]storm_armour[/color]", oPC, 1, 1); or if your using the tag value try this,(not sure if this is correct) object oLS2 = CreateItemOnObject(GetObjectByTag("storm_helmet") , oPC, 1, 1)); object oLS = CreateItemOnObject(GetObjectByTag("storm_armour") , oPC, 1, 1)); Link to comment Share on other sites More sharing options...
glovemaster Posted October 27, 2009 Share Posted October 27, 2009 CreateItemOnObject("storm_helmet", oPC, 1, 1) This parameter is the name of the UTI file, or the "resref". If you are using the tag, then that's probably the problem. Otherwise there could be a problem with the UTI files you are using. Hope that helps Link to comment Share on other sites More sharing options...
harIII Posted October 27, 2009 Author Share Posted October 27, 2009 I still had a problem with a parenthese and fooled around with it for a while but got it working. Here is the final script that I used for those curious: void main() { object oPC=GetFirstPC(); object oHelmet = CreateItemOnObject("storm_helmet",oPC); object oArmour = CreateItemOnObject("storm_armour",oPC); object oSaber = CreateItemOnObject("g_w_lghtsbr02",oPC); AssignCommand (oPC, ActionEquipItem(oHelmet, INVENTORY_SLOT_HEAD)); AssignCommand (oPC, ActionEquipItem(oArmour, INVENTORY_SLOT_BODY)); AssignCommand (oPC, ActionEquipItem(oSaber, INVENTORY_SLOT_RIGHTWEAPON)); ExecuteScript("start_zorin", OBJECT_SELF); } I think the problem was that the uti files were in a subfolder in the override. Link to comment Share on other sites More sharing options...
glovemaster Posted October 27, 2009 Share Posted October 27, 2009 I think the problem was that the uti files were in a subfolder in the override. That shouldn't have been a problem, but if it's working now I wouldn't look into it Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.