Hey guys, in this tutorial I'll explain the basics of creating an objective-oriented map and how to implement it properly in UGX Mod, so you won't get "You win!" thing when you die.
BASICS
Start a thread after maps\_zombiemode::main(); Example: At the end of your map script, add this: Now we'll go onto WaW's built-in objective system. WaW has some objective related functions but we'll focus on these for now:
USAGE OF FUNCTIONS
Usage of objective_add: Objective_add doesn't need to be called on anything or stuff. Objective_add adds an objective and also prints the new objective on screen (unless the state is invisible) Arguments: objectiveUniqueID = integer; every new objective needs to have an unique one, plus objective with id 1 will appear at the top and the higher the number, the lower in the objective list it will appear "state" = string; a state of the objective; valid states are "empty", "active", "invisible", "done", "current" and "failed" "text of the objective" = string; Simply the name of the objective Usage of objective_state: Objective_state doesn't need to be called on anything or stuff. Objective_state changes the state of an objective and prints "Objective Completed" if the state is "done" and "Objective Failed" if the state is "failed" (unless the state is invisible) Arguments: objectiveUniqueID = integer; every new objective needs to have an unique one, plus objective with id 1 will appear at the top and the higher the number, the lower in the objective list it will appear "state" = string; a state of the objective; valid states are "empty", "active", "invisible", "done", "current" and "failed" Usage of objective_string: Objective_string doesn't need to be called on anything or stuff. Objective_string changes the objective name and prints "Objective Updated" when it's executed unless the state is set to invisible Arguments: objectiveUniqueID = integer; every new objective needs to have an unique one, plus objective with id 1 will appear at the top and the higher the number, the lower in the objective list it will appear "text of the objective" = string; Simply the name of the objective
MAKING IT REALITY
Now let's go on and make our first objective! When the game starts, the players will be asked to turn the power on, that can be done with a few lines of code Was that so hard? Let's move on to something more advanced. The player will have to hit a trigger to complete an objective, let's call it "Advance to the town". This will also trigger gameover. First up, make a trigger_multiple in Radiant and give it a targetname "objective_trigger". Then do this. Now when you test it ingame, when you turn on the power and walk to the trigger, a gameover screen will appear saying "YOU WIN!" and plays a credit cinematic. This is cool, but "YOU WIN!" will also appear when you die and haven't done any of these objectives. UGX Mod has a variable called level.ugxm_comosea_win that when it's true, it shows the you win screen and when it false, it's just the normal endgame. Let's implement that. Now test it ingame and the "YOU WIN!" text shouldn't appear when you die. Now you just made your first objective-oriented map! Congratulations!
If you get a chance would you mind putting a picture up what what it looks like. If I am understanding this, I think what it will do is display the text of the objective until you complete it? Like a hud? Does it show a directional hud for your next objective or anything like that or just the text?
If you get a chance would you mind putting a picture up what what it looks like. If I am understanding this, I think what it will do is display the text of the objective until you complete it? Like a hud? Does it show a directional hud for your next objective or anything like that or just the text?
It makes it show the objectives when you press the TAB button ingame