The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Custom Story Script Problems
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#1
Custom Story Script Problems

Before I begin, I am moderately decent with java and have tried looking everywhere before bugging everyone with a question.
I am new to making Amnesia custom stories, and was able to make a room and a hallway no sweat. I was also able to do some simple scripting but I instantly ran into problems. At first I was trying to lock a door and have it be able to be opened by a key. I watched 3 tutorial videos on it and made everything exactly the way the showed me, yet whenever I tried the key on the door it said "cannot use this way!". I cant figure out what I did wrong. While I was trying to figure out the key lock thing, I decided to make a monster break down the door to the hallway and walk in, patrol a bit, and leave when you pick up the key. I also watched a tutorial on this and followed exactly what he said. The funny thing is, it worked the first time I did it, but the monster (who I wanted to not be there, then suddenly appear behind the door and break it down) was there the whole time and you could hear him behind the door so it was no big surprise. Once I picked up the key however, he broke down the door and everything worked. I realized I had forgot to save the level editor when I made him unactive, so I did that and launched it again. The monster never even showed up even after I picked up the key. The code is set up to make him appear yet he doesnt. I have no idea why some of my code wont work even though it works for other people, and am wondering if i am doing something wrong or if the videos are out of date. Heres the code:
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("OpenDoor", "key", "castle_1", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("key", "ActivateMonster", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}
void ActivateMonster(String &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolMode("servant_grunt_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolMode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolMode("servant_grunt_1", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolMode("servant_grunt_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolMode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
{
void KeyOnDoor(string &in item, string &in entity)
{
SetSwingDoorLocked(entity, false);
PlaySoundAtEntity("", "unlock_door", entity, 0, false);
RemoveItem(item);
}
Any help would be GREATLY appreciated. Thank you!
7/14/12 EDIT: I am still unable to figure out what is wrong. All the suggestions so far havent really changed much. Is there any more information I can provide that can help provide an answer? If anyone can help thatd be great. Thanks!
(This post was last modified: 07-16-2012, 07:19 PM by zergling50.)
07-14-2012, 08:25 PM
Find


Messages In This Thread
Custom Story Script Problems - by zergling50 - 07-14-2012, 08:25 PM
RE: Custom Story Script Problems - by JMFStorm - 07-14-2012, 08:29 PM
RE: Custom Story Script Problems - by zergling50 - 07-14-2012, 08:34 PM
RE: Custom Story Script Problems - by zergling50 - 07-14-2012, 10:13 PM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 01:01 AM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 06:26 AM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 09:15 PM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 10:02 PM
RE: Custom Story Script Problems - by zergling50 - 07-16-2012, 02:11 AM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 04:43 PM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 04:58 PM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 05:38 PM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 06:40 PM
RE: Custom Story Script Problems - by Ongka - 07-15-2012, 06:36 PM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 06:47 PM
RE: Custom Story Script Problems - by Ongka - 07-15-2012, 06:44 PM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 08:55 PM
RE: Custom Story Script Problems - by zergling50 - 07-15-2012, 10:13 PM
RE: Custom Story Script Problems - by zergling50 - 07-16-2012, 04:51 PM
RE: Custom Story Script Problems - by zergling50 - 07-16-2012, 07:18 PM



Users browsing this thread: 1 Guest(s)