Jump to content

Gender Scripting


GowF3nv

Recommended Posts

So I am attempting to write some scripts for my mod. The first is to disable a collision marker for either males or females with a single trigger box. Should I re-write my script, or figure some other way to trigger it?

 

scn GenderTrigger

 

Begin OnTriggerEnter player

 

if GetIsSex Male

 

CMM.disable

 

elseif GetIsSex Female

 

CMF.disable

 

endif

 

End

 

My second script is simply to give a message based of your gender in game. Step into a trigger box, and the message should appear. Niether are. I am using a seperate trigger for each message.

 

scn GirlMessageScript

 

Begin OnTriggerEnter player

 

if GetIsSex Female

 

ShowMessage GirlMessage

 

endif

 

End

 

Thanks in advance

Edited by GowF3nv
Link to comment
Share on other sites

You didn't really specify what the problem was with your first script, you only asked if you should rewrite or find a new way. To answer that I would need to know what the problem is. But I can guess.

 

Nothing wrong with the logic, you just missed adding a reference for the GetIsSex function. Try these:

scn GenderTrigger

Begin OnTriggerEnter player

     if player.GetIsSex Male
          CMM.disable
     else
          CMF.disable   ;You don't need the elseif becasue you already know if it's not a male, it's a female
     endif

End

Of course, CMM and CMF must be the Ref IDs of your collision markers and they must be persistent.

scn GirlMessageScript

Begin OnTriggerEnter player

     if Player.GetIsSex Female
          ShowMessage GirlMessage
     endif

End
Link to comment
Share on other sites

Thanks pkleiss, the one for displaying a message worked as it should. But the other one decided both collision markers would still be disabled at the same time. That was the problem before. Both CMM and CMF are checked for persistant reference.

Link to comment
Share on other sites

Try setting one marker as the enable parent of the other, but set the "opposite" flag. That way you only have to enable/disable the parent and the child will automatically take on the opposite effect.

 

However, the script I gave you should also work, which makes me think something else is going on.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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