Frictional Games Forum (read-only)
Amnesia script help! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Amnesia script help! (/thread-24898.html)

Pages: 1 2 3 4


Amnesia script help! - theodorg - 08-21-2013

Hello im trying to make a key open a door in amnesia.
Heres my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}


RE: Amnesia script help! - Traggey - 08-21-2013

Wrong section, moved.


RE: Amnesia script help! - The chaser - 08-21-2013

(08-21-2013, 07:03 PM)theodorg Wrote: Hello im trying to make a key open a door in amnesia.
Heres my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

Check that the names match and delete .map_cache if there's any.


RE: Amnesia script help! - theodorg - 08-21-2013

(08-21-2013, 07:49 PM)The chaser Wrote:
(08-21-2013, 07:03 PM)theodorg Wrote: Hello im trying to make a key open a door in amnesia.
Heres my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

Check that the names match and delete .map_cache if there's any.

I dont see a map cache and i have the correct names that im sure of i followed a guide doing this u can check it out here http://wiki.frictionalgames.com/hpl2/tutorials/script/scripting_by_xtron_-_item_that_unlocks_a_door

If u see any problems pls help im new to this!

(08-21-2013, 07:49 PM)The chaser Wrote:
(08-21-2013, 07:03 PM)theodorg Wrote: Hello im trying to make a key open a door in amnesia.
Heres my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

Check that the names match and delete .map_cache if there's any.
Also i can get ingame but when i try to open the door with the key it just sais i cant use the item that way.


RE: Amnesia script help! - The chaser - 08-21-2013

The script is completely fine, I repeat: Names won't change unless you hit Enter when you write them in Level Ed.


RE: Amnesia script help! - theodorg - 08-22-2013

(08-21-2013, 10:24 PM)The chaser Wrote: The script is completely fine, I repeat: Names won't change unless you hit Enter when you write them in Level Ed.

what do u mean with level e.d?


RE: Amnesia script help! - PutraenusAlivius - 08-22-2013

(08-22-2013, 03:38 PM)theodorg Wrote:
(08-21-2013, 10:24 PM)The chaser Wrote: The script is completely fine, I repeat: Names won't change unless you hit Enter when you write them in Level Ed.

what do u mean with level e.d?

Level Editor.


RE: Amnesia script help! - theodorg - 08-22-2013

haha thank you so much it seamed as the name changed everytime i tried to swave my map so i pressed enter as u said and it worked. You have my gratitude!


Amnesia script help! - theodorg - 08-23-2013

Hello im trying to make an amnesia custom story scare by spawning the monster when the player touches an area. Something is wrong with the script i named MonsterFunction. Pls help!
My script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}


RE: Amnesia script help! - Neelke - 08-23-2013

(08-23-2013, 03:49 PM)theodorg Wrote: Hello im trying to make an amnesia custom story scare by spawning the monster when the player touches an area. Something is wrong with the script i named MonsterFunction. Pls help!
My script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}

I think that was the problem, it seemed to be good otherwise. Also might be a good idea telling what happens when you try to start the level.