PDA

View Full Version : How to unequip someone...


GeorgNihilus
07-18-2007, 06:50 PM
Alright I know how to equip a specific robe to a party member ... but what if I want to remove the playable character equiped robes i.e. to make her dance in a cantina, just because the team needs some money? :) (in Telos Cantina for example...) Can this be scripted? :giveup: (I mean the undressing part ... for now...)

thanks on advance :thumbsup:

stoffe
07-18-2007, 08:50 PM
Alright I know how to equip a specific robe to a party member ... but what if I want to remove the playable character equiped robes


If you just want to remove any clothing/armor the character is wearing you can do it like:

void main() {
object oUndresser = GetObjectByTag("UndresserTag");
AssignCommand(oUndresser, ClearAllActions());
AssignCommand(oUndresser, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_BODY, oUndresser), TRUE ));
}

... where you set UndresserTag to the Tag of the NPC that should undress.

Mindtwistah
07-19-2007, 04:57 AM
Stoffe, is that script for TSL or K1?

If it is for TSL, can you post one for K1?

swfan28
07-19-2007, 06:26 AM
Originally Posted by Mindtwistah
Stoffe, is that script for TSL or K1?
It should work with both games.

I was thinking of using a script like that with my Bastila Romance Enhancement mod right before the "an hour later" part but it might have crossed the line between what is allowed and whats not for a PG 11 game.

Mindtwistah
07-19-2007, 03:52 PM
Is there a script that undresses the nearest NPC?

GeorgNihilus
07-20-2007, 12:33 AM
Thanks Stoffe the scripts works perfect :urpdude: , still something odd happens when using it in Doton Het's dialog file (dotonhet.dlg); associated to a script that makes a delay with a blank screen ... just after the last spoken line of Doton this twilek continues talking and repeating phrases ... didn't happen to me when I used these delays same way on Mira's dialog or other party members dialogs ... gonna check what could be ... :roleyess:

stoffe
07-20-2007, 09:18 AM
Is there a script that undresses the nearest NPC?

Should work to use a similar script if you replace the first line with something like...

object oUndresser = GetNearestCreature(CREATURE_TYPE_RACIAL_TYPE, RACIAL_TYPE_HUMAN, GetFirstPC(), 1, CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC);

...instead.

Be aware though that many NPCs in the game technically aren't wearing anything at all, they just use a clothed/armored appearance model as their "undressed" body variation. Against such NPCs that script would not do anything.

Leviathan
07-21-2007, 10:35 AM
Although I am not that conversant with Star Wars™ : Knights of the Old Republic® Scripting, and as I have not canvassed Script files intended for Star Wars™ : Knights of the Old Republic® II – The Sith Lords within a recent past, I would be nonetheless tempted to say that the following listing could be rather useful for whoever would want to remove Armors, Jedi Robes and other sorts of apparels worn by the nighest Non-Playable Character belonging to your Party. Evidently, because of the fact this kind of instructions was mainly utilized throughout Star Wars™ : Knights of the Old Republic®'s Scripts, they may not react the right way if they happened to be ported towards Star Wars™ : Knights of the Old Republic® II – The Sith Lords, and that's why I would like to get thoughts of experienced Scripters at first. Therefore, here it is :

void main()
{
object oUndresser = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC);
AssignCommand(oUndresser, ClearAllActions());
AssignCommand(oUndresser, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_BOD Y, oUndresser), TRUE ));
}

GeorgNihilus
08-03-2007, 06:58 PM
Now I'm asking this in this thread ... even it's not a robe doubt :rolleyes: ... so I want to start a dialog but previously I don't want him/her with weapons in their hands ... so how do I unequip a party member in K1 off his weapons?? :dozey:

thanks people as always ... :thmbup1:

stoffe
08-03-2007, 07:21 PM
Now I'm asking this in this thread ... even it's not a robe doubt :rolleyes: ... so I want to start a dialog but previously I don't want him/her with weapons in their hands ... so how do I unequip a party member in K1 off his weapons?? :dozey:


Do you only want the party members to be unarmed during the dialog, or before/after it as well? If it's just during the dialog you could let the dialog itself handle it for you without any need for scripts, if I remember correctly. Load your DLG file in tk102's DLG Editor, click on the top node in the treeview (the one listing the file name) and in the lower panel there should be an Unequip checkbox.

If you want to unequip the party's weapons with a script you can do it like this:

void main() {
int i;
for (i = 0; i < GetPartyMemberCount(); i++) {
object oParty = GetPartyMemberByIndex(i);
AssignCommand(oParty, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON, oParty), TRUE));
AssignCommand(oParty, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oParty), TRUE));
}
}

GeorgNihilus
08-04-2007, 11:01 AM
Ahh great :bow: I'd prefer the 1st option (during dialog) I guess, but the script could be very helpful indeed ...

thanks a lot ... :slsaber:

GeorgNihilus
09-17-2007, 06:43 PM
Now guys I want to unequip the head items (neural bands, helmets or whatever) before starting certain animation or dialog branch, how do I do that, if possible? :rolleyes: i.e. a script that unequips the PC and let's say Bastila head items ...

thanks as usual :waive1:

stoffe
09-17-2007, 07:07 PM
i.e. a script that unequips the PC and let's say Bastila head items ...


Something like this should work:

void ST_Unequip(int iSlot, object oActor=OBJECT_SELF);

void main() {
ST_Unequip(INVENTORY_SLOT_HEAD, GetObjectByTag("Bastila"));
ST_Unequip(INVENTORY_SLOT_HEAD, GetFirstPC());
}


void ST_Unequip(int iSlot, object oActor=OBJECT_SELF) {
AssignCommand(oActor, ActionUnequipItem( GetItemInSlot(iSlot, oActor), TRUE));
}

GeorgNihilus
09-18-2007, 01:57 PM
Great! ;) works perfect, by the way I'm using it for unequipping PC and Bastila's heads before the kissing animation scene from Bastila_romance_enhancement mod, in the Ebon Hawk ...

Thanks Stoffe and good modding! :waive1: