Frictional Games Forum (read-only)
Level Editor - 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: Level Editor (/thread-21023.html)



Level Editor - Neelke - 04-02-2013

I got a few questions about the level scripting:

1. How do I add music to my notes?
2. How do I add mementos?
3. How do I get acid from an acid container?
4. How can I use my acid on the web wall (the web used in Entrance Hall in the original game)?


RE: Level Editor - WALP - 04-02-2013

Why would you put the title Level Editor if you need help with scripting? its misleading.


RE: Level Editor - FlawlessHappiness - 04-02-2013

(04-02-2013, 08:42 PM)Neelke Wrote: I got a few questions about the level scripting:

1. How do I add music to my notes?
2. How do I add mementos?
3. How do I get acid from an acid container?
4. How can I use my acid on the web wall (the web used in Entrance Hall in the original game)?

You sound like you need to know more about scripting. I'll see if i can help.

1. Music to notes. Check the original script files. There's gotta be something. I don't remember how to...

2. The script-line is "AddQuest("NAMEOFQUEST", "NAMEOFQUEST");"
To complete the quest, write: "CompleteQuest("NAMEOFQUEST", "NAMEOFQUEST");"
You name the quests and what you want in them in your .lang file.

Use the search button on this website to find the relevant info about mementos. It should be possible.

3. Getting acid from a container.
To do this you must understand how this game works.
It's not physically pouring acid into a container.
It's a picture.

If you have the glass-container in your inventory you'll notice that it's empty. This is just a picture of an empty container.
Now when you use the picture on the acid container, you have to create an "AddUseItemCallback".
(Use Ctrl+F or Cmd+F on this site: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions)

In this function you simply
RemoveItem("NAMEOFGLASSCONTAINER");
GiveItem("NAMEOFACID", "Puzzle", "SUBNAMEOFACID", "ACIDIMAGE.tga", 1);

See?
You remove the previous item, and add a new one. There's no pouring at all.

4. It works the exact same way. Now instead of Giving a new item to the player, you just use the SetPropActiveAndFade("NAMEOFWEB", false, 2);

I hope you understood this Smile


Now go learn some scripting!!!


RE: Level Editor - PutraenusAlivius - 04-03-2013

For adding music to notes, add this to your .hps file.
Code:
void OnStart()
{
SetEntityCallbackFunc("NOTENAME", "MusicNote");
}

void MusicNote(string &in asEntity, string &in type)
{
PlayMusic("MUSICNAME.ogg", false, 1.0f, 1.0f, 1, false);
AddTimer("", 3.0f, "EndMusic"); //Change 3.0f to the duration of the note time. I cannot do anything about this. Sorry.
}

void EndMusic(string &in asTimer)
{
StopMusic(1.0f, 1);
}