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
Can't find my Custom Story
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#21
RE: Can't find my Custom Story

Okay, the first key (bedroom) works. Now when I try to make the other key work it says "Unexpected token '{'

{
AddUseItemCallback("", "Thronedoorkey", "Thronedoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Thronedoor", false, true);
PlaySoundAtEntity("", "unlock_door", "Thronedoor", 0, false);
RemoveItem("Thronedoorkey");
}
(This post was last modified: 10-03-2011, 06:04 PM by i3670.)
10-03-2011, 06:03 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#22
RE: Can't find my Custom Story

If you use the function i gave you, you could use the same function for multiple key-door combinations.

Tutorials: From Noob to Pro
10-03-2011, 06:05 PM
Website Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#23
RE: Can't find my Custom Story

(10-03-2011, 06:05 PM)Your Computer Wrote: If you use the function i gave you, you could use the same function for multiple key-door combinations.
Guide me please. What shall I remove?

{
AddUseItemCallback("", "Bedroomkey", "Bedroom", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Bedroom", false, true);
PlaySoundAtEntity("", "unlock_door", "Bedroom", 0, false);
RemoveItem("Bedroomkey");
}

{
AddUseItemCallback("", "Thronedoorkey", "Thronedoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Thronedoor", false, true);
PlaySoundAtEntity("", "unlock_door", "Thronedoor", 0, false);
RemoveItem("Thronedoorkey");
}
10-03-2011, 06:09 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#24
RE: Can't find my Custom Story

(10-03-2011, 06:09 PM)i3670 Wrote: Guide me please. What shall I remove?

Your code should look something like this:
void OnStart()
{
AddUseItemCallback("", "Bedroomkey", "Bedroom", "UsedKeyOnDoor", true);
AddUseItemCallback("", "Thronedoorkey", "Thronedoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}

Tutorials: From Noob to Pro
10-03-2011, 06:26 PM
Website Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#25
RE: Can't find my Custom Story

Ok, thanks got most of it working now, got some more things to do like notes. don't think those will be a problem though.
10-03-2011, 06:37 PM
Find




Users browsing this thread: 1 Guest(s)