Kiorga(x2)rd
Junior Member
Posts: 43
Threads: 12
Joined: Sep 2011
Reputation:
1
|
Quest Check Issue
Hello everyone.
I have yet another problem.
How would I go about achieving this code. Basically I have two maps. You can go move between them easily. However, when the player finds a certain item (a key) in the second map and takes it back to the first map, a cave-in occurs making it impossible to go back to the second map.
So I guess I need a script area in the first map that checks if the key is in the inventory (or that the quest to find the key is completed), and if it returns true, then the cave-in needs to occur.
I saw this code to check if a quest is completed: "QuestIsCompleted(string& asName);", but I'm not sure how to use it. I'm assuming that the code will go along these lines? "check if quest is completed, if true, make entity cave-in active". Or is that impossible?
Thanks guys.
Apparently the user name "Kiorgaard" isn't accepted by the administrator. Turns out you can't have a name with a double 'a' in it. Odd...
|
|
07-20-2012, 08:31 AM |
|
Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
|
RE: Quest Check Issue
The easiest way to do this I can think of is to use "HasItem" (I find this easier because you don't have to make things more complex by having to distinguish between the name/internal name of the quest); place it under "void OnEnter()" (Tbh I'm not sure if its OnEnter or OnStart, but one of them is used every time the player enters the map, the other only is used once), and if the player has the key, set the script area active:
void OnEnter()
{
if(HasItem("NAMEOFKEY") == true)
{
SetEntityActive("NAMEOFSCRIPTAREA", true);
}
}
I rate it 3 memes.
|
|
07-20-2012, 08:39 AM |
|
Kiorga(x2)rd
Junior Member
Posts: 43
Threads: 12
Joined: Sep 2011
Reputation:
1
|
RE: Quest Check Issue
Works perfectly, thanks.
Apparently the user name "Kiorgaard" isn't accepted by the administrator. Turns out you can't have a name with a double 'a' in it. Odd...
|
|
07-20-2012, 09:57 AM |
|