Frictional Games Forum (read-only)

Full Version: Cant be void? Script Help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.


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()
{

}
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.
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.
Now it says expected ")" or ";" Sad
(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)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...
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()
{

}