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
[SIMPLE] Variables
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
[SIMPLE] Variables

Ok, so I'm having a little trouble with some variable-scripts, that I haven't tried before. It looks like this:

void WoodCreakStart(string &in asParent, string &in asChild, int alState)
{
AddTimer("WoodCreakStart", 5, "WoodCreak");
}

void WoodCreak(string &in asTimer)
{
if(asTimer == "WoodCreakStart")
{
StartScreenShake(0.03f, 5.0f, 2.0f, 2.0f);
PlaySoundAtEntity("Creak", "00_creak.snt", "Player", 2.0f, false);
AddTimer("Creak_1", 0.5f, "WoodCreak");
}

if(asTimer == "Creak_1")
{
if(GetLocalVarInt("CreakVar") < 7)
{
CreateParticleSystemAtEntity("CreakDust_"+CreakVar, "ps_dust_drilling.ps", "WoodCreakParticle_"+CreakVar, false);
AddLocalVarInt("CreakVar", 1);
AddTimer("Creak_1", 0.1f, "WoodCreak");
}
}
}

Simply, what happens is that when I enter the area, dust should be drilling from each 6 areas once.
But it should happen like this:
Dust from area1
Wait 0.1 seconds
Dust from area2
Wait 0.1 seconds

and so on

This is where i have the trouble:

if(asTimer == "Creak_1")
{
if(GetLocalVarInt("CreakVar") < 7)
{
CreateParticleSystemAtEntity("CreakDust_"+CreakVar, "ps_dust_drilling.ps", "WoodCreakParticle_"+CreakVar, false);
AddLocalVarInt("CreakVar", 1);
AddTimer("Creak_1", 0.1f, "WoodCreak");
}
}

It says CreakVar is not declared... but should it be, when i use it like +CreakVar?

Trying is the first step to success.
(This post was last modified: 03-12-2013, 05:17 PM by FlawlessHappiness.)
03-12-2013, 04:30 PM
Find


Messages In This Thread
[SIMPLE] Variables - by FlawlessHappiness - 03-12-2013, 04:30 PM
RE: [SIMPLE] Variables - by Adrianis - 03-12-2013, 05:07 PM
RE: [SIMPLE] Variables - by FlawlessHappiness - 03-12-2013, 05:17 PM



Users browsing this thread: 1 Guest(s)