Jump to content

Difficulty having an Aid item be returned if it's not used.


Manan6619

Recommended Posts

I'm trying to make an addition to a mod that adds a sort of faction disguise for robots. The idea was to add an Aid item that works similarly to faction disguises, but it "breaks" when its duration expires and removes you from the factions. So, I made my ingestible and a scripted base effect for it, and so far the disguise bit seems to work as I expected. However, I've tried to add some failsafe conditions that a) prevent you from using the ingestible version if you already have the permanent one equipped and b) prevent the ingestible's script from breaking your disguise if you happen to equip the wearable disguise after using the ingestible one.

 

The "a" bit doesn't appear to work properly, only triggering once upon the first consumption of the item, then ceasing to work any consecutive times until its 90-second effect duration expires.

The script in question:

 

scn MananRobotIFFScript

Begin ScriptEffectStart
   if Player.getEquipped aaRobotIFF == 0 ;effects to take place if the player doesn't have the permanent variant equipped
         ShowMessage MananRobotIFFTempActiveMessage
         Player.AddToFaction RobotFaction 0
         Player.AddToFaction RobcoRobots 0
   else ;SHOULD tell the player they're already using the permanent variant and return the Aid item they're trying to expend, but only works on the first try. Doesn't work again until the effect wears off.
         ShowMessage MananRobotIFFAlreadyActiveMessage
         Player.addItem MananRobotIFFTemp 1 1
   endif
End

Begin ScriptEffectFinish
   if Player.getEquipped aaRobotIFF == 0 ;removes the player from the robot factions, but ensures that if the player uses the temporary variant and then equips the permanent one, they aren't removed from the factions afterwards since the apparel is still equipped
      ShowMessage MananRobotIFFTempInactiveMessage
      Player.RemoveFromFaction RobotFaction
      Player.RemoveFromFaction RobcoRobots
   endif
End

 

 

My best guess was to have the "else" section of the script dispel the base effect, but base effects can't be dispelled (that I know of?).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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