Frictional Games Forum (read-only)
Script error (Again) - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: SOMA (https://www.frictionalgames.com/forum/forum-55.html)
+--- Forum: User created content (https://www.frictionalgames.com/forum/forum-79.html)
+---- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-80.html)
+---- Thread: Script error (Again) (/thread-50843.html)

Pages: 1 2 3


RE: Script error (Again) - Venom Fox - 07-10-2016

One more thing (If anyone's still around)

I put a button in my map that should light all the lights in a hallway.
The button is the button_red_glow_1 one. I added this to the connectionstatechangecallback thing in the map editor : button_glow_moving_1_OnConnectionStateChange

and I added this to my script file:

void button_glow_moving_1_OnConnectionStateChange(const tString &in asEntity, int alState)
{
if (alState==1)
{
Lamp_SetLit("ceiling_large_robot_3",
true,
true);
Lamp_SetLit("ceiling_large_robot_2",
true,
true);
Lamp_SetLit("ceiling_large_robot_1",
true,
true);
Lamp_SetLit("ceiling_large_robot_4",
true,
true);

}
else
{
Lamp_SetLit("ceiling_large_robot_3",
false,
true);
Lamp_SetLit("ceiling_large_robot_2",
false,
true);
Lamp_SetLit("ceiling_large_robot_1",
false,
true);
Lamp_SetLit("ceiling_large_robot_4",
false,
true);



}
return true;
}

I get this error : Can't return value when return type is void.
Anyone knows what this means? Or see anything wrong with my script? :S

Edit: Also, another error: could not find method void button_glow_moving_1...

Edit 2: Nevermind, got it solved!


RE: Script error (Again) - Venom Fox - 07-10-2016

What I'd like to know is that why whenever I add a function, I get this error :

error : Could not find method 'void [my func's name here] in object '01_office_area_1'

anyone familiar with this error? Happens literally every single time I try to add a function..