Jump to content

[LE] Change weather trigger box


MesaSolar

Recommended Posts

I'm trying to use a trigger box to change the weather for the player in certain areas. But can't get it to work. Appreciate any help. Followed this tutorial:

 

https://www.youtube.com/watch?v=X59AoDW0-yk

 

and here's my script:

 

Scriptname APWWeatherBlizScript
Weather Property APWStormSnow Auto
Event OntriggerEnter(objectreference akactionref)
if akactionref == game.getplayer()
APWStormSnow.SetActive()
endif
EndEvent
Event OntriggerLeave(objectreference akactionref)
if akactionref == game.getplayer()
APWStormSnow.SetActive(false)
endif
EndEvent
Link to comment
Share on other sites

Looks like I got it to start by adding "extends objectreference" to the top line. So it starts the weather upon

entering the trigger, but the weather continues after leaving the trigger instead of reverting back to the vanilla.

 

How do I fix this?

Link to comment
Share on other sites

Using SetActive(False) actually sets the weather active again. The False Parameter says whether the weather is overriding or not. Instead do this:

 

Weather Property APWStormSnow Auto

Event OntriggerEnter(objectreference akactionref)
    if akactionref == game.getplayer()
        APWStormSnow.SetActive(True) ;overrides weather
    endif
EndEvent

Event OntriggerLeave(objectreference akactionref)
    if akactionref == game.getplayer()
        Weather.ReleaseOverride() ;release override
    endif
EndEvent
Link to comment
Share on other sites

 

Using SetActive(False) actually sets the weather active again. The False Parameter says whether the weather is overriding or not. Instead do this:

 

Weather Property APWStormSnow Auto

Event OntriggerEnter(objectreference akactionref)
    if akactionref == game.getplayer()
        APWStormSnow.SetActive(True) ;overrides weather
    endif
EndEvent

Event OntriggerLeave(objectreference akactionref)
    if akactionref == game.getplayer()
        Weather.ReleaseOverride() ;release override
    endif
EndEvent

 

Thanks so much! Worked perfectly.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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