leetfart Posted August 4, 2012 Share Posted August 4, 2012 My knowledge of scripting with the Creation Kit is poor and I was wondering if there was a way to make the player and monsters start dying while inside a trigger box. It will probaly be easier to explain what I am trying to achieve exactly. For a mod I am currently creating I want there to be specific areas where the player takes health damage until out of that zone. For example if there was two rooms and a corridor linking those rooms together, while travelling down that corridor you start slowly losing health until you are out of that corridor. How I picture it is that you would add a trigger box and fit it to that corridor, once that player has entered the trigger box area the effects of health going down start to take place until you get out of it. I would also like to know how to disable the trigger box when an activator has been used such as a lever. While I am on the topic of levers I would also like to know how to use levers to enable objects that were initially disabled and how to unlock doors without the key. The enabling part I dont know at all but when I link the lever to a door that requires a key I would have thought the lever would remove the "requires key" just to a normal "open". Sorry if it seems a bit much to ask and if it is all confusing but really I have no clue where to start here and I would like the know how to make these things above happen to make my desired mod work, thanks! Link to comment Share on other sites More sharing options...
gasti89 Posted August 4, 2012 Share Posted August 4, 2012 (edited) The best way to reach your purpose is by creating a magic effect and adding it to an "ability" spell. Just copy a random disease with the health degen you want. Then put a trigger in the place you want and attach this script: Spell property mySpell auto Event OnTriggerEnter(ObjectReference akActionRef) akActionRef.AddSpell(mySpell, false) EndEvent Event OnTriggerLeave(ObjectReference akActionRef) if akActionRef.HasSpell(mySpell) akActionRef.RemoveSpell(mySpell) endif EndEvent To disable the trigger when activating a lever, you have to choice: put a script on the activator, or put another script on the trigger and set to as the "activate child" to the activator. 1st way- Put this script on the activator ObjectReference property myTrigger auto Event OnActivate(ObjectReference akActionRef) myTrigger.Disable() EndEvent 2nd way- put a script on the trigger. Search "defaulttoggleselfonactivate". add it. Then double sclick on the trigger, go to "activate parents", new, select the activator. Do the same ways for every objects you want to toggle (just replace Disable() with Enable() if you choose the 1st way). As for the needed key, i don't know. Edited August 4, 2012 by gasti89 Link to comment Share on other sites More sharing options...
leetfart Posted August 4, 2012 Author Share Posted August 4, 2012 The best way to reach your purpose is by creating a magic effect and adding it to an "ability" spell. Just copy a random disease with the health degen you want. Then put a trigger in the place you want and attach this script: Spell property mySpell auto Event OnTriggerEnter(ObjectReference akActionRef) akActionRef.AddSpell(mySpell, false) EndEvent Event OnTriggerLeave(ObjectReference akActionRef) if akActionRef.HasSpell(mySpell) akActionRef.RemoveSpell(mySpell) endif EndEvent To disable the trigger when activating a lever, you have to choice: put a script on the activator, or put another script on the trigger and set to as the "activate child" to the activator. 1st way- Put this script on the activator ObjectReference property myTrigger auto Event OnActivate(ObjectReference akActionRef) myTrigger.Disable() EndEvent 2nd way- put a script on the trigger. Search "defaulttoggleselfonactivate". add it. Then double sclick on the trigger, go to "activate parents", new, select the activator. Do the same ways for every objects you want to toggle (just replace Disable() with Enable() if you choose the 1st way). As for the needed key, i don't know. Thanks for all the help there!! :) The key thing isn't much of a big thing I wanted to add compared to the triggers, thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts