If anyone could help me with my script...

Post » Fri May 27, 2011 8:44 pm

So I want to make a script that checks if PC is female, if not, the item deequips.
I dont know if setting the Body Part Female Only would make this unneeded, but as I am making a .esp with shared scripts (just so I have em), this would be handy either way.
I already have this, but I dont how to finish it. Im trying to learn to script, but Morrowind Scripting for Dummys does not have a list of variables and if's.

begin Arkh_CheckFemaleUnequip;Checks if PC is female, if not it unequips the itemshort OnPCEquipif ( PCend Arkh_CheckFemaleUnequip


Can someone please help me?
User avatar
Bethany Short
 
Posts: 3450
Joined: Fri Jul 14, 2006 11:47 am

Post » Sat May 28, 2011 7:37 am

There's no convenient way to do that. Unfortunately the only function that can detect the player's six is available only in dialog (PC six function). So if you acquire the item in question through an NPC, you could add 2 different greetings to his/her dialog for the two player gender options, then add a script line to the results box of each to set a global variable to a certain value. Then the script would look something like this:

Begin Arkh_CheckFemaleUnequip;Checks if PC is female, if not it unequips the itemshort PCSkipEquipshort doonceif ( doonce != 0 )	Returnendifif ( is_pc_female == 0 )	set PCSkipEquip to 1else	set PCSkipEquip to 0endifset doonce to 1End


Change "is_pc_female" to the name of your global variable.
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Sat May 28, 2011 5:43 am

So I need to make an NPC, and then make him/her give the PC it if PC is female, otherwise its just an NPC roaming there?
Also, I have 1 glove mesh, how can I split those up in 2 meshes? I have the _grnd for L and R, but the equipped mesh is L and R, like in Oblivion.
User avatar
Becky Cox
 
Posts: 3389
Joined: Thu Jun 22, 2006 8:38 am

Post » Fri May 27, 2011 6:40 pm

if not that, does mwse not have a function for it? it claims xisfemale is an npc function, but it might work with a fix to "player"
User avatar
Mark Hepworth
 
Posts: 3490
Joined: Wed Jul 11, 2007 1:51 pm

Post » Sat May 28, 2011 3:07 am

if not that, does mwse not have a function for it? it claims xisfemale is an npc function, but it might work with a fix to "player"


Yes, you're right. I forgot MWSE has that function. Something like this should work without the NPC trick, but it requires and MWEdit to compile and MWSE to play.

Begin Arkh_CheckFemaleUnequipshort PCSkipEquipshort dooncelong local_pcrefif ( doonce != 0 )	Returnendifsetx local_pcref to xGetRef, "player"setx local_pcref to local_pcref->xIsFemaleif ( local_pcref == 0 )	set PCSkipEquip to 1else	set PCSkipEquip to 0endifset doonce to 1End

User avatar
Skrapp Stephens
 
Posts: 3350
Joined: Mon Aug 06, 2007 5:04 am

Post » Sat May 28, 2011 1:22 am

So I need to make an NPC, and then make him/her give the PC it if PC is female, otherwise its just an NPC roaming there?

No. You could create an empty voice thing, one for a male PC, one for female. This should only happen once (So when the global variable is 0) and should set a global variable if it is said. (To 1 for male, to -1 for female maybe)

Then you can use that global variable in your script.
User avatar
Ben sutton
 
Posts: 3427
Joined: Sun Jun 10, 2007 4:01 am


Return to III - Morrowind