Frictional Games Forum (read-only)
Need help with scripts - 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: Need help with scripts (/thread-9828.html)

Pages: 1 2


RE: Need help with scripts - NumsefisK - 08-17-2011

(08-17-2011, 09:52 PM)JetlinerX Wrote: Thats alright, I have done that a lot. Also, to fix your Extra Eng, use this:

Code:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You wake up an unknown castle you must escape quickly before darkness will kill you!</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_diary_1_Name">Diary Entry 1</Entry>
<Entry Name="Note_diary_1_Text">I sometimes wake up in the middle of the night, because of the noises coming from the closet, but as I wake up, they suddenly disappear. I think I'm going to have to leave this place soon...</Entry>
</CATEGORY>
<CATEGORY>
<Entry Name ="Inventory"
<Entry Name="ItemName_Bedroom_Key">Bedroom Key</Entry>  
<Entry Name="ItemDesc_Bedroom_Key">The Key to the Bedroom</Entry>
</CATEGORY>
</LANGUAGE>

Let me know if that worked Wink

I'm sorry to inform you that it didn't work for me Sad
It still doesn't show me the name and text of the note & key, and the key doesn't work for the door. The monster doesn't spawn neither.
This is starting to get on my nerves.

I must've done something wrong in the .hps file.




RE: Need help with scripts - Obliviator27 - 08-17-2011

Code:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You wake up an unknown castle you must escape quickly before darkness will kill you!</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_diary_1_Name">Diary Entry 1</Entry>
<Entry Name="Note_diary_1_Text">I sometimes wake up in the middle of the night, because of the noises coming from the closet, but as I wake up, they suddenly disappear. I think I'm going to have to leave this place soon...</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_Bedroom_Key">Bedroom Key</Entry>  
<Entry Name="ItemDesc_Bedroom_Key">The Key to the Bedroom</Entry>
</CATEGORY>
</LANGUAGE>

Try this instead.



RE: Need help with scripts - NumsefisK - 08-17-2011

I think I found one of the problems with my note. It stayed as note_generic_1 but when i changed it to note_diary_1 (and i made sure it WAS note_diary_1) it still doesn't work.

I'm getting mighty tired of this.


RE: Need help with scripts - Obliviator27 - 08-17-2011

Oh, what you might be doing is not naming it correctly. In the level editor, select your note, and on the right hand of the screen, select the Entity tab. At the bottom, there will be a box labelled "NoteText"
That is what the .lang file uses as reference.


RE: Need help with scripts - NumsefisK - 08-17-2011

Oh, i see now. Cheers, I'll have a look at it tomorrow.

Still don't understand why that bloody key won't work.



RE: Need help with scripts - NumsefisK - 08-18-2011

[Image: fzc96d.png]

[Image: sy4h7p.png]

[Image: a8emu.png]

[Image: mwy4a1.jpg]

Is this correct settings?


RE: Need help with scripts - Homicide13 - 08-18-2011

you can't use a space for the Bedroom Key TypeName. you need to use an underscore, because that's how you have it written in the lang file (you can't use spaces anyways). the writing in the lang file and in the TypeName must be exactly the same, I normally just copy and paste.


RE: Need help with scripts - NumsefisK - 08-18-2011

I have now spent countless of hours trying to make my stuff work. I've renamed everything and redone my .hps and .lang file and still it doesn't work.

This is my .lang file
Quote:<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You wake up an unknown castle you must escape quickly before darkness will kill you!</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Note_diaryone_Name">Diary Entry 1</Entry>
<Entry Name="Note_diaryone_Text">I sometimes wake up in the middle of the night, because of the noises coming from the closet, but as I wake up, they suddenly disappear. I think I'm going to have to leave this place soon...</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemName_bedroomkey">Bedroom Key</Entry>
<Entry Name="ItemDesc_bedroomkey">The Key to the Bedroom</Entry>
</CATEGORY>
</LANGUAGE>

And this is my .hps file.
Quote:////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "bedroomkey", "bedroomdoor", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("bedroomdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "bedroomdoor", 0, false);
RemoveItem("bedroomkey");
}

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

}


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

}

I haven't included the monster spawning script in here yet.

If its not going to work with your help, I'm gonna give modding a rest.