15gudasc Posted June 27, 2012 Posted June 27, 2012 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
viennacalling Posted June 27, 2012 Posted June 27, 2012 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.
15gudasc Posted June 28, 2012 Author Posted June 28, 2012 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! =)
CarnivalOfFear Posted June 28, 2012 Posted June 28, 2012 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 ==
CarnivalOfFear Posted June 28, 2012 Posted June 28, 2012 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.
15gudasc Posted June 28, 2012 Author Posted June 28, 2012 So here's what the script looks like now.... scn thunderscript short time Begin Gamemodeset time to GetCurrentTime if time > 6.0 THUNDER01.disableshowmessage successfulscriptendif if time > 22.0THUNDER01.enableshowmessage successfulscriptendif But it still doesn't want to work! Any thoughts?END
pluramon Posted June 29, 2012 Posted June 29, 2012 (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 June 29, 2012 by pluramon
15gudasc Posted June 30, 2012 Author Posted June 30, 2012 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!
15gudasc Posted June 30, 2012 Author Posted June 30, 2012 Well it's still not working, but it's probably just something I did! Hopefully I'll find it out.
Recommended Posts