Jump to content

Script Help


DarthJay

Recommended Posts

Hey guys I have a problem I have a script that changes a global variable upon the effect finishing. But when the effect finishes the variable stays the same. Can anyone tell me what to add to make the Global variable reset lets say after 4 or 5 hours of game time. If anyone can help it would be appreciated.

This is the Script:

 

Scriptname test365 extends Activemagiceffect

 

GlobalVariable Property ActiveVar auto

Weather Property ActiveWeather Auto

 

Event OnEffectFinish (Actor akTarget, Actor akCaster)

ActiveWeather.SetActive(true)

ActiveVar.SetValue(1)

Endevent

 

I tried adding:

Game.GetRealHoursPlayed()

if Game.GetRealHoursPlayed() == 5

ActiveVar.SetValue(0)

Endif

 

But nothing happened maybe because it was in the same event.

Link to comment
Share on other sites

1) About GlobalVariable: try this

 

 ActiveVar.SetValue(1.0)

or

 

 ActiveVar.SetValueInt(1)

or make sure you have right GlobalVar attached in properties

 

2) About time: try to use this function instead:

 

someFloat = Utility.GetCurrentGameTime()

it returns the current game time in terms of "game days passed", 1.000000 = 24 hours

 

3) Please clarify when exactly you want to make reset? After certain/random period of time or "OnEffectFinished"?

Edited by SSSl4Yer
Link to comment
Share on other sites

  • Recently Browsing   0 members

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