Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Key! WHY YOU NO WORK!
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#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
Website Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#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
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#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
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#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
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#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

Ba-da bing, ba-da boom.
08-21-2011, 04:00 AM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#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
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#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
Website Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#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

Insanity. Static.
08-21-2011, 05:37 AM
Find




Users browsing this thread: 1 Guest(s)