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
Script problem
megsb927 Offline
Junior Member

Posts: 30
Threads: 10
Joined: Feb 2013
Reputation: 0
#1
Script problem

Ok what's wrong here? you go into room 3(this script is for room 3) and castle_2 is locked. Then you go into another map and get the key for it so you can come back and unlock it, but Map 3 won't even load. I need helpConfused



void OnStart()
{
AddUseItemCallback("", "Key3", "castle_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, false);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("Key3");
}

{
AddUseItemCallback("", "Key4", "castle_2", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_2", false, false);
PlaySoundAtEntity("", "unlock_door", "castle_2", 0, false);
RemoveItem("Key4");
}
void OnEnter()
{

}

void OnLeave()
{

}
03-31-2013, 04:45 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#2
RE: Script problem

Have you named the level door that's in the other map right? Make sure that all names match.
03-31-2013, 05:17 PM
Find
megsb927 Offline
Junior Member

Posts: 30
Threads: 10
Joined: Feb 2013
Reputation: 0
#3
RE: Script problem

(03-31-2013, 05:17 PM)Tigerwub Wrote: Have you named the level door that's in the other map right? Make sure that all names match.

It's just a swing door so You go outside of map 3, get the Key4 then come back into map 3 use it to unlock the swing door castle_2 but I don't know what's wrong with the script because it won't even load the map it said unknown character or something
03-31-2013, 05:58 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#4
RE: Script problem

Does the game crash when you load the custom story? Can you write down what it says in the error window?
03-31-2013, 06:02 PM
Find
megsb927 Offline
Junior Member

Posts: 30
Threads: 10
Joined: Feb 2013
Reputation: 0
#5
RE: Script problem

(03-31-2013, 06:02 PM)Tigerwub Wrote: Does the game crash when you load the custom story? Can you write down what it says in the error window?

FATAL ERROR: Could not load script file 'custom_stories/Mark's
story/csmaps/C:/Program Files (x86)/Amnesia-The Dark
Descent/redist/custom_stories/Mark's story/csmaps/map_3.hps'!
main(12,1) : ERR : Unexpected token '{'
03-31-2013, 06:09 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#6
RE: Script problem

Ah, ofc

PHP Code: (Select All)
{
    
AddUseItemCallback("""Key4",    "castle_2""UsedKeyOnDoor"true);


Put that in the 'void Onstart' instead.

Also, as Robosprog said, this is the wrong subforum.
(This post was last modified: 03-31-2013, 06:20 PM by Tiger.)
03-31-2013, 06:17 PM
Find
megsb927 Offline
Junior Member

Posts: 30
Threads: 10
Joined: Feb 2013
Reputation: 0
#7
RE: Script problem

(03-31-2013, 06:18 PM)Robosprog Wrote: How are people failing to post in the right section?


Post in Development Support from now on.
Oh I'm sorry I thought I did. thanks for telling me though
03-31-2013, 06:24 PM
Find




Users browsing this thread: 1 Guest(s)