- Joined
- Dec 30, 2007
- Messages
- 1,554
Instructions | |
This tutorial shows you how to create two different clocks. The first one is based on Lumber and Food and the second one is based on Food.
|
This Clock works like the clock in DotA. Every second the player will gain 1 Food, representing 1 second and each 60 second, they will be removed and replaced with 1 Lumber, representing 1 minute. Disadvantages: - Can’t use Lumber or Food in your map - All units must have 0 Lumber- and Food cost.
|
Food Clock Function |
Every second the player will gain 1 Max Capability, representing 1 second and each 60 second, they will be removed and replaced with 1 Used Food, representing 1 minute. Advantages: - You can use Lumber without a problem Disadvantages: - Can’t use Food in your map - All units must have 0 Food cost.
|
Lumber/Food Clock |
Now when we have an idea, let’s get started. Create a new Category and a new Trigger, name it “Clock”. Lumber/Food Clock Triggers Step I First we need an Event, which is repeated every second of the game. So let’s create a “Time – Periodic Event” that is repeated every second.
Press the button “New Event (CTRL+E)”.
Find the Trigger “Time – Time Elapsed”. This text will be shown: ”Elapsed game time is 5:00 seconds”, change 5:00 to 1:00. Trigger Explanation: This Event, is triggered every second that passes by. Step II Now when we have an Event, we must choose who’s going to be affected by the Event. And we want everyone to “gain” 1 second in their Food Section. So create a ”Player Group - Pick every player in Player Group and do Multiple Actions” action.
Press the button “New Action (CTRL+R)”.
Find the action “Player Group - Pick every player in Player Group and do Multiple Actions” This text will be shown: ”Pick every player in (All Players) and do Multiple Actions” Change nothing. Trigger Explanation: This action picks All Players and performs the following actions. Step III Now we have a loop that will be repeated each second of the game. We need an If/Then/Else action to check if we got more or less than 59 Seconds in our stock, so create a If/Else/Then action.
Press the button “Action (CTRL+R)”.
Find the action “If / Then / Else, Multiple Actions”. This text will be shown: ”If (All Conditions are True) then do (Then Actions) else do (Else Actions) Trigger Explanation: This action speaks for it self. If the Conditions are true, then the Then Actions will run, and if the Conditions are false, it will run the Else Actions. Step IV Now we need a Condition that checks if we got more or less than 59 seconds in stock. So create a Integer Comparison.
Press the button “New Condition (CTRL+D)”.
Find the Condition called: Interger Comparison. This text will be shown: (Number of units in (Units in (Playable map area))) Equal to 0 Change “Number of Units in (Units in (Playable Map Area)))” into “Player – Player Property”. From there, change Player 1 (Red) into the Function “Picked Player”. Change “Current Gold” into “Food Used”. Let Equal to stay. Change the value “0” into”59”. Trigger Explanation: This trigger checks if Picker Player (All Players) uses 59 Food or not. If it’s true, then it will activate the “Then Actions” in the If / Then / Else actions, but if it’s false, it will activate the “Else Actions”. Step V Now we have a Condition that checks if we have 59 Seconds, but we need some Actions so something really happens. We want the Trigger to either add 1 Seconds or to remove the current seconds and replace it with 1 Minute. So let’s create some Then – Actions. Side Note Then = when the Condition is true
Lumber to the Lumber Stock, but only if the Condition is true. First Trigger:
Press the button “New Action (CTRL+R)”. Find the action ”Player – Set Property” This text will be shown: ”Player - Set Player 1 (Red) Current gold to 750” Change “Player 1 (Red)” into “Picked Player” Change “Current Gold” into “Food used” Change the value “750” into “0” Now it should look like this: Player - Set (Picked player) Food used to 0 Second Trigger: Press the button “New Action (CTRL+R)”. Find “Player – Add Property” This text will be shown: ”Player - Add 1000 to Player 1 (Red) Current gold” Change the value “1000” into “1” Change Player 1 (Red) into “Picked Player” Change “Current Gold” into “Current Lumber” Now it should look like this: Player - Add 1 to (Picked player) Current lumber Trigger Explanations: First: This trigger simply removes all Food in stock for all players. Second: This trigger adds one Lumber to the Lumber stock. Step Final Right now, nothing will happen if the Condition is False, so we need to create a Else - Action that adds one Food each time the Condition is False.
Press the button “New Action (CTRL+R)”.
Find “Player – Add Property” This text will be shown: ”Player - Add 1000 to Player 1 (Red) Current gold” Change the value “1000” into “1” Change Player 1 (Red) into “Picked Player” Change “Current Gold” into “Food Used” Now it should look like this: ”Player - Add 1 to (Picked player) Food Used” Now the Trigger will add one Food for each time the Condition is False, and now the Trigger is complete and should look like this:
Optional: Game Interface – For Lumber/Food Clock Right now there’s a problem with our clock. If you scroll over Food or Lumber, it will still say: “Food – The amount of food you are using over the total amount you can currently sustain.” ![]() And that’s not really any “eye candy” now is it? So why not change the name of Lumber and Food in to something that fits? Step I Go to the Advanced and go to “Game Interface”. From here you go to “Text - General – Food” and change it to Seconds. Do the same with “Text - General – Lumber” and “Text General – Lumber:” but change them into Minutes and not seconds! Step II Now the “name” of Food and Lumber is renamed but it still shows the old information about Food and Lumber, so go to: “Text – General – Lumber is harvested from trees” and change it to something you like. I used: “The amount of minutes played.” After that, go to: “Text – General - The amount of food you are using over the total amount you can currently sustain.” and change it in to something you like as well. I used: “The amount of seconds played.” Now we have new information about Minutes and Seconds and the map looks much more serious than it did before. Step III But there’s still a few very annoying things left. Each time the clock reaches 51 seconds it will say: LOW UPKEEP And that’s not really something we want, so let’s remove it. Go to Advanced and go to “Game Constants”. Find “Upkeep – Food Levels” and change Low and Medium to 100. Now we have removed the annoying Upkeep message and our clock is nearly complete, but there’s still on thing that should be removed. Step Final We can still see the old icons for Wood and Food, and they are now minutes and seconds, so it still looks a bit weird. Let’s change that. Go to Advanced and go to “Game Interface”. Find “Icon – Food” and change it into: UI\Widgets\Console\Human\human-console-button-back-active.blp This will almost hide the Food button, but you will see a “blue” filter if you concentrate. To get a black space, download/make a plain black filter instead Find and Change “Icon – Lumber”, change it in to something you think fit. I used: ReplaceableTextures\Selection\SpellAreaOfEffect.blp because it almost looks like a “Blue Clock”. Now we have removed the ugly Lumber and Food icons and replaced them with two that fits better with our Clock System and should now look something like this: ![]() For more info about the Game Interface and Constants, go here: http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/game-interface-basics-39401/ |
Food Clock |
To do this Clock, do the Lumber/Food Clock first. It’s almost the exact same clock, so you won’t waste any time doing it, but do NOT fix the Game Interface just yet! When you’re done with the Lumber/Food Clock, you just need to change three triggers.
Begin with the Then Actions in the If / Then / Else action. The first one currently removes the current Food and adds 1 Lumber. We need to change that into Used and Capability Food. So, change the “Player - Set (Picked player) Food used to 0” into ”Player - Set (Picked player) Food cap to 0” . and then change the ” Player - Add 1 to (Picked player) Current lumber” into ”Player - Add 1 to (Picked player) Food used” Now the Then system is done and should look like this:
Now we just need to change the Else part, so change ”Player - Add 1 to (Picked player) Food used” into “Player - Add 1 to (Picked player) Food cap”
to make it look better, and it should look like this:
Optional: Game Interface – For Food Clock Right now there’s a problem with our clock. If you scroll over Food Section, it will still say: “Food – The amount of food you are using over the total amount you can currently sustain.” ![]() And that’s not really any “eye candy” now is it? So why not change the name of Food in to something that fits? Step I Go to the Advanced and go to “Game Interface”. From here you go to “Text - General – Food” and change it to Time. Step II Now the “name” of Food is renamed but it still shows the old information about Food, so go to: “Text – General - The amount of food you are using over the total amount you can currently sustain.” and change it in to something you like as well. I used: “ The time passed; Minutes and Seconds.” Now we have new information about the time and the map looks much more serious than it did before. Step III But there’s still a few very annoying things left. Each time the clock reaches 51 “minutes” it will say: LOW UPKEEP And that’s not really something we want, so let’s remove it. Go to Advanced and go to “Game Constants”. Find “Upkeep – Food Levels” and change Low and Medium to 100. Now we have removed the annoying Upkeep message and our clock is nearly complete, but there’s still on thing that should be removed. Step Final We can still see the old icon for Food, and it’s suppose to look like minutes and seconds, so it still looks a bit weird. Let’s change that. Go to Advanced and go to “Game Interface”. Find “Icon – Food” and change it into: ReplaceableTextures\Selection\SpellAreaOfEffect.blp This icon almost looks like a “Blue Clock” and fits well, but you can download a icon if you think that fits better! Now we have removed the ugly Food icon and replaced it with one that fits better with our Clock System and should now look something like this: ![]() For more info about the Game Interface and Constants, go here: http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/game-interface-basics-39401/ |
Updates and Extras | |
|
3 November – 21:00 Made some major changes in the Tutorial. In general, the Tutorial should be easiler to understand.
- New Layout - Added a new Clock - A new "helper"; How-To boxes - Minor fixes; such as gramma. |
Test Maps |
Food/Lumber Clock - View attachment Food-Lumber Clock System.w3x Food Clock - View attachment Food Clock System.w3x |
Editor Notes |
I've done this from scratch and everything is done by me, but I had some help from Dr.Boom and I used DOTAs' clock as a reference to make it (Lumber/Food). This tutorial was written in a way so everyone should be able understand it, that's why it's so long. Regards Arowanna |
Last edited: