Jump to content

A script which refers on player's sex


Recommended Posts

I wrote a script on the auto-inject stimpack basis for the custom ingestible to be automatically used and play some sounds when health drops to certain percent. It works great, here it is:

 

scn BloodPotionQuestSCRIPT

BEGIN GameMode

If ( Player.GetHealthPercentage < 0.35 ) && (Player.IsInCombat == 1) && ( Player.HasMagicEffect RestoreHealth == 0)
If ( Player.GetItemCount BloodPotion > 0 )
ShowMessage BloodPotionUsedMSG;
PlaySound NPCHumanUsingBloodPotion
Player.CastImmediateOnSelf BloodPotion
Player.RemoveItem BloodPotion 1
EndIf

Endif

END

 

What I want now, is to make the sounds vary depending on the player's gender (female's would be deranged laugh from Violet's cut dialogue, male's would be just some power attack roar).

I wrote this, but it doesn't want to save:

 

scn BloodPotionGenderDependantQuestSCRIPT

BEGIN GameMode

If ( Player.GetHealthPercentage < 0.35 ) && (Player.IsInCombat == 1) && ( Player.HasMagicEffect RestoreHealth == 0) && ( Player.GetIsSex Male == 1 )
If ( Player.GetItemCount BloodPotion > 0
ShowMessage BloodPotionUsedMSG;
PlaySound NPCHumanUsingBloodPotionMALE
Player.CastImmediateOnSelf BloodPotion
Player.RemoveItem BloodPotion 1

ELSEIF ( Player.GetHealthPercentage < 0.35 ) && (Player.IsInCombat == 1) && ( Player.HasMagicEffect RestoreHealth == 0) && ( Player.GetIsSex Female == 1 )
If ( Player.GetItemCount BloodPotion > 0 )
ShowMessage BloodPotionUsedMSG;
PlaySound NPCHumanUsingBloodPotionFEMALE
Player.CastImmediateOnSelf BloodPotion
Player.RemoveItem BloodPotion 1

Endif

Endif

END

 

Any ideas what I did wrong here? Pls explain like to a first grader, I'm not experienced in scripting at all.

 

Link to comment
Share on other sites

It seems like you forgot to place an "EndIf", it should be above the "ELSEIF"

 

Also you can shorten your script slightly, take a look:

scn BloodPotionGenderDependantQuestSCRIPT

BEGIN GameMode

If ( Player.GetHealthPercentage < 0.35 ) && (Player.IsInCombat == 1) && ( Player.HasMagicEffect RestoreHealth == 0)                                                              
   If ( Player.GetItemCount BloodPotion > 0
      ShowMessage BloodPotionUsedMSG;
      If Player.GetIsSex Male == 1
         PlaySound NPCHumanUsingBloodPotionMALE
      Elseif Player.GetIsSex Female == 1
         PlaySound NPCHumanUsingBloodPotionFEMALE
      Endif
      Player.CastImmediateOnSelf BloodPotion
      Player.RemoveItem BloodPotion 1
   Endif
END
Link to comment
Share on other sites

 

It seems like you forgot to place an "EndIf", it should be above the "ELSEIF"

 

Also you can shorten your script slightly, take a look:

scn BloodPotionGenderDependantQuestSCRIPT

BEGIN GameMode

If ( Player.GetHealthPercentage < 0.35 ) && (Player.IsInCombat == 1) && ( Player.HasMagicEffect RestoreHealth == 0)                                                              
   If ( Player.GetItemCount BloodPotion > 0
      ShowMessage BloodPotionUsedMSG;
      If Player.GetIsSex Male == 1
         PlaySound NPCHumanUsingBloodPotionMALE
      Elseif Player.GetIsSex Female == 1
         PlaySound NPCHumanUsingBloodPotionFEMALE
      Endif
      Player.CastImmediateOnSelf BloodPotion
      Player.RemoveItem BloodPotion 1
   Endif
END

Thanks man, that totally helped. At first it didn't work, but I took a closer look at it, and discovered that now *you* forgot one Endif at the end :smile: So the working script is:

 

scn BloodPotionQuestSCRIPT

 

BEGIN GameMode

 

If ( Player.GetHealthPercentage < 0.35 ) && (Player.IsInCombat == 1) && ( Player.HasMagicEffect RestoreHealth == 0)

If ( Player.GetItemCount BloodPotion > 0 )

ShowMessage BloodPotionUsedMSG;

If Player.GetIsSex Male == 1

PlaySound NPCHumanUsingBloodPotionMALE

Elseif Player.GetIsSex Female == 1

PlaySound NPCHumanUsingBloodPotionFEMALE

Endif

Player.CastImmediateOnSelf BloodPotion

Player.RemoveItem BloodPotion 1

Endif

Endif

END

Edited by dudeapocalypse
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...