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 Need help with several scripts.
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#12
RE: Need help with several scripts.

Might be a little late, but for the portcullis/lever problem:
Keep in mind that the portcullis is opened by:

void SetMoveObjectState(string& asName, float afState);
Moves an object to a certain state.
asName - internal name
afState - state of the object, 0 = closed, 1 = open, values inbetween are valid too!

or the extended version with more options:

void SetMoveObjectStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);
Moves an object to a certain state, extended method.
asName - internal name
afState - state of the object, 0 = closed, 1 = open, values inbetween are valid too!
afAcc - acceleration
afMaxSpeed - maximum speed
afSlowdownDist - Distance to the target state before decceleration occurs.
abResetSpeed - Set to True if the prop's speed should be reset before performing the movement, else the prop will accelerate from it's current speed to afMaxSpeed.

and the callback for a changed lever:

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 asEntity, int alState)
alState: -1 = off, 0 = between, 1 = on

Now for the sample:

PHP Code: (Select All)
void OnEnter()
{
SetEntityConnectionStateChangeCallback("LeverNameHere""OpenPortcullis");
}
void OpenPortcullis(string in asEntityint alState

{
if(
alState==1)
{
SetMoveObjectState("PortcullisNameHere"1);
}
else if(
alState==-1)
{
SetMoveObjectState("PortcullisNameHere"0);
}


However, you will have to experiment on which position of the lever you want the portcullis to open or close.
06-28-2012, 12:15 AM
Find


Messages In This Thread
Need help with several scripts. - by Randael - 06-22-2012, 11:28 PM
RE: Need help with several scripts. - by Randael - 06-23-2012, 03:05 PM
RE: Need help with several scripts. - by Randael - 06-23-2012, 06:09 PM
RE: Need help with several scripts. - by Randael - 06-26-2012, 09:19 PM
RE: Need help with several scripts. - by Cruzore - 06-26-2012, 09:54 PM
RE: Need help with several scripts. - by Randael - 06-26-2012, 10:04 PM
RE: Need help with several scripts. - by Cruzore - 06-26-2012, 11:04 PM
RE: Need help with several scripts. - by Randael - 06-26-2012, 11:31 PM
RE: Need help with several scripts. - by Cruzore - 06-27-2012, 12:46 PM
RE: Need help with several scripts. - by Cruzore - 06-28-2012, 12:15 AM
RE: Need help with several scripts. - by Randael - 06-28-2012, 09:43 AM



Users browsing this thread: 1 Guest(s)