Jump to content

Map Editor Tutorial - Creating Goals


R4bitF00t

Recommended Posts

logo.png.2daaf617449a0c9e1c637ec4ce05d03a.png

Hello there!

Working with goals properly needs some additional setup. Goals use an .xml file with it's own formatting and sctructure.
Luckily, you only need to create the goal file once per map.

Now, let's see about these goals.

 

If you encounter any issues, don't hesitate to ask in Skylords Reborn Map Making Discord.

 

 Content

splitter.png.b88958376f2b49606f513de34d9a3733.png

  • Creating goals.xml
  • Defining Goals
  • Working with Goals
    • Simple Objectives
    • Timer Based Objectives
    • Counter Based Objectives
  • Next Chapter

 

 Creating goals.xml

splitter.png.b88958376f2b49606f513de34d9a3733.png

To work with goals, we first need to define them.
We do that in an .xml file named goals.

Create a text file in the map folder (outside of any of the other folders inside) and name it goals.xml.

image.png

Now, we are ready to define our goals.

 

 

 Defining Goals

splitter.png.b88958376f2b49606f513de34d9a3733.png

I will give you an example goals.xml file, so you have a backup to fall back to.

goals.xml

Since I don't have the proper knowledge of .xml files, I will at least explain to you what the parameters do, to the best of my knowledge.

image.png

Upon closer examination, you can see that, again, the file is divided into logical chunks.

First line declares what version and encoding we use for the file - just copy this into every other goals.xml file you create.

image.png

Then, we need a defined space to put our goals in.
This space starts with
<mapgoals> and ends with </mapgoals> and inside it, we define our goals.

image.png

Same as with the <mapgoals>, the individual goals are defined between the <goal> and </goal> pointers.

image.png

Inside the <goal> parenthesis, we can declare some additional parameters for our goal.

image.png

The only parameter you truly need is the tag parameter. Without it, you cannot reference the goal in your scripts. The other parameters are optional.
Let's look at them now.

  • sortorder - defines the sort order of the objective, lower numbers will appear higher in the objective list
  • timeleft_colorchange - when you use the goal as a timer, this defines when the timer will change color, signalling it is running out
  • musictype - defines whether the timer will use special "time is running out" music, it is unconfirmed if this works
  • positivetimer - defines whether the timer is positive - such as reinforcements arriving, or negative - such as enemies arriving, or map loss upon timer expiration
  • goalletter - here you define which letter the goal will use in-game, this increases clarity
  • targettag - references a tag, or a script group, the goal markers will appear over these entities on the minimap, with the set goalletter
  • hint - I don't know what this does, never used it

Then, inside the <goal> and </goal> area, we define the text that is displayed in the objective list for each language.

image.png

Every line starts with <text language = "xx"> and ends with </text> with the goal text written between these.

You need to define one language for each line - en, de, fr, ru, and write the objective text - in each language, if possible, but you can write everything in English if you don't speak the language.

Now that we have set up the goals file, we will look at how you work with goals in scripts.

 

 

 Working with Goals

splitter.png.b88958376f2b49606f513de34d9a3733.png

Simple Objectives

There are a lot of actions and conditions that work with goals.

You can set any goal to be a simple objective, timer based objective, or a counter based objective.

These are the basic actions used with objectives.

image.png

  • MissionTaskSetActive - activates a goal as a simple objective - no timer, no counter
  • MissionTaskSetFailed - fails a task, be it simple objective, timed objective, or counter based objective, also removes it from the objective list
  • MissionTaskSetSolved - completes a task succesfully, be it simple, timed, or counter based, also removes it from the objective list
  • MissionTaskRemove - removes a task from the objective list, without any message to the players

 

You only need to use two parameters. The Player parameter and the TaskTag parameter.
With the Player parameter, you declare which players are affected by the task - meaning you can have different tasks for different players.
The
TaskTag parameter references the tag, that you set for the goal in the goals.xml.

image.png

The text of the objectives in the objective list is determined in the goals.xml file. So you don't need the Summary and Description parameters.

image.png

 

Timer Based Objectives

With timer based objectives, you use these actions.

image.png

  • MissionTimerStart - starts a timed objective and makes it active in the objective list
  • MissionTimerStop - stops a timed objective and removes it from the objective list
  • MissionTimerPause - pauses a timer until MissionTimerResume is called
  • MissionTimerResume - resumes a paused timer
  • MissionTimerChange - changes the text of the timed objective, for text of another objective and keeps the remaining time

You can use the same actions of MissionTaskSetFailed, MissionTaskSetSolved and MissionTaskRemove as you do with the basic objectives.

 

Counter Based Objectives

With counter based objectives, use these actions.

image.png

  • MissionCounterShow - shows the objective in the objective list with a max value (such as 0/10)
  • MissionCounterHide - hides the objective from the list
  • MissionCounterSet - sets the counter to a given value
  • MissionCounterIncrease - increases the objective counter by one
  • MissionCounterDecrease - decreases the objective counter by one
  • MissionCounterSetToHealthPercent - sets the counter to display percentual current health of a tagged entity - DOES NOT UPDATE AUTOMATICALLY, you will need to use, for example, an OnIntervalEvent where you will execute this action periodically

As with the previous objective types, MissionTaskSetFailed, MissionTaskSetSolved and MissionTaskRemove work as you would expect.

The MissionCounterSetToHealthPercent is a bit special. It doesn't update automatically, so you need ideally an OnIntervalEvent that calls this action periodically.
You also need the 
MissionCounterShow action and set the MaxValue parameter to 100 (as 100% is full health).

 

Here is an example of each of the different types of objectives.

image.png

image.png

image.png

 

 Next Chapter

splitter.png.b88958376f2b49606f513de34d9a3733.png

This concludes the Creating Goals chapter.

In the next chapter, we will look at which scripts the game automatically loads, and how you can create your custom scripts, not tied to any entity.

 

 Default Script Files 

 

Middle_splitter.png.a770f452e94ed383c001e9d7af974010.png

Edited by R4bitF00t
Metagross31 likes this
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use