RedHawke Posted January 25, 2005 Share Posted January 25, 2005 I have been trying to equip a hide on the main PC with a script, and all I get is the Hide Item in my inventory it does not equip... it is starting to make me wonder if the Main PC can even equip a hide item. Anyway here is the code, it compiles and fires fine, the credits disappear and I get the Hide (In Inventory) but it doesn't equip... any Ideas? [size=2] void main() { object oOldHide = GetItemInSlot(INVENTORY_SLOT_CARMOUR,GetFirstPC()); object oNewHide = CreateItemOnObject("rh_crhide001",GetFirstPC()); if(GetIsObjectValid(oOldHide)) { DestroyObject(oOldHide); } DelayCommand(0.2,ActionEquipItem(oNewHide,INVENTORY_SLOT_CARMOUR,TRUE)); DelayCommand(0.2,TakeGoldFromCreature(20000, GetFirstPC(),TRUE)); } [/size] Link to comment Share on other sites More sharing options...
Darkkender Posted January 25, 2005 Share Posted January 25, 2005 Okay couple of questions have you tried bringing up the player inventory in kse and trying to apply a hidden armor there first just to see if it is possible? If you can I would try your script minus the destroy old hide portion and without the delay on the actionequipitem. See if it will apply just like that. Also have you tried using the object_self object command instead of the getfirstpc command there may be enough of a difference in the way they function to cause the problem. Link to comment Share on other sites More sharing options...
ChAiNz.2da Posted January 25, 2005 Share Posted January 25, 2005 Just a question (from a non-scripter's POV)...is there a space in the DelayCommand interval?: (0. 2,ActionEquipItem if so, is it supposed to be there or would that even cause a problem? I noticed there's not a space in the line that follows... Link to comment Share on other sites More sharing options...
Darth333 Posted January 25, 2005 Share Posted January 25, 2005 This should work: void main() { object oOldHide = GetItemInSlot (INVENTORY_SLOT_CARMOUR,GetFirstPC()); object oNewHide = CreateItemOnObject("rh_crhide001",GetFirstPC()); if(GetIsObjectValid(oOldHide)) { DestroyObject(oOldHide); } [color=limegreen]AssignCommand(GetFirstPC()[/color], ActionEquipItem (oNewHide,INVENTORY_SLOT_CARMOUR,TRUE)); DelayCommand(0.2,TakeGoldFromCreature(20000, GetFirstPC(),TRUE)); } You can leave the Delay command function if you wish but it is not necessary. The script will be executed in the order in which the commands appear. Check my raghoul fix for Sep's mod if you want. Link to comment Share on other sites More sharing options...
Mach1 Posted January 25, 2005 Share Posted January 25, 2005 Whats a Hide ?..And what does it do ?..Ive seen them in KSE but.I have no idea what they or look like Link to comment Share on other sites More sharing options...
Darkkender Posted January 25, 2005 Share Posted January 25, 2005 Originally posted by Mach1 Whats a Hide ?..And what does it do ?..Ive seen them in KSE but.I have no idea what they or look like A hide is a hidden armor such as when you repair hk-47 a script fires that destroys the original hidden armor and replaces it with a new one that has hk's new upgrades. There are a total of 4 hidden item slots 1 is a armor, 1 is a bite attack, and 2 are claw attacks. The hidden items are used 95% of the time by creatures. 3 NPC's within your party have items equipped in there. Canderous, HK-47, & Juhani. Canderous's is his regeneration implant, HK's are his upgrades, & Juhani's is a stealth unit. Originally posted by ChAiNz.2da Just a question (from a non-scripter's POV)...is there a space in the DelayCommand interval?: (0. 2,ActionEquipItem if so, is it supposed to be there or would that even cause a problem? I noticed there's not a space in the line that follows... While gramatically having a space after a comma is correct many programming languages ignore the lack of a space including the scripting that we program. Although sometimes certain scripts will not compile without the space it just depends on the function you are trying to call. Link to comment Share on other sites More sharing options...
Mach1 Posted January 25, 2005 Share Posted January 25, 2005 Ah..k..So if i whould equip a Canderous Hide i whould have his stats ? Link to comment Share on other sites More sharing options...
sketch42 Posted January 25, 2005 Share Posted January 25, 2005 Originally posted by Mach1 Ah..k..So if i whould equip a Canderous Hide i whould have his stats ? no basically a hide is something that equiped on the character without taking up a slot in the equip screen ... so for instance if you wanted your PC to have brejiks arm band and belt equiped you can ... make it a HIDE(hidden ) equiped item just like Candy's Regen Implant doesnt use a slot and doesnt need a feat ... its a HIDE(hidden) Item Link to comment Share on other sites More sharing options...
Darkkender Posted January 25, 2005 Share Posted January 25, 2005 Originally posted by Mach1 Ah..k..So if i whould equip a Canderous Hide i whould have his stats ? It will only give you his special regeneration feature. You know when canderous joins your party you get that dialogue message that pops up saying he has a special implant that allows him to regenerate? that is what his hide is. Link to comment Share on other sites More sharing options...
Mach1 Posted January 25, 2005 Share Posted January 25, 2005 Ah..k..Thnx for the info! Link to comment Share on other sites More sharing options...
Darkkender Posted January 25, 2005 Share Posted January 25, 2005 Originally posted by sketch42 no basically a hide is something that equiped on the character without taking up a slot in the equip screen ... so for instance if you wanted your PC to have brejiks arm band and belt equiped you can ... make it a HIDE(en ) equiped item just like Candy's Regen Implant doesnt use a slot and doesnt need a feat ... its a HIDE(en) Item You cannot have more than one hide item that and in order for something to be placed in that slot in game it has to be done with scripting. Also it is good to note many of the creature/monsters you encounter have an item equipped in there. However if we wish to continue this discussion it should be taken to another thread now as this is getting off topic of Redhawke's need for scripting advise/feedback. Link to comment Share on other sites More sharing options...
ChAiNz.2da Posted January 25, 2005 Share Posted January 25, 2005 Originally posted by Darkkender While gramatically having a space after a comma is correct many programming languages ignore the lack of a space including the scripting that we program. Although sometimes certain scripts will not compile without the space it just depends on the function you are trying to call. ummm, I meant the space between the "." & the "2" ie = 0. 2 Link to comment Share on other sites More sharing options...
Darkkender Posted January 25, 2005 Share Posted January 25, 2005 Originally posted by ChAiNz.2da ummm, I meant the space between the "." & the "2" ie = 0. 2 I had missed that part and your right that very well could have caused the problem with the script working proper. Link to comment Share on other sites More sharing options...
tk102 Posted January 25, 2005 Share Posted January 25, 2005 No that would've caused a compile error. Darth333 was correct in her suggested use of the AssignComand. Link to comment Share on other sites More sharing options...
Darkkender Posted January 25, 2005 Share Posted January 25, 2005 Originally posted by tk102 No that would've caused a compile error. Darth333 was correct in her suggested use of the AssignComand. I would have thought so as well but Redhawke said he had no problems with compile so I was just going with the next conclusion which is that it may have compiled but due to a syntax error the function may not have worked proper. But I definetley don't argue the thought that the AssignCommand needed to be there. I was at a loss last night in trying to figure out what was missing from the original script. Link to comment Share on other sites More sharing options...
deathdisco Posted January 25, 2005 Share Posted January 25, 2005 This is the script I used in my SaberWield mod it equipes a custom creature hide item on the PC. void main() { object oBox=GetObjectByTag("end_locker01"); CreateItemOnObject("g_w_lghtsbr01", oBox); CreateItemOnObject("g_w_sbrcrstl16", oBox); CreateItemOnObject("g_w_sbrcrstl18", oBox); CreateItemOnObject("revan_datapad", oBox); object oPC=GetFirstPC(); object oNewHide = CreateItemOnObject("saberwield",oPC); AssignCommand(oPC, ActionEquipItem(oNewHide,INVENTORY_SLOT_CARMOUR,TRUE)); } Link to comment Share on other sites More sharing options...
StormSinger Posted January 25, 2005 Share Posted January 25, 2005 I've been using this script to equip hides on the PC for quite awhile. I've never bothered to destroy it if I equip another, but it's easy enough to add that into the script. The ClearAllActions isn't entirely necessary, but I generally use it as a habit. void main() { object oPC = GetFirstPC(); if(!GetIsPC(oPC)) return; AssignCommand(oPC, ClearAllActions()); object oHide = CreateItemOnObject("PC_HIDE_1", oPC); if(!GetIsObjectValid(oHide)) return; AssignCommand(oPC, ActionEquipItem(oHide, INVENTORY_SLOT_CARMOUR)); } Link to comment Share on other sites More sharing options...
RedHawke Posted January 25, 2005 Author Share Posted January 25, 2005 Wow... I'll try that script suggestion in a couple of minutes Darth333... thanks. Edit: The script alteration worked like a charm Darth333... Thanks! Originally posted by Darkkender I would have thought so as well but Redhawke said he had no problems with compile so I was just going with the next conclusion which is that it may have compiled but due to a syntax error the function may not have worked proper. Just to clear things up... Darkkender the code block I posted has put some phantom spaces in the actual post that aren't actually in my script proper, and I cannot get rid of the spaces in the post, I have tried editing it but no-go, but trust me they surely aren't there in the script! Link to comment Share on other sites More sharing options...
ChAiNz.2da Posted January 26, 2005 Share Posted January 26, 2005 Originally posted by RedHawke Just to clear things up... Darkkender the code block I posted has put some phantom spaces in the actual post that aren't actually in my script proper, and I cannot get rid of the spaces in the post, I have tried editing it but no-go, but trust me they surely aren't there in the script! Ahhh.. thanks for clearing that up RedHawke... I thought that may have been the problem as I had originally tried to make the "space" yellow in your actual code block (to point it out) and it had put the spaces in my color tags (of all things ). Just wanted to make sure though Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.