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
Lever Problem
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#1
Lever Problem

After i made the script the ERR messages kept coming again. It said the same thing, I fixed it but it still didnt work. Here is my script:
void UnlockDoor(String &in entity, int level_state)
{
if (level_state == 1)
{
SetEntityActive("LockedDoor2", true);
}

}
What is wrong?
(This post was last modified: 08-04-2012, 12:52 AM by Brothersvv09.)
08-04-2012, 12:47 AM
Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#2
RE: Lever Problem

void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever", "UnlockDoor");
}


void UnlockDoor(string &in asEntity, int alState)
{
if (alState == 1)
{
SetEntityActive("LockedDoor2", true);
return;
}
}
(This post was last modified: 08-04-2012, 01:38 AM by Kazakarumariou.)
08-04-2012, 01:38 AM
Find
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#3
RE: Lever Problem

That didnt work :/ it said :
main ERR 4,6 can't be void
main ERR 4,44 only objects have constructors
Here is my script:
void OnStart()
{
AddUseItemCallback("", "key", "LockedDoor1", "UsedKeyOnDoor", true);
void SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor1", false, true);
RemoveItem("key");
}

void UnlockDoor(string &in asEntity, int alState);
{
if (alState == 1)
{
SetEntityActive("LockedDoor2", true);
return;
}
}
08-04-2012, 01:58 AM
Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#4
RE: Lever Problem

void SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);
(This post was last modified: 08-04-2012, 02:00 AM by Kazakarumariou.)
08-04-2012, 01:59 AM
Find
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#5
RE: Lever Problem

I know I figured that out.. but it says 14,2 unexpected token "{"

when i take out the { in 14 and 2 it gives me a whole list of MORE problems... :/
(This post was last modified: 08-04-2012, 02:06 AM by Brothersvv09.)
08-04-2012, 02:05 AM
Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#6
RE: Lever Problem

void UnlockDoor(string &in asEntity, int alState);
At the end of the function remove the ;
08-04-2012, 02:37 AM
Find
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#7
RE: Lever Problem

That worked but after it say'd
No matching signatures to SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);
but Lever was &in Name or something, do i have to change the name?

sorry I mean string @&.. thats what it said
SetEntityConnectionStateChangeCallback(string @&, UnlockDoor)
(This post was last modified: 08-04-2012, 04:21 AM by Brothersvv09.)
08-04-2012, 03:51 AM
Find




Users browsing this thread: 2 Guest(s)