Objectives Editor

From The DarkMod Wiki
Revision as of 07:34, 9 September 2008 by Greebo (talk | contribs) (categorised)
Jump to navigationJump to search

Written by HappyCheeze

The objectives editor is a very useful tool located inside Darkradiant (Version 0.9.7 or later) that allows the map author to set objectives or goals that the player must do in order to win the level. The opposite is also true, the author can set restrictions that the player must adhere to, or will fail the mission.


To access the objectives editor once inside Darkradiant, click the pull-down menu Map>Objectives... Objmenu.png


Upon clicking you will see a separate window that looks like this.

Objedblank.png



To start things off, click the +add.pngButton

Msnobjadd.png

This will create an Entity that stores all of the objectives information that will you be editing.



Now we've spawned our objectives entity,

Objentity.png

Notice the numbers in the “[]”'s. Those are the entities' coordinates on the map. These numbers will most likely be different from yours. When the objectives entity spawns it is placed randomly around the origin (As of 0.9.7 this is how it is, it might change in future versions, but for now this is how it is).

*Note:Be mindful that sometimes this entity will spawn outside your map and into the void. This will cause a leak, so look around the origin.

Now we're ready to start adding some objectives.

Click the second +add.png Button



Newobj1.png

Under Objectives you'll notice theres a new Objective.

Click it and than click Edit.png


This will bring up this window.

Editobj.png


Now we're editing our first objective. It may seem a little confusing at a first glance but a lot of it is self explanitory and a little practice will take you a long way.

So what do all these various lines and checkboxes do? They effect the objective components at the bottom.

What do they all mean?

Description: This what the player will read in the objectives menu. For example: “Steal the scepter”, “Don't kill any guards”, “Get back to where you entered the warehouse”. Its explaining what you want to player read so he/she knows what to do. A good rule to follow is to make them short and to the point.

Difficulty:These refer to Easy/Medium/Hard difficulty levels. If the author wishes, they can be different for each difficulty. For example: on Hard difficulty the player will have to avoid being seen. On Easy the player will only have to steal 200 gold at the minimum. All Levels means that the objectives that are checked under this will be there regardless of difficulty.

Initial State:This is the condition of the objective at mission start. There are four options. Complete, Incomplete, Invalid, Failed. Typically the objective will be incomplete and the player has to complete it in-game to fulfil the objective.

Flags:

Mandatory means the objective in question is necessary to complete the game. If it is unchecked than the objective will be optional.

Ongoing means that the objective won't show completion until the end of the mission.

Irreversible means that once the objective is done it will not UNcheck even if logically in the game it becomes no longer true. Example: get a special object. If the player later drops it normally the objective will then UNcheck because the player no longer has got it. But sometimes you don't want it to reverse. Example: get magic skull. New objective: throw it in magic pool. Player no longer has 'got' the skull so normally it would then UNcheck the objective. Make it irreversible and it won't. Another example is to go to a location. If the player then leaves it would UNcheck so make it irreversible.

Visible means that objective will be visible in the objectives menu ingame. If unchecked than there will be no objective shown. (The objective will still work, it just won't show up in the menu).

*Tip: The "Visible" Box isn't checked by default yet, so try to get in the habit of checking it with each objective you want visible.

Enabling Objectives, Logic and Scripts: Under Construction

Components: These are the type of objective you want, eg, steal, kill - or rather 'types' because each objective can have more than one (eg, go to exit A or go to exit B or it could be go to exit A AND go to exit B!) These type components are used by the editor to specify what objectives need to be done. The map author can choose from a variety of options under Type with varying degrees of specification. For example: Knocking out an AI named "Roy". Not being seen by the ANY enemy. (less examples, should cover this in the coming up tutorial.)

Components Flags:Components have their own special flags as well.

Satisfied at Start:For some objectives it makes sense to have them done at start. For example: Not killing anyone.

Irreversible:One the objective has reached a certain state, it will stay that way and not change. (more elaboration, an example?)

Boolean NOT:Adds "NOT" to your component so the player has to do the opposite of said objective. For example: Do NOT kill any AI on team 2.

Player Responsible:The player MUST follow through with the objective himself. For example:The player must kill the zombie to complete the objective, instead of letting something else take care of it.

Now it might seem a bit crazy trying to take all of this in at once, so lets start with something easy.

Tutorial

*Note:This tutorial is assuming you've learned the basics for using Darkradiant.

You should already be in Darkradiant. Start a new map if you're in an existing one.

We'll start with the basic cube room. Nothing fancy, just make a room, stick in a player start, a light and plaster on some textures.

Cube.png

For this tutorial, our player is going to have to knock out a guard and steal a trophy.

So lets start with adding the AI, I chose atdm:ai_citywatch. Select him, go into the entity editor ("N") and change his NAME to "Roy" (without quotes).


Now its time to open up our objectives editor.


Objmenu.png

Now as you just learned, click add, click the target_tdm_addobjectives_1 and click add again.

The Edit Objective window should be open now. Clear the text under Description and type in "Knock out the guard". Set the initial state to 'Complete'. Check the Mandatory and Visible flags.

*Note: Although Initial state refers to the state the objective is at start, it is reversed right now and in the
process of being fixed. So for now, you have to set the state to what you want the outcome to  be. 9/6

Time for a new step, click the +add.png button under Components and the word "Kill" should appear. Select it and you will see some more options. Under Type select "AI is knocked out".

under Knockout target: select "Name of single entity" and type in the box to the right of it, "roy" (without quotes). Set amount to 1.

Now compare your screen to this, it should be the same.

Editprogress.png

If all looks good than click OK.

Its always a good idea to test things to make sure everything is running right. So save your map, get into TDM and load your map.

First, hit ESC and click Objectives. You should see your objective onscreen. Onjyes.png

*NOTE:If you don't see it on screen, you probably forgot to check the Visible box.

Now its time to test your objective. Exit out of the objectives menu and launch a gas arrow or use the blackjack on poor Roy. When he goes down you should see the words "Objective Complete" appear onscreen and since thats the only objective we've added so far you'll win the mission.

*NOTE:If you don't win nor see the on screen message, go back and try to figure what you did wrong.

If all is well than its time to move on. Exit TDM and go back into Darkradiant.

Now it is time to add the trophy. In your map add a trophy somewhere, I used the entity loot>atdm:loot_trophy_old change its name to "trophy" and go back into objectives editor.

Add another objective and edit it. 'Description should be Steal the Trophy. State is Complete, Flags should be Mandatory and Visible. Click ADD and select Player possesses item. Change Item: to Name of single entity and type in the box to right, "trophy". Change the amount to "1".

Your objective should look like this.

Trophyedit.PNG

Since this is a tutorial this map is very small and very basic so we are tossing all pre-thought and planning for the objectives out the window. As maps get bigger, more elaborate, complex, so too will the objectives be to suit the level. You might want to the trophy in a vault. Maybe the guards will be patrolling.

Save your map and load it up in TDM. Look at the objectives menu to see if the fresh addition is there. And than take it and see if it completes the objective.

Congratulations!

You now have a basic understanding of how the objectives editor works. For more advanced work, look for more tutorials in the future or go on the forums.

FAQ

Q:If I kill the guard I don't fail the mission, but I can't complete it either.

A:I'll quote Ishtvan for this one.

"The system is not smart enough to know automatically that someone who's killed can't be KO'd later, so if you want it to fail when they're killed, you have to put that in specifically. Note that this doesn't have to be a whole 'nother objective, it can be a component of the KO objective, so you have two components, KO them, and don't kill them. We could potentially make this automatic later on, but that's the way it is right now."

Until this is fixed, I'd recommend making a knockout objective optional, unless you want to put in the kill component.


Q:I put a monster in my map and he killed the guard, yet I still passed/failed the objective.

A:Check the Player Responsible Flag, this means that the player MUST do it himself in order to get credit.


Q:Help! My objectives entity is outside the map and I have a leak! I can't find it! I even used the pointfile!! help!!!!

A:The objectives entity is a very small, yellow cube that is spawned around the origin. Its about the size of a light entity.


Q:I have some other questions about objectives

A:This article talks about more specific, more technical and advanced work. Objectives