Frictional Games Forum (read-only)
Beginner needs scripting 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: Beginner needs scripting help... (/thread-8761.html)



Beginner needs scripting help... - cheztheguy - 06-23-2011

Hi, I'm working on a map, and there's a key on a desk. I renamed the key "fakekey_1" and the CustomSubItemName is "fakekey" , and the CallbackFunc(tion) is getkey1

What I want the player to do when he picks up the key is this script...
(this is not the full script)


void getkey1(string &in asEntity)
{
CompleteQuest("Quest0", "Mission0");
GiveSanityBoost();
SetEntityActive("Enemy2" , true);
SetEnemyIsHallucination("Enemy2", true);
}

However when I pick up the key in the game, it just says "Picked up Hotel Key" (that was the name of the item). Nothing else happens.

And, I would like to know about quests...
how there is a first part and a second part ("Quest0" and "Mission0" above).

Thanks! Big Grin


RE: Beginner needs scripting help... - rojkish - 06-23-2011

So, what exactly are you trying to do? You want to add a quest when the player interacts with fakekey_1?

In that case, use the AddQuest(string& asName, string& asNameAndTextEntry);

Example of this;

Spoiler below!


AddQuest("KeyQuest", "KeyQuest");

<CATEGORY Name="Journal">
<Entry Name="Quest_KeyQuest_Text">YOUR QUEST HERE</Entry>
</CATEGORY>




RE: Beginner needs scripting help... - cheztheguy - 06-24-2011

Thanks alot, that code is working perfectly!