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
Script Help Basic Light change wont work... please help
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#2
RE: Basic Light change wont work... please help

Your AddEntityCollideCallback has no spaces between the commas and the abDeleteOnCollide and alStates are missing. Your callback syntax is wrong too and should be void TurnOffLight(string &in asParent, string &in asChild, int alState) Check this out:

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
alState: 1 = enter, -1 = leave
asParentName - internal name of main object
asChildName - internal name of object that collides with main object (asterix (*) NOT supported!)
asFunction - function to call
abDeleteOnCollide - determines whether the callback after it was called
alStates - 1 = only enter, -1 = only leave, 0 = both

-----------------
In your case with the lamp, you should use:
SetLampLit(string& asName, bool abLit, bool abEffects); in stead of
SetLightVisible(string& asLightName, bool abVisible); , (there is a difference between lamps and lights) do not forget to put in your lights internal name at "string& asName".
-----------------
Change all the red stuff:

void OnStart()
{
AddEntityCollideCallback("Player", "Script_area_name", "Function_to_call", true, 1);
AddDebugMessage("OnStart!", false);
}

void OnEnter()
{
AddDebugMessage("OnEnter!", false);
}

void OnLeave()
{
AddDebugMessage("OnLeave!", false);
}

void TurnOffLight(string &in asParent, string &in asChild, int alState)
{
SetLampLit("Name_of_your_lamp", false, false);
}
----------
I have not checked if this works, if it does not, make a comment Rolleyes
(This post was last modified: 03-29-2012, 08:53 PM by Mackiiboy.)
03-29-2012, 08:44 PM
Website Find


Messages In This Thread
RE: Basic Light change wont work... please help - by Mackiiboy - 03-29-2012, 08:44 PM



Users browsing this thread: 1 Guest(s)