Jump to content

Need help with GetFormFromFile


Robinsage

Recommended Posts

I've been banging my head into a wall with the above named script all day and need to turn to my beloved community for help. I've put what seems to be good code together but it's not working.

 

Here is the relevant part of it, shortened to 4 weathers for brevity. Basically it looks for another mod's weather and tries to change it to another one.

 

Does anyone see anything I'm doing wrong here? Thanks for any help.

 

 

Scriptname WeatherChangeScript extends ObjectReference  

import game
import utility

Actor Property PlayerREF Auto
Globalvariable Property IsSheltered Auto
objectreference property rainsoundfx1 Auto

Weather Property CurrentWeather Auto

Weather Property ModRainNP1 Auto
Weather Property ModRainNP2 Auto
Weather Property ModRainNP3 Auto
Weather Property ModRainNP4 Auto

Event OnTriggerEnter(ObjectReference akActionRef)
  If akActionRef == PlayerREF
        IsSheltered.setvalue(1)
        CurrentWeather = Weather.GetCurrentWeather()
        Weather ModRain01 = Game.GetFormFromFile(0x00012345, "OtherMod.esm") as Weather
        Weather ModRain02 = Game.GetFormFromFile(0x00023456, "OtherMod.esm") as Weather
        Weather ModRain03 = Game.GetFormFromFile(0x00034567, "OtherMod.esm") as Weather
        Weather ModRain04 = Game.GetFormFromFile(0x00045678, "OtherMod.esm") as Weather
        Weather WeatherNow = Weather.GetCurrentWeather()
        If WeatherNow == ModRain01
          rainsoundfx1.Enable()
          ModRainNP1.ForceActive(True)
        ElseIf WeatherNow == ModRain02
          rainsoundfx1.Enable()
          ModRainNP2.ForceActive(True)
        ElseIf WeatherNow == ModRain03
          rainsoundfx1.Enable()
          ModRainNP3.ForceActive(True)
        ElseIf WeatherNow == ModRain04
          rainsoundfx1.Enable()
          ModRainNP4.ForceActive(True)
        EndIf
  EndIf
EndEvent

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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