Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
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 |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
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 |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
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.
|
|
01-25-2012, 10:17 PM |
|
Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
RE: Cant be void? Script Help!
Now it says expected ")" or ";"
|
|
01-25-2012, 10:47 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: Cant be void? Script Help!
(01-25-2012, 10:47 PM)Loveridge Wrote: Now it says expected ")" or ";" 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 |
|
Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
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 ";" 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 |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
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 |
|
|