Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 1 Votes - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Key! WHY YOU NO WORK!
Author Message
JetlinerX Offline
Senior Member

Posts: 601
Joined: Jun 2011
Reputation: 19
Post: #1
Key! WHY YOU NO WORK!
Keys are the one of the most easy things I know how to script, but why the hell is it saying "Cannot Use Item This Way!" Here is my code, and I hawk-eyed it, saw nothing wrong, and someone else looked at it and ALSO saw nothing wrong! The key/door names are all correct, and the key has a subitemtext.

        AddUseItemCallback("", "key_firstfloor", "firstfloordoor", "UsedKeyOnDoor", true);

---------------------------
void UsedKeyOnDoor(string &in asParent , string &in asChild , int alState)
{
        SetLevelDoorLocked("firstfloordoor", false);
        SetLevelDoorLockedSound("firstfloordoor", "door_level_wood_locked.snt");
        RemoveItem("key_firstfloor");
}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 08-21-2011 01:13 AM by JetlinerX.)
08-21-2011 01:12 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 868
Joined: Aug 2011
Reputation: 26
Post: #2
RE: Key! WHY YOU NO WORK!
SetSwingDoorLocked("DOORNAME", false, true);

The Interrogation
Chapter 1

My tutorials
(This post was last modified: 08-21-2011 01:45 AM by Elven.)
08-21-2011 01:45 AM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 801
Joined: Jul 2011
Reputation: 65
Post: #3
RE: Key! WHY YOU NO WORK!
(08-21-2011 01:12 AM)JetlinerX Wrote:  Keys are the one of the most easy things I know how to script, but why the hell is it saying "Cannot Use Item This Way!" Here is my code, and I hawk-eyed it, saw nothing wrong, and someone else looked at it and ALSO saw nothing wrong! The key/door names are all correct, and the key has a subitemtext.

        AddUseItemCallback("", "key_firstfloor", "firstfloordoor", "UsedKeyOnDoor", true);

---------------------------
void UsedKeyOnDoor(string &in asParent , string &in asChild , int alState)
{
        SetLevelDoorLocked("firstfloordoor", false);
        SetLevelDoorLockedSound("firstfloordoor", "door_level_wood_locked.snt");
        RemoveItem("key_firstfloor");
}

Improper Syntax. (string &in asItem, string &in asEntity) is what you want to use.
08-21-2011 01:45 AM
Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 868
Joined: Aug 2011
Reputation: 26
Post: #4
RE: Key! WHY YOU NO WORK!
Yeah that was second thing what I was about to say Smile

The Interrogation
Chapter 1

My tutorials
08-21-2011 01:46 AM
Find all posts by this user Quote this message in a reply
JenniferOrange Offline
Senior Member

Posts: 428
Joined: Jun 2011
Reputation: 33
Post: #5
RE: Key! WHY YOU NO WORK!
(08-21-2011 01:45 AM)Obliviator27 Wrote:  Improper Syntax. (string &in asItem, string &in asEntity) is what you want to use.

HE IS RIGHT! I can't believe I never caught that x_x

[Image: button.png]
08-21-2011 04:00 AM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 801
Joined: Jul 2011
Reputation: 65
Post: #6
RE: Key! WHY YOU NO WORK!
[/quote]

HE IS RIGHT! I can't believe I never caught that x_x

[/quote]

It's scripting. Missing things happens, as I've found out very often. I've yet to type up a script that works without a Fatal Error. Smile
08-21-2011 04:14 AM
Find all posts by this user Quote this message in a reply
JetlinerX Offline
Senior Member

Posts: 601
Joined: Jun 2011
Reputation: 19
Post: #7
RE: Key! WHY YOU NO WORK!
Yep, thats why this community is so great Jennifer, if we dont spot it, you can be sure as hell someone else is willing to get it for you! Thanks all!

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

08-21-2011 04:17 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Juby Away
Senior Member

Posts: 285
Joined: May 2011
Reputation: 5
Post: #8
RE: Key! WHY YOU NO WORK!
(08-21-2011 04:17 AM)JetlinerX Wrote:  Yep, thats why this community is so great Jennifer, if we dont spot it, you can be sure as hell someone else is willing to get it for you! Thanks all!

Attractive Wink

Wink

Forever passing judgement compared to a fraud.
08-21-2011 05:37 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)