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
Problem with scripts for level editor,please help.
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Problem with scripts for level editor,please help.

Also:
The script line you're using should be used like this:

PHP Code: (Select All)
SetLevelDoorLocked("NameOfDoor"false); 
You put false or true in there to make the door unlocked or locked.

So in your case:
PHP Code: (Select All)
void UseKeyOnDoor(string &in asItemstring &in asEntity)
{
SetLevelDoorLocked("Doorlvl1"false);


You already had the parameters right! That's great!
But if you only have what you just wrote (Which I'm going to assume since you didn't write anything else)
then you're gonna need a void OnStart()

In this void OnStart() you're gonna use (as Mudbill said) an AddUseItemCallback.

It looks like this:
PHP Code: (Select All)
AddUseItemCallback(stringasNamestringasItemstringasEntitystringasFunctionbool abAutoDestroy); 

So with your setup it will look like this:

PHP Code: (Select All)
void OnStart()
{
AddUseItemCallback("""Key1" "Doorlvl1""UseKeyOnDoor"false);


Remember, if you already have a void OnStart(), don't just copy mine and paste it in your script. You cannot have 2 void OnStart()! THen just copy the script line, AddUseItemCallback, and put it in your void OnStart()

Trying is the first step to success.
09-25-2014, 08:27 AM
Find


Messages In This Thread
RE: Problem with scripts for level editor,please help. - by FlawlessHappiness - 09-25-2014, 08:27 AM



Users browsing this thread: 2 Guest(s)