Frictional Games Forum (read-only)
Cant be void? Script Help! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Cant be void? Script Help! (/thread-12865.html)



Cant be void? Script Help! - Loveridge - 01-25-2012



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

}



RE: Cant be void? Script Help! - Statyk - 01-25-2012

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.


RE: Cant be void? Script Help! - Your Computer - 01-25-2012

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.


RE: Cant be void? Script Help! - Loveridge - 01-25-2012

Now it says expected ")" or ";" Sad


RE: Cant be void? Script Help! - Statyk - 01-25-2012

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

}



RE: Cant be void? Script Help! - Loveridge - 01-25-2012

(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...


RE: Cant be void? Script Help! - Statyk - 01-25-2012

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

}