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 Script problem
ooadrianoo Offline
Member

Posts: 82
Threads: 29
Joined: Apr 2012
Reputation: 0
#1
Script problem

Hello I have a problem. My script doesn't work.

PHP Code: (Select All)
void OnEnter ()
{

AddTimer("Random"RandFloat(2.0f,4.0f), "TimerRandom");
}

void TimerRandom(string&in asTimer)
{
int iRandoms RandFloat(1,7);
    if (
iRandoms 6){
    
    
SetPlayerActive(false); //Checks whether this part works
    
    
SetPlayerRunSpeedMul(RandFloat(0.6f,0.8f));
    
SetPlayerMoveSpeedMul(RandFloat(0.8f,0.9f));
    
FadePlayerFOVMulTo(RandFloat(1.1f,1.3f), 3);
    
FadeImageTrailTo(RandFloat(0.3f0.6f),3);
    
AddTimer("RandomLoop"RandFloat(5.0f,7.0f), "TimerRandom");
    
AddTimer("fadein"5"fadeintimer");
    
    }
    
    else if(
iRandoms == or iRandoms == 5)
    {
    
StartEffectFlash(115);//Checks whether this part works
    
    
SetPlayerRunSpeedMul(0.65f);
    
SetPlayerMoveSpeedMul(0.7f);
    
FadePlayerFOVMulTo(13);
    
FadeImageTrailTo(RandFloat(0.8f,1.0f), RandFloat(3.0f,5.0f));
    
PlaySoundAtEntity("breath_slow""react_breath_slow.snt""Player"RandFloat(0.8f,1.0f), false);
    
    
AddTimer("RandomLoop"RandFloat(4.0f,6.0f), "TimerRandom");
    }
    


This part of my script and I don't know why. Can anyone help me?
11-02-2012, 08:50 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Script problem

this: (string&in asTimer)


Should be: (string &in asTimer)

Trying is the first step to success.
(This post was last modified: 11-02-2012, 09:14 PM by FlawlessHappiness.)
11-02-2012, 09:00 PM
Find
ooadrianoo Offline
Member

Posts: 82
Threads: 29
Joined: Apr 2012
Reputation: 0
#3
RE: Script problem

(11-02-2012, 09:00 PM)beecake Wrote: this: (string&in asTimer)
Nothing changed. Still the same problem ._.
(This post was last modified: 11-02-2012, 09:08 PM by ooadrianoo.)
11-02-2012, 09:08 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Script problem

I would assume that the value is never the ones in the if statement

Tutorials: From Noob to Pro
(This post was last modified: 11-02-2012, 09:13 PM by Your Computer.)
11-02-2012, 09:13 PM
Website Find
ooadrianoo Offline
Member

Posts: 82
Threads: 29
Joined: Apr 2012
Reputation: 0
#5
RE: Script problem

(11-02-2012, 09:13 PM)Your Computer Wrote: I would assume that the value is never the ones in the if statement
Explain me why.
11-02-2012, 09:24 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Script problem

(11-02-2012, 09:24 PM)ooadrianoo Wrote: Explain me why.

It's not that it can't be, but that every time you've tested it the value was either 1, 3, 4 or 6. Perhaps i should have said "was" instead of "is."

Tutorials: From Noob to Pro
(This post was last modified: 11-02-2012, 09:34 PM by Your Computer.)
11-02-2012, 09:34 PM
Website Find
ooadrianoo Offline
Member

Posts: 82
Threads: 29
Joined: Apr 2012
Reputation: 0
#7
RE: Script problem

It works if I make it so:
PHP Code: (Select All)
if (iRandoms 4
and
PHP Code: (Select All)
else if(iRandoms 4

But I don't understand why it works this way.
11-02-2012, 09:36 PM
Find
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#8
RE: Script problem

(11-02-2012, 09:24 PM)ooadrianoo Wrote: Explain me why.
Because you make the iRandoms random from 1 to 7.
In your first "if" it checks if it's bigger than 6
and in your "else if" you check if the iRandoms is equal to 2 or 5
So if the
iRandoms is 1,3,4,6 the script will do nothing.

[Image: 2H1Mc.jpg]
11-02-2012, 09:39 PM
Find
ooadrianoo Offline
Member

Posts: 82
Threads: 29
Joined: Apr 2012
Reputation: 0
#9
RE: Script problem

(11-02-2012, 09:39 PM)ZodiaC Wrote:
(11-02-2012, 09:24 PM)ooadrianoo Wrote: Explain me why.
Because you make the iRandoms random from 1 to 7.
In your first "if" it checks if it's bigger than 6
and in your "else if" you check if the iRandoms is equal to 2 or 5
So if the
iRandoms is 1,3,4,6 the script will do nothing.
Thank you
11-02-2012, 09:51 PM
Find
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#10
RE: Script problem

(11-02-2012, 09:51 PM)ooadrianoo Wrote:
(11-02-2012, 09:39 PM)ZodiaC Wrote:
(11-02-2012, 09:24 PM)ooadrianoo Wrote: Explain me why.
Because you make the iRandoms random from 1 to 7.
In your first "if" it checks if it's bigger than 6
and in your "else if" you check if the iRandoms is equal to 2 or 5
So if the
iRandoms is 1,3,4,6 the script will do nothing.
Thank you
Your Welcome Wink

[Image: 2H1Mc.jpg]
11-02-2012, 09:53 PM
Find




Users browsing this thread: 1 Guest(s)