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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spencer Mansion
AlexxShadenk777 Offline
Junior Member

Posts: 40
Threads: 5
Joined: Jul 2011
Reputation: 1
#11
RE: Spencer Mansion / Collaboration anyone?

Alright, I've been putting this off because I wanted to figure it out on my own but now I have no idea what I'm doing wrong. I made a key and a level door, and I want the two of them to get along.

What's wrong with this code? When I attempt to use the key on the door it just says "Can't use item this way."

void onStart()
{
    AddUseItemCallback("", "keysimple1", "mhbedroomdoor", "MHBedroom", true);
}


///
/// DOORS ///
///

void MHBedroom(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("mhbedroomdoor", false);
    PlaySoundAtEntity("", "unlock_door.snt", "mhbedroomdoor", 0.0f, true);
    RemoveItem("keysimple1");
}

After this is sorted out, I can then make another progress video. The dining room is finished, though I'm probably gonna leave it out of the first map and use a level door to get to it.
(This post was last modified: 07-13-2011, 09:52 PM by AlexxShadenk777.)
07-13-2011, 09:50 PM
Find
AlexxShadenk777 Offline
Junior Member

Posts: 40
Threads: 5
Joined: Jul 2011
Reputation: 1
#12
RE: Spencer Mansion / Need help with level door script

Seriously, no one?
07-14-2011, 10:42 PM
Find
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#13
RE: Spencer Mansion / Need help with level door script

Hmm.. I'd put an "_" inbetween the "simple" and the "1" so: "keysimple_1"
In the level editor, do the names match up?
is the name of the door exactly what it is in the .hps file?
double check the names and such. I see nothing wrong with your script.
07-14-2011, 11:06 PM
Find
H. Filipe Offline
Junior Member

Posts: 22
Threads: 6
Joined: Jun 2011
Reputation: 0
#14
RE: Spencer Mansion / Need help with level door script

The problem should be of the names in the Level Editor and the .hps file like Snuffalofagus says.

E-mail: postal2DeusEx@hotmail.com
Xbox/Live Account: HUGO BOLT 0GTA0

Working on a Custom Story :)
07-15-2011, 05:14 PM
Find
AlexxShadenk777 Offline
Junior Member

Posts: 40
Threads: 5
Joined: Jul 2011
Reputation: 1
#15
RE: Spencer Mansion / Need help with level door script

Is an underscore really necessary for keys? Because it made absolutely no difference. I even replaced the '1' with an 'a' and it changed nothing. I also added an underscore to the name of the door, changing it to 'mhbedroom_door' but it was no use. No matter what I do to the script and names of the entities, it just doesn't work. I even changed the script so that the key would unlock a different level door but I got the same result.

I match everything correctly, but the game insists that the key 'can't be used this way' every time I test it. Either the world is wrong, or someone isn't telling me everything to make this work. The names match up and the script has no errors, which means something else is missing and I have on idea what.

However. Is there an alternate scripting method I can use? Like... could I create a little Script area around the doorknob, and that's where you have to use the key on to unlock the door? Would that work?
07-16-2011, 12:50 AM
Find
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#16
RE: Spencer Mansion / Need help with level door script

Hmm.. that's new.. never heard of that problem before.
I'm not sure if this would work, but most of my "AddUseItemCallback"s are in the OnEnter section..

and the /////Doors//// thing.. hmm.. Idk about that.
07-16-2011, 06:05 AM
Find
AlexxShadenk777 Offline
Junior Member

Posts: 40
Threads: 5
Joined: Jul 2011
Reputation: 1
#17
RE: Spencer Mansion / Need help with level door script

Added onEnter, and removed the ///DOORS thing, but still no changes. It just doesn't work.
07-16-2011, 09:31 AM
Find
H. Filipe Offline
Junior Member

Posts: 22
Threads: 6
Joined: Jun 2011
Reputation: 0
#18
RE: Spencer Mansion / Need help with level door script

(07-16-2011, 09:31 AM)AlexxShadenk777 Wrote: Added onEnter, and removed the ///DOORS thing, but still no changes. It just doesn't work.

in OnStart is better

You get the key in the map where you have to use the key???

E-mail: postal2DeusEx@hotmail.com
Xbox/Live Account: HUGO BOLT 0GTA0

Working on a Custom Story :)
(This post was last modified: 07-16-2011, 05:22 PM by H. Filipe.)
07-16-2011, 05:20 PM
Find
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#19
RE: Spencer Mansion / Need help with level door script

Hmm.. this is very odd.. post ALL of your script.
and one more suggestion, try renaming the key and the door.
07-16-2011, 07:54 PM
Find
AlexxShadenk777 Offline
Junior Member

Posts: 40
Threads: 5
Joined: Jul 2011
Reputation: 1
#20
RE: Spencer Mansion / Need help with level door script

@H: Filippe: Yes, both key and door are in the same map.
@Snuffalofagus: I did post all of the script, it's the only thing I wrote into the hps.

And I renamed everything once already too.
07-16-2011, 10:01 PM
Find




Users browsing this thread: 1 Guest(s)