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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Item from other Level
Author Message
Knittel Offline
Junior Member

Posts: 8
Joined: Apr 2012
Reputation: 0
Post: #1
Item from other Level
Hello everyone,

I have a small problem in my Amnesia Custom Story. I have placed a Hammer (name = "TheHammer") in TheEntry.map and I want to use it to open an door in Hall.map.



My Script: Hall.hps
void OnStart()  
{

AddUseItemCallback("", "TheHammer", "CellarDoor", "DestroyDoor", true);[...]

}



void DestroyDoor ()  

{
SetMessage("Messages", "A11_Door", 0);
PlaySoundAtEntity("", "break_wood.snt", "Player", 0, false);
SetSwingDoorLocked("CellarDoor", false, false);
AddPlayerSanity(8);
}







The Problem is: Nothing happens when I use the Hammer on the Door. When I use it a 2nd time it says "This item is useless for this situation".
I hope you can help me.
Thanks in advance.

[Image: 2ZwH0ZGD0AwL2.png]
[TRACKMANIA]


04-11-2012 03:06 PM
Find all posts by this user Quote this message in a reply
Rapture Offline
Posting Freak

Posts: 751
Joined: May 2011
Reputation: 21
Post: #2
RE: Item from other Level
(04-11-2012 03:06 PM)Knittel Wrote:  Hello everyone,

I have a small problem in my Amnesia Custom Story. I have placed a Hammer (name = "TheHammer") in TheEntry.map and I want to use it to open an door in Hall.map.



My Script: Hall.hps
void OnStart()  
{

AddUseItemCallback("", "TheHammer", "CellarDoor", "DestroyDoor", true);[...]

}



void DestroyDoor ()  

{
SetMessage("Messages", "A11_Door", 0);
PlaySoundAtEntity("", "break_wood.snt", "Player", 0, false);
SetSwingDoorLocked("CellarDoor", false, false);
AddPlayerSanity(8);
}







The Problem is: Nothing happens when I use the Hammer on the Door. When I use it a 2nd time it says "This item is useless for this situation".
I hope you can help me.
Thanks in advance.
Add

string &in entity, string &in type

to


void DestroyDoor ()

so its like...

void DestroyDoor (string &in entity, string &in type)
(This post was last modified: 04-11-2012 03:18 PM by Rapture.)
04-11-2012 03:18 PM
Find all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 925
Joined: Apr 2012
Reputation: 37
Post: #3
RE: Item from other Level
You shouldn't be surprised that you'll only have one chance to interact with the door, as you've set it to be a once-only interaction.

Noob scripting tutorial: From Noob to Pro

04-11-2012 03:52 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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