Frictional Games Forum (read-only)

Full Version: Beginner needs scripting help...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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");
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
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>

Thanks alot, that code is working perfectly!