Frictional Games Forum (read-only)
How do I make a monster appear after I read a note? - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: How do I make a monster appear after I read a note? (/thread-6512.html)



How do I make a monster appear after I read a note? - Trucido - 02-08-2011

Hi, I am currently new with mapping and all and so far I can only make walls, ceiling, props etc. So I was wondering how do I make a monster to appear after I read a note? And how to I make a note anyways? I do not know anything about triggers and scripts so please explain how simply you can!

Big Grin

Thx for reading!



Rolleyes


RE: How do I make a monster appear after I read a note? - Vradcly - 02-08-2011

first create a Callback inside the OnStart() section of you map script. (I am assuming that you have set up everything needed for development...). The callback should be something like this one:
SetEntityCallbackFunc("note_generic_1","note_pickup1");

It makes the function note_pickup1 run when you pickup the note named note_generic_1

Then you have to define note_pickup1, put it outside of your OnStart() OnEnter() and OnLeave():
void note_pickup1(string& asName, string& asCallback)
{
//Put the thing you want to happen here, in your case, activate monster:
SetEntityActive("servant_grunt_1" , true); //true is active, false is not active, servant_grunt_1 is //the name of the monster
}

Ill post the rest (how you make the note text show) later if noone else helps you...Hope that will make the monster come running for you at least Smile.


RE: How do I make a monster appear after I read a note? - Trucido - 02-08-2011

Ok thanks for that, a little blurry still but I might be able to fix it. Because I am working on a "barricade" map where you read a note the monster will appear and you've been barricading the room (like in Daniel's room in the game) but as I said it will only work if you read the note.


RE: How do I make a monster appear after I read a note? - Vradcly - 02-08-2011

Oh and you have to place the monster inside the map and make sure the checkbox for "active" is not on. Then you could have some pathnodes if you want the monster to walk around, but that will take to much explanation from my part when you can just search on how to do it.

To make the note have text:
code to put in .lang file:
<CATEGORY Name="Journal">
<Entry Name="Note_A1_Name">HEADLINE</Entry>
<Entry Name="Note_A1_Text">TEXT</Entry>

On the entity properties for your note write A1 in the note text field.
That should do it Smile.


RE: How do I make a monster appear after I read a note? - Trucido - 02-09-2011

(02-08-2011, 10:54 PM)Vradcly Wrote: Oh and you have to place the monster inside the map and make sure the checkbox for "active" is not on. Then you could have some pathnodes if you want the monster to walk around, but that will take to much explanation from my part when you can just search on how to do it.

To make the note have text:
code to put in .lang file:
<CATEGORY Name="Journal">
<Entry Name="Note_A1_Name">HEADLINE</Entry>
<Entry Name="Note_A1_Text">TEXT</Entry>

On the entity properties for your note write A1 in the note text field.
That should do it Smile.


I've tried now almost a day and it didn't work for me (probably did something wrong) can you please post a pre made script file?


RE: How do I make a monster appear after I read a note? - Ongka - 02-09-2011

Set the options of the letter like this:
[Image: letterv.th.png]

and put this script into your .hps file.
Code:
void PickLetter(string &in asEntity, string &in asType) //Has to be the same name as the callback function.
{
SetEntityActive("servant_grunt_1", true); //servant_grunt_1 is the name of the monster.
}