R4bitF00t Posted February 1, 2024 Share Posted February 1, 2024 (edited) 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 Creating goals.xml Defining Goals Working with Goals Simple Objectives Timer Based Objectives Counter Based Objectives Next Chapter • Creating goals.xml 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. Now, we are ready to define our goals. • Defining Goals 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. 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. 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. Same as with the <mapgoals>, the individual goals are defined between the <goal> and </goal> pointers. Inside the <goal> parenthesis, we can declare some additional parameters for our goal. 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. 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 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. 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. 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. Timer Based Objectives With timer based objectives, you use these actions. 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. 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. • Next Chapter 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 • Edited August 19, 2024 by R4bitF00t Metagross31 likes this Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now