Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Question about equipping a Hide on the Main PC

Page: 1 of 1
 RedHawke
01-24-2005, 10:51 PM
#1
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? :D

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,INVENTOR Y_SLOT_CARMOUR,TRUE));
DelayCommand(0.2,TakeGoldFromCreature(20000, GetFirstPC(),TRUE));

}
 Darkkender
01-24-2005, 11:12 PM
#2
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.
 ChAiNz.2da
01-25-2005, 3:05 AM
#3
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...
 Darth333
01-25-2005, 6:09 AM
#4
This should work:

void main()
{
object oOldHide = GetItemInSlot (INVENTORY_SLOT_CARMOUR,GetFirstPC());
object oNewHide = CreateItemOnObject("rh_crhide001",GetFirstPC());

if(GetIsObjectValid(oOldHide))
{
DestroyObject(oOldHide);
}
AssignCommand(GetFirstPC(), 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 (http://mars.walagata.com/w/darth333/raghoul_fix.zip) for Sep's mod if you want.
 Mach1
01-25-2005, 6:31 AM
#5
Whats a Hide ?..And what does it do ?..Ive seen them in KSE but.I have no idea what they or look like
 Darkkender
01-25-2005, 7:53 AM
#6
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.
 Mach1
01-25-2005, 7:55 AM
#7
Ah..k..So if i whould equip a Canderous Hide i whould have his stats ?
 sketch42
01-25-2005, 8:07 AM
#8
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
 Darkkender
01-25-2005, 8:07 AM
#9
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.
 Mach1
01-25-2005, 8:11 AM
#10
Ah..k..Thnx for the info! :bdroid2:
 Darkkender
01-25-2005, 8:13 AM
#11
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.
 ChAiNz.2da
01-25-2005, 8:41 AM
#12
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

;)
 Darkkender
01-25-2005, 9:07 AM
#13
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.
 tk102
01-25-2005, 9:11 AM
#14
No that would've caused a compile error. Darth333 was correct in her suggested use of the AssignComand.
 Darkkender
01-25-2005, 9:19 AM
#15
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.
 deathdisco
01-25-2005, 9:21 AM
#16
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,TR UE));
}
 StormSinger
01-25-2005, 9:26 AM
#17
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));
}
 RedHawke
01-25-2005, 7:29 PM
#18
Wow... I'll try that script suggestion in a couple of minutes Darth333... thanks. :D

Edit: The script alteration worked like a charm Darth333... Thanks! :D

:elephant: :rddance: :sheepdanc :guitar2 :band1
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! :D
 ChAiNz.2da
01-26-2005, 12:37 AM
#19
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! :D
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 :rolleyes: ). Just wanted to make sure though ;)
Page: 1 of 1