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
Valve help
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#1
Valve help

Hi, I was wondering how I script it so that when the valve is turned all the way it triggers a function?
07-01-2011, 11:57 AM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#2
RE: Valve help

I guess what im asking for is how do I get the valve to trigger a function????
07-03-2011, 03:15 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#3
RE: Valve help

State Change is what you are looking for.
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);

A callback called when ever the connection state changes (button being switched on, lever switched, etc).
Callback syntax: void Func(string &in EntityName, int alState)
alState: -1 = off, 0 = between, 1 = on

07-05-2011, 01:49 AM
Website Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#4
RE: Valve help

(07-05-2011, 01:49 AM)Tanshaydar Wrote: State Change is what you are looking for.
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);

A callback called when ever the connection state changes (button being switched on, lever switched, etc).
Callback syntax: void Func(string &in EntityName, int alState)
alState: -1 = off, 0 = between, 1 = on

What do insert where??
Can anybody see why its not working???


////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityConnectionStateChangeCallback(LoL, EndaMer);
AddEntityCollideCallback("Player", "HaveLantern", "MayIGo", false, 1);
AddEntityCollideCallback("Player", "HaveLantern_1", "MayINot", false, 1);
}

void Func("button_simple_1", 1)
{
PlaySoundAtEntity("", "13_steam.snt", "Player", 0, true);
}

void MayINot(string &in asParent, string &in asChild, int alState)
{
if(HasItem("ZuLantern")==false)
{
SetMessage("NotWorking", "CisternDarkness", 0);
}
}

void MayIGo(string &in asParent, string &in asChild, int alState)
{
if(HasItem("ZuLantern")==true)
{
SetEntityActive("BlockBuster", false);
SetEntityActive("BlockBuster_1", false);
SetEntityActive("BlockBuster_2", false);
}
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
(This post was last modified: 07-05-2011, 10:36 AM by Henriksen.)
07-05-2011, 10:33 AM
Find
H. Filipe Offline
Junior Member

Posts: 22
Threads: 6
Joined: Jun 2011
Reputation: 0
#5
RE: Valve help

(07-05-2011, 10:33 AM)teddifisk Wrote:
(07-05-2011, 01:49 AM)Tanshaydar Wrote: State Change is what you are looking for.
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);

A callback called when ever the connection state changes (button being switched on, lever switched, etc).
Callback syntax: void Func(string &in EntityName, int alState)
alState: -1 = off, 0 = between, 1 = on

What do insert where??
Can anybody see why its not working???


////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityConnectionStateChangeCallback(LoL, EndaMer);
AddEntityCollideCallback("Player", "HaveLantern", "MayIGo", false, 1);
AddEntityCollideCallback("Player", "HaveLantern_1", "MayINot", false, 1);
}

void Func("button_simple_1", 1)
{
PlaySoundAtEntity("", "13_steam.snt", "Player", 0, true);
}

void MayINot(string &in asParent, string &in asChild, int alState)
{
if(HasItem("ZuLantern")==false)
{
SetMessage("NotWorking", "CisternDarkness", 0);
}
}

void MayIGo(string &in asParent, string &in asChild, int alState)
{
if(HasItem("ZuLantern")==true)
{
SetEntityActive("BlockBuster", false);
SetEntityActive("BlockBuster_1", false);
SetEntityActive("BlockBuster_2", false);
}
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

You forgot the "" in SetEntityConnectionStateChangeCallback(LoL, EndaMer); is SetEntityConnectionStateChangeCallback("LoL", "EndaMer");
I think

E-mail: postal2DeusEx@hotmail.com
Xbox/Live Account: HUGO BOLT 0GTA0

Working on a Custom Story :)
07-08-2011, 01:04 PM
Find




Users browsing this thread: 1 Guest(s)