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
Cant be void? Script Help!
Loveridge Offline
Junior Member

Posts: 21
Threads: 8
Joined: Nov 2011
Reputation: 0
#1
Cant be void? Script Help!



void OnStart()
{
AddEntityCollideCallback("Player", "lighttrigger", "lighton", true, 1);
}

void OnEnter()
{

}

void lighton(string& lighton, bool true, bool true);

Apparently this cant be allowed as it cant be void? Its the script for my second map in a custom story


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
01-25-2012, 09:45 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Cant be void? Script Help!

I advise you to look at other custom stories' script and compare to your own. But for now, your .hps should look like this:

void OnStart()
{
AddEntityCollideCallback("Player", "lighttrigger", "lighton", true, 1);
}

void lighton(string in asParent, string &in asChild, int alState)
{
SetLampLit("INTERNAL_LAMP_NAME", true, true);

////////////////////////////
// Run when leaving map
void OnLeave()
{

}



////////////////////////////
// Run when entering map
void OnEnter()
{

}



______________________________________________

It was saying it can't be void because the syntax you put in does not exist.
(This post was last modified: 01-25-2012, 09:50 PM by Statyk.)
01-25-2012, 09:49 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Cant be void? Script Help!

It's not that it can't be void, it's that you pretty much tried to define and call the function at the same time.

Tutorials: From Noob to Pro
01-25-2012, 10:17 PM
Website Find
Loveridge Offline
Junior Member

Posts: 21
Threads: 8
Joined: Nov 2011
Reputation: 0
#4
RE: Cant be void? Script Help!

Now it says expected ")" or ";" Sad
01-25-2012, 10:47 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#5
RE: Cant be void? Script Help!

(01-25-2012, 10:47 PM)Loveridge Wrote: Now it says expected ")" or ";" Sad
whoops, I missed a "}"... here:


void OnStart()
{
AddEntityCollideCallback("Player", "lighttrigger", "lighton", true, 1);
}

void lighton(string in asParent, string &in asChild, int alState)
{
SetLampLit("INTERNAL_LAMP_NAME", true, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}



////////////////////////////
// Run when entering map
void OnEnter()
{

}
01-25-2012, 10:55 PM
Find
Loveridge Offline
Junior Member

Posts: 21
Threads: 8
Joined: Nov 2011
Reputation: 0
#6
RE: Cant be void? Script Help!

(01-25-2012, 10:55 PM)Statyk Wrote:
(01-25-2012, 10:47 PM)Loveridge Wrote: Now it says expected ")" or ";" Sad
whoops, I missed a "}"... here:


void OnStart()
{
AddEntityCollideCallback("Player", "lighttrigger", "lighton", true, 1);
}

void lighton(string in asParent, string &in asChild, int alState)
{
SetLampLit("INTERNAL_LAMP_NAME", true, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}



////////////////////////////
// Run when entering map
void OnEnter()
{

}
Still says it...
01-25-2012, 11:01 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#7
RE: Cant be void? Script Help!

missed another thing....



void OnStart()
{
AddEntityCollideCallback("Player", "lighttrigger", "lighton", true, 1);
}

void lighton(string &in asParent, string &in asChild, int alState)
{
SetLampLit("INTERNAL_LAMP_NAME", true, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}



////////////////////////////
// Run when entering map
void OnEnter()
{

}
(This post was last modified: 01-25-2012, 11:10 PM by Statyk.)
01-25-2012, 11:10 PM
Find




Users browsing this thread: 1 Guest(s)