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
#11
RE: Need help with several scripts.

For the .lang file, there can't be any writing mistake. I've checked 10 times at least. Make sure CustomSubItemTypeName of the items in the level editor match with the names on the .lang file. It#s not the name of the item itself, it's the name under CustomSubItemTypeName that will be used.
06-27-2012, 12:46 PM
Find
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
Randael Offline
Junior Member

Posts: 7
Threads: 1
Joined: Jun 2012
Reputation: 0
#13
RE: Need help with several scripts.

alright, i will try it that way later, and i will look into the item thing, i didnt know it isnt using the item name itself(since like... no tutorial even mentioned that customSub thing Tongue)
06-28-2012, 09:43 AM
Find




Users browsing this thread: 5 Guest(s)