Jump to content

Recommended Posts

Posted

Hey everyone!

 

So this script is supposed to disable a reference called "thunder" at 6:00 A.M. and enable it at 10:00 P.M., but it doesn't want to save.

 

scn thunderscript

 

short time

 

set time to GetCurrentTime

 

Begin Gamemode

 

if time == 18

THUNDER01ref.disable

endif

 

if time == 22

THUNDER01ref.enable

endif

 

END

Posted

The error is that "set time to GetCurrentTime" should be inside the game mode block.

 

The variable time should probably be a float instead of a short, but you'll have to check if that is an issue in-game.

Posted
Thanks! It got the script to save, but it still doesn't work in game yet. I probably just did something wrong with the numbers or something! But thanks anyways! =)
Posted
  On 6/28/2012 at 1:09 AM, 15gudasc said:

Thanks! It got the script to save, but it still doesn't work in game yet. I probably just did something wrong with the numbers or something! But thanks anyways! =)

use less than or greater than signs rather than ==

Posted
  On 6/28/2012 at 1:09 AM, 15gudasc said:

Thanks! It got the script to save, but it still doesn't work in game yet. I probably just did something wrong with the numbers or something! But thanks anyways! =)

use less than or greater than signs rather than == because if you start the game and its 23:00 its not 22.

Posted

So here's what the script looks like now....

 

scn thunderscript

 

short time

 

Begin Gamemode

set time to GetCurrentTime

 

if time > 6.0

THUNDER01.disable

showmessage successfulscript

endif

 

if time > 22.0

THUNDER01.enable

showmessage successfulscript

endif

 

 

But it still doesn't want to work! Any thoughts?

END

Posted (edited)

1. By what way are you calling this script (quest/token object)?

2. Did you add 'THUNDER01ref' to a world-space cell? Did you set it to persistent reference? Objects that do not exist in the world-space, or do not have a unique editor ID/parent cannot be enabled/disabled.

 

The script should look something like this:

scn thunderscript

Begin Gamemode

    if (GetCurrentTime > 6) && (GetCurrentTime < 22)
         if THUNDER01ref.GetDisabled == 0
              THUNDER01ref.Disable
         endif
    elseif THUNDER01ref.GetDisabled
         THUNDER01ref.Enable
    endif

end

Edited by pluramon
Posted

I have it as an "Object" type script, if thats what your asking.

 

I'm about to try the script you wrote in game so hopefully it works!

  • Recently Browsing   0 members

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