The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Random or Looping
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#1
Question  Random or Looping

Ive just created lightning for my custom story, now all I need to do is get it to repeat randomly....which I do not know how to do. I'm guessing it could be "RandFloat" but I have not a clue how to implement it. here's the script to the lightning. How would you implement random OR EVEN Looping in this script?




void OnStart()
{
PreloadSound("general_thunder.snt");
SetSkyBoxActive(true);
SetSkyBoxColor(0.05, 0.05, 0.10, 1);
SetLightVisible("SpotLight_1", false);
SetLightVisible("SpotLight_2", false);
SetLightVisible("SpotLight_3", false);
SetLightVisible("SpotLight_4", false);
SetLightVisible("SpotLight_5", false);
SetLightVisible("SpotLight_6", false);
AddTimer("", 3.0f, "flashes");
}
//The many flashes that makes up the lightning. all triggered with "flashes"
void flashes(string &in asTimer)
{
AddTimer("", 0.01f, "flashesOn");
AddTimer("", 0.40f, "flashesOff");
AddTimer("", 0.45f, "flashesOn");
AddTimer("", 0.50f, "flashesOff");
AddTimer("", 0.63f, "flashesOn");
AddTimer("", 0.67f, "flashesOff");
AddTimer("", 0.70f, "flashesOn");
AddTimer("", 0.90f, "flashesOff");
AddTimer("", 1.10f, "Thunder");
}
void Thunder(string &in asTimer)
{
PlayGuiSound("general_thunder.snt" , 1.0f);
}
void flashesOn(string &in asTimer)
{
SetLightVisible("SpotLight_1", true);
SetLightVisible("SpotLight_2", true);
SetLightVisible("SpotLight_3", true);
SetLightVisible("SpotLight_4", true);
SetLightVisible("SpotLight_5", true);
SetLightVisible("SpotLight_6", true);
SetSkyBoxColor(0.5, 0.5, 0.6, 1);
}
void flashesOff(string &in asTimer)
{
SetLightVisible("SpotLight_1", false);
SetLightVisible("SpotLight_2", false);
SetLightVisible("SpotLight_3", false);
SetLightVisible("SpotLight_4", false);
SetLightVisible("SpotLight_5", false);
SetLightVisible("SpotLight_6", false);
SetSkyBoxColor(0.05, 0.05, 0.10, 1);
}
04-27-2012, 09:43 PM
Find


Messages In This Thread
Random or Looping - by lllDash - 04-27-2012, 09:43 PM
RE: Random or Looping - by narutohokager - 04-27-2012, 10:02 PM
RE: Random or Looping - by lllDash - 04-27-2012, 11:10 PM
RE: Random or Looping - by narutohokager - 04-28-2012, 12:23 AM



Users browsing this thread: 1 Guest(s)