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
Scripting Problem
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#11
RE: Scripting Problem

(05-20-2013, 10:01 PM)Bridge Wrote: Did you see what Tomato Cat said? You're calling a function that doesn't exist.

AddUseItemCallback("", "Key2", "Door2", "UsedKeyOnDoor", true);

Should be:

AddUseItemCallback("", "Key2", "Door2", "UsedKeyonDoor", true);

No, it shouldn't. Another function already exists!
Here's how it should be.
void OnStart()
{
AddUseItemCallback("", "Key", "Mansion_door", "UsedKeyonDoor", true);
AddUseItemCallback("", "Key2", "Door2", "UsedKeyOnDoor", true);
}

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

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-21-2013, 02:24 AM
Find
Bonehead Offline
Member

Posts: 50
Threads: 12
Joined: Apr 2013
Reputation: 1
#12
RE: Scripting Problem

Also are you saying that the door is NOT locked? Make sure the "Locked" Box is checked in the level editor when you select the door under the entity tab.
05-21-2013, 02:27 AM
Find
amnesiaplayer321 Offline
Junior Member

Posts: 31
Threads: 4
Joined: May 2013
Reputation: 0
#13
RE: Scripting Problem

Thanks to all of you it got fixed after JustAnotherPlayer's script.
05-21-2013, 04:07 AM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#14
RE: Scripting Problem

What was ultimately the problem?

Also, I don't recommend giving your functions names that are difficult to distinguish from one another.

Use something like "UsedKeyOnDoor" & "UsedKeyOnDoor2" rather than "UsedKeyOnDoor" and "UsedKeyonDoor".
(This post was last modified: 05-21-2013, 06:05 AM by Tomato Cat.)
05-21-2013, 05:55 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#15
RE: Scripting Problem

(05-21-2013, 05:55 AM)Tomato Cat Wrote: Use something like "UsedKeyOnDoor" & "UsedKeyOnDoor2" rather than "UsedKeyOnDoor" and "UsedKeyonDoor".

Or he should learn about parameters and have only one function handle every key-door combination.

Tutorials: From Noob to Pro
05-21-2013, 11:48 AM
Website Find
amnesiaplayer321 Offline
Junior Member

Posts: 31
Threads: 4
Joined: May 2013
Reputation: 0
#16
RE: Scripting Problem

Thanks all about you,now i know about parameters and how to get doors locked.I am creating one now.
05-21-2013, 01:04 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#17
RE: Scripting Problem

(05-21-2013, 11:48 AM)Your Computer Wrote: Or he should learn about parameters and have only one function handle every key-door combination.

True, but that might be a bit confusing for a beginner.
05-21-2013, 03:17 PM
Find




Users browsing this thread: 2 Guest(s)