Jump to content

Bath Mod, Making a Spell work on TriggerBox


aluckymuse

Recommended Posts

Ok, first I am a scripting noob. Now that we have that out of the way I have been staring at various vanilla scripts in the hopes to learn enough to build my own bath script. The goal is for the player to enter the triggerbox and then a spell (with a set duration) be cast on them. From the player end it will look like they get in the water and a message appears that they've cleaned themselves and when looking at their active effects they'll see the spell that was cast on them.

 

Here's what I've got so far:

Scriptname DBBathScript extends ObjectReference  

Spell Property DBBathSpell Auto


Event OnTriggerEnter (ObjectReference ActionRef)

If ActionRef == Game.GetPlayer()

(DBBathSpell).InTrigger =1
DBBathText.Show()

endif

EndEvent



Event OnTriggerLeave (ObjectReference ActionRef)

If ActionRef == Game.GetPlayer()

(DBBathSpell).InTrigger =0

endif



EndEvent



Message Property DBBathText  Auto 

 

It won't compile, and gives me these debug messages:

(10,15) InTrigger is not a property on script spell or one of it's parents

(10, 14) type mismatch while assigning to a none (cast missing or types unrelated)

(22,15) InTrigger is not a property on script spell or one of it's parents

(22,14) type mismatch while assigning to a none (cast missing or types unrelated)

 

 

I feel like I'm so CLOSE! But I just lack the necessary know-how to fix this....Someone please help...I'm trying really hard but there's nothing that I've found on google and trial and error only get you so far when there is so many variables.

Link to comment
Share on other sites

When it comes to Papyrus, I'm also a scripting noob, so I'm not sure if this will work for your purpose, but it compiles:

 

 

Scriptname DBBathScript extends ObjectReference

Spell Property DBBathSpell Auto


Event OnTriggerEnter (ObjectReference akActionRef)
If akActionRef == Game.GetPlayer()

       DBBathSpell.Cast(self, aktarget = Game.GetPlayer())
       Debug.Notification("You are clean now!")

endif
EndEvent



Event OnTriggerLeave (ObjectReference akActionRef)
If akActionRef == Game.GetPlayer()
	;do what?
endif
EndEvent

 

The script will be placed on the trigger. The property has to be filled with your spell.

 

I'm also not sure what the script is supposed to do, when the player leaves the trigger, so I left that for now...

Link to comment
Share on other sites

When it comes to Papyrus, I'm also a scripting noob, so I'm not sure if this will work for your purpose, but it compiles:

 

 

Scriptname DBBathScript extends ObjectReference

Spell Property DBBathSpell Auto


Event OnTriggerEnter (ObjectReference akActionRef)
If akActionRef == Game.GetPlayer()

       DBBathSpell.Cast(self, aktarget = Game.GetPlayer())
       Debug.Notification("You are clean now!")

endif
EndEvent



Event OnTriggerLeave (ObjectReference akActionRef)
If akActionRef == Game.GetPlayer()
	;do what?
endif
EndEvent

 

The script will be placed on the trigger. The property has to be filled with your spell.

 

I'm also not sure what the script is supposed to do, when the player leaves the trigger, so I left that for now...

 

Brilliant! I'll start experimenting with that tomorrow....errr...later on today...after some sleep lol.

Well as far as I can tell it shouldn't do anything after leaving the trigger? The spell has a set duration that will eventually wear off and the player will have to "bathe" again to get it back....so does the Event OnTriggerLeave just remain blank?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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