HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Splitting up quests?

06-21-2004, 11:00 PM#1
trubadur
I was wondering if anyone could tell how to make a quest that contains several pieces i. e. Theres four cages on the map and I want the quest to be completed when all four are destroyed.
06-22-2004, 01:05 AM#2
FrostCyrus
You simply just set up a quest requirement and a variable. Using an integer variable with an initial value of zero (cagecount) is used for my example. Have a trigger saying something like this;

Events
-A unit dies
Conditions
-Type of triggering unit equal to cage
Actions
-Set cagecount = (current value of cagecount + (1))
-Wait 1.00 seconds
-If/Then/Else multiple functions
--If
---Value of cagecount = 4
--Then
---Mark last created quest requirement (or desired one) as completed
--Else
---Do Nothing.

You can also have it complete the quest if that's the only requirement. You can also update your quest requirement if you want by adding something like this after "Set cagecount = (current value of cagecount + (1))"...

-Change quest requirement (last create quest requirement (or desired one)) to "You have killed (currect value of cagecount) cages."

And that should be it. Lemme know if you need more detail or specifics.
06-22-2004, 01:49 PM#3
FrostCyrus
Ok, you PM'd me asking more about variables and what not, so I'll do the best I can at explaining.

In your trigger editor, theres a little icon on the toolbar that looks like a yellow or dark orange "X". Click on this icon to create and modify variables. An integer variable is simply a number. Since it's a variable, you can change the value as much as you want using triggers during gameplay (hence the idea of a cagecount).

The reason behind setting the value of cagecount to it's previous value +1, is that it will constantly increase in number with cages killed until you reach the desired 4.
Say you've killed 2 cages already, and you're killing another one. Doing the trigger this way will make it so you only have to make one trigger instead of 4 separate ones. It also allows the players to not have to worry about killing the cages in order, such as the following trigger...

Events
-A unit dies
Conditions
-Unit equal to Cage 1014 (If a unit has a specific number after it, it's usually a specific unit you've picked on the map.)
Actions
-Set cagecount = 1

Then you'd have to have 3 more triggers doing basically the same thing, having the "last cage killed" set the value of 'cagecount' to 4. This can sometimes cause things you don't want to happen, like players killing the last cage first and finishing the quest prematurely, which you usually don't want to happen. That's why it's better to do...

Events
-A unit dies.
Conditions
- Unit TYPE of dieing unit equal to Cage. (A unit type makes it so it doesn't care which particular cage is killed, as long as it is a Cage)
Actions
-Set cagecount = Current value of cagecount + (1). (No matter what the current value of cagecount, it will increase by one. EXAMPLE: A cagecount value of -9 will increase +1 to -8)

When you're creating the 'cagecount' variable, set it's inital value to 0 just to make it easier on yourself when your checking it's value later, because you'll know it'll eventually end up on 4 later (instead of starting at -1432 or something and having to have the quest requirement condition need to read at -1436. It's easier to just do 0, 1, 2, 3, 4).


When setting the quest requirement for your quest, you usually want to assign variables to your quest and requirement so the game doesn't lose track of them later in play because of creation of other quests or requirements. Simply create a new variable of a different type ('CageQuest' and 'CageQuestREQUIREMENT' will be my examples). The variable type of CageQuest will simply be 'quest' instead of 'integer' like 'cagecount'. The reason is that we want to simply record the quest, not any numbers or anything like that (I'll explain how to 'record' in a bit). The variable type of 'CageQuestREQUIREMENT' is 'quest requirement'.

Upon map initialization (or whenever you're creating the quest) use a 'set variable' action right after you create your QUEST using something like this...

Events
-Initialization
Conditions
Actions
-Create an optional Quest with title 'QUEST'.
-Set CageQuest = last created quest.

This way you can refer to the quest as 'CageQuest' in later triggers instead of just simply the 'last created quest'. This helps a ton when you're doing multiple quests at the same time. Simply do the same thing with the quest requirement...

Events
-Initialization
Conditions
Actions
-Create a quest requirement for CageQuest labeled 'Kill 4 cages'.
-Set CageQuestREQUIREMENT = last created quest requirement.

Notice how I said make the requirement for 'CageQuest' and not 'last created quest'. This can only be done properly once the CageQuest variable has been properly set.

Events
-Initialization
Conditions
Actions
-Create an optional Quest with title 'QUEST'.
-Set CageQuest = last created quest.
-Create a quest requirement for CageQuest labeled 'Kill 4 cages'.
-Set CageQuestREQUIREMENT = last created quest requirement.


Using what I've explained here, you can create as many quests (or quest requirements for those quests) as you want.

If there's still something I need to explain, just say so again. :D