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
Gandalf's scripting questions thread
gandalf91 Offline
Senior Member

Posts: 439
Threads: 13
Joined: Feb 2011
Reputation: 0
#9
RE: Gandalf's scripting questions thread

Thanks. Smile I had just kept using "add" instead of "set", but I've corrected it now. Impulse script on a door now is frustrating me though!

In the void Onstart() section I have these callback functions listed:

AddEntityCollideCallback("Player", "ScriptArea_3", "Candlelight1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Candlelight2", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "Candlelight3", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_6", "Candlelight4", true, 1);

Then further down in my script I have:

void Candlelight1(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle_floor_1", true, true);
SetLampLit("candle_floor_2", true, true);
AddPropImpulse("prison_section_1", 0.0f, 0.0f, 0.2f, false);
}

void Candlelight2(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle_floor_3", true, true);
SetLampLit("candle_floor_4", true, true);
AddPropImpulse("prison_section_1", 0.0f, 0.0f, 0.2f, false);
}

void Candlelight3(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle_floor_5", true, true);
SetLampLit("candle_floor_6", true, true);
AddPropImpulse("prison_section_1", 0.0f, 0.0f, 0.25f, false);
}


void Candlelight4(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle_floor_7", true, true);
SetLampLit("candle_floor_8", true, true);
AddPropImpulse("prison_section_1", 0.0f, 0.0f, 0.3f, false);
}

The effect is to light candles on either side of you as you walk down a corridor and slowly push a door ("prison_section_1") open in front of you. My AddPropImpulse section keeps returning non-matching signatures.
03-05-2011, 06:13 AM
Find


Messages In This Thread
RE: Gandalf's scripting questions thread - by gandalf91 - 03-05-2011, 06:13 AM



Users browsing this thread: 1 Guest(s)