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
Help Please with Scripting
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#1
Help Please with Scripting

Hello , i have recently purchased Amnesia and love it. I want to make a map but i have tried numurous times and i cant get the following scripts to work
////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("OpenLockedDoor", "key_1", "level_celler_1", "UnlockLevelDoor", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
void UnlockLevelDoor(string &in item,string &in entity)
{
SetLevelDoorLocked(Entity, false);
// RemoveItem(Item);
}
and
<LANGUAGE>
<CATEGORY Name="TutorialStory">
<Entry Name="Description">nothing yet</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_studyKey_1">key for unlocking celler</Entry>
<Entry Name="ItemName_studyKey_1">Celler key</Entry>
</CATEGORY>
</LANGUAGE>
I would like to have a basic tutorial that works for me or a skype helper. All the tutorials dont work for me and i have tried lots.
Thank you
abelloyd
03-31-2012, 12:00 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Help Please with Scripting

Help with scripting and mapping is supposed to be in the Development Support thread Smile

But have you named your key StudyKey_1 in both the name and the CustomSubItemName?

write the script like this,

////////////////////////////

// Run when the map starts

void OnStart()

{

AddUseItemCallback("", "NAMEOFKEY", "NAMEOFDOOR", "UnlockLevelDoor", true);

}

////////////////////////////

// Run when entering map

void OnEnter()

{

}



////////////////////////////

// Run when leaving map

void OnLeave()

{



}

void UnlockLevelDoor(string &in asItem,string &in asEntity)

{

SetLevelDoorLocked(asEntity, false);

RemoveItem(asItem);

}

(This post was last modified: 03-31-2012, 12:05 PM by SilentStriker.)
03-31-2012, 12:01 PM
Find
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#3
RE: Help Please with Scripting

Il check

yeah i did
(This post was last modified: 03-31-2012, 02:03 PM by abe.lloyd.)
03-31-2012, 01:58 PM
Find
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#4
RE: Help Please with Scripting

some reson the door still dosent work?
03-31-2012, 03:41 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#5
RE: Help Please with Scripting

hmm.. can you post the script you got now?

(This post was last modified: 03-31-2012, 03:48 PM by SilentStriker.)
03-31-2012, 03:48 PM
Find
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#6
RE: Help Please with Scripting

void OnEnter()

{

}


////////////////////////////

// Run when leaving map

void OnLeave()

{


}

void UnlockLevelDoor(string &in asItem,string &in asEntity)

{

SetLevelDoorLocked(asEntity, false);

RemoveItem(asItem);

}

soz heres the full thing
////////////////////////////

// Run when the map starts

void OnStart()

{

AddUseItemCallback("", "key_1", "level_celler_1", "UnlockLevelDoor", true);

}

////////////////////////////

// Run when entering map

void OnEnter()

{

}


////////////////////////////

// Run when leaving map

void OnLeave()

{


}

void UnlockLevelDoor(string &in asItem,string &in asEntity)

{

SetLevelDoorLocked(asEntity, false);

RemoveItem(asItem);

}
(This post was last modified: 03-31-2012, 04:05 PM by abe.lloyd.)
03-31-2012, 04:03 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#7
RE: Help Please with Scripting

Try renaming the key to StudyKey_1 in both the name and the CustomSubItemName and then change

AddUseItemCallback("", "key_1", "level_celler_1", "UnlockLevelDoor", true);

to

AddUseItemCallback("", "StudyKey_1", "level_celler_1", "UnlockLevelDoor", true);

03-31-2012, 04:29 PM
Find
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#8
RE: Help Please with Scripting

oh ok
03-31-2012, 04:36 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#9
RE: Help Please with Scripting

Use this:


////////////////////////////

// Run when the map starts

void OnStart()

{

AddUseItemCallback("", "key_1", "level_celler_1", "UnlockLevelDoor", true);

}


void UnlockLevelDoor(string &in asItem,string &in asEntity)

{

SetLevelDoorLocked(asEntity, false);

RemoveItem(asItem);

}

////////////////////////////

// Run when entering map

void OnEnter()

{

}


////////////////////////////

// Run when leaving map

void OnLeave()

{


}

When scripting make sure that void OnStart() functions stay within the void OnStart() brackets and so on.

03-31-2012, 04:36 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#10
RE: Help Please with Scripting

(03-31-2012, 04:36 PM)flamez3 Wrote: Use this:


////////////////////////////

// Run when the map starts

void OnStart()

{

AddUseItemCallback("", "key_1", "level_celler_1", "UnlockLevelDoor", true);

}


void UnlockLevelDoor(string &in asItem,string &in asEntity)

{

SetLevelDoorLocked(asEntity, false);

RemoveItem(asItem);

}

////////////////////////////

// Run when entering map

void OnEnter()

{

}


////////////////////////////

// Run when leaving map

void OnLeave()

{


}

When scripting make sure that void OnStart() functions stay within the void OnStart() brackets and so on.
It's not really necessary from what I know since FG wrote all their code above all the On's



03-31-2012, 04:38 PM
Find




Users browsing this thread: 2 Guest(s)