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
narutohokager Offline
Member

Posts: 149
Threads: 28
Joined: Jan 2011
Reputation: 0
#2
RE: Random or Looping

For RandomFloat I do not know... We should be able to put a name and then use GetLocalVarFloat.
But to use the loops, for all my scripts, I do like her :

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("", 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);
AddTimer("", 0.40f, "flashesOff");
}
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);
AddTimer("", 0.65f, "flashesOn2");
}
  void flashesOn2(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);
AddTimer("", 0.40f, "flashesOff2");
}
  void flashesOff2(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);
AddTimer("", 0.01f, "flashesOn");
}
In short: At start, he play FlashLightOn, after, FlashLightOff, after, FlashLightOn2, after, FlashLightOff2, And here, his back to the first FlashLightOn, Normally it will play forever Wink
Modifies or adds FlashLightOn / Off to vary the timer





Sorry for my bad english
Amnesia The Revenge - Chapter 1
04-27-2012, 10:02 PM
Website 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: 2 Guest(s)