- Joined
- May 9, 2007
- Messages
- 3,563
Is a collection of GUI, systems that I have refined throughout my GUI career. I'm now moving on to JASS, and thought that I would share some of this knowledge. I plan to have a large collection of systems. I realize that a few of these may already be done, but I believe that mine are improvements/refinements in some cases.
If there is a specific topic you are interested in having covered, please just tell me and I'll do my best.
Completed Systems:
* Setting Integers Through Chat (Completed)
In Development:
* Victory Conditions 101
This tutorial teaches and explains how to construct a system, that when the player types a chat string, followed by a collection of numbers, a variable is set to the value of the entered numbers. I'll explain how to add a cap to the maximum as well. This tutorial is very simple but goes into a lot of detail. Remember to add a space after "-number "
Is a simple way of doing it. Now, I'll de-construct it, explain and improve.
There are however some issues with this message. What I will revise it to will look like this:
Now, I'll break it down again.
Now, one last thing:
Adding a ceiling.
Lets take a more detailed look.
With the addition of a simple if/then/else the ceiling (maximum value) is added. If you want it so that it has no effect, then just leave the area blank. Instead of re-setting the variable.
You could replace the integer with a real if you wanted, just change the variable type and all of the conversions.
This wraps up my tutorial here. I hope that you enjoyed it, and that you find it useful. If you think that I need to improve something, or have found a bug, then please contact me.
Thanks to PurplePoot for pointing out a further refinement.
~Updated Demo Map. Now has add gold, and spawn.
~Changed if/then/else to condition
~Fixed Error with order of ceiling in demo
~hawk900
If there is a specific topic you are interested in having covered, please just tell me and I'll do my best.
Completed Systems:
* Setting Integers Through Chat (Completed)
In Development:
* Victory Conditions 101
Setting Integers Through Chat
This tutorial teaches and explains how to construct a system, that when the player types a chat string, followed by a collection of numbers, a variable is set to the value of the entered numbers. I'll explain how to add a cap to the maximum as well. This tutorial is very simple but goes into a lot of detail. Remember to add a space after "-number "
Variables
- YourInteger
- And Later: YourInteger[]
Poorly Done Version
-
Trigger
-
Events
- Player - Player 1 (Red) types a chat message containing -number as A substring
- Conditions
-
Actions
- Set YourInteger = (Integer((Substring((Entered chat string), 9, 12))))
- Game - Display to (Player group((Triggering player))) the text: (YourInteger now = + (String(YourInteger)))
-
Events
De-Construction
Is a simple way of doing it. Now, I'll de-construct it, explain and improve.
- Player - Player 1 (Red) types a chat message containing -number as A substring
- Set YourInteger = (Integer((Substring((Entered chat string), 9, 12))))
- (Game - Display to (Player group((Triggering player))) the text: (YourInteger now = + (String(YourInteger)))
Getting Better!
There are however some issues with this message. What I will revise it to will look like this:
-
Trigger
-
Events
- Player - Player 1 (Red) types a chat message containing -number as A substring
- Player - Player 2 (Blue) types a chat message containing -number as A substring
- Player - Player 3 (Teal) types a chat message containing -number as A substring
- Player - Player 4 (Purple) types a chat message containing -number as A substring
- Player - Player 5 (Yellow) types a chat message containing -number as A substring
- Player - Player 6 (Orange) types a chat message containing -number as A substring
- Player - Player 7 (Green) types a chat message containing -number as A substring
- Player - Player 8 (Pink) types a chat message containing -number as A substring
- Player - Player 9 (Gray) types a chat message containing -number as A substring
- Player - Player 10 (Light Blue) types a chat message containing -number as A substring
- Player - Player 11 (Dark Green) types a chat message containing -number as A substring
- Player - Player 12 (Brown) types a chat message containing -number as A substring
-
Conditions
- (Substring((Entered chat string), 1, 8)) Equal to -number
-
Actions
- Set YourInteger[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 9, 12))))
- Game - Display to (Player group((Triggering player))) the text: ((|c00FFFF00 + (String(YourInteger[(Player number of (Triggering player))]))) + |r)
-
Events
De-Construction
Now, I'll break it down again.
-
Events
- Player - Player 1 (Red) types a chat message containing -number as A substring
- Player - Player 2 (Blue) types a chat message containing -number as A substring
- Player - Player 3 (Teal) types a chat message containing -number as A substring
- Player - Player 4 (Purple) types a chat message containing -number as A substring
- Player - Player 5 (Yellow) types a chat message containing -number as A substring
- Player - Player 6 (Orange) types a chat message containing -number as A substring
- Player - Player 7 (Green) types a chat message containing -number as A substring
- Player - Player 8 (Pink) types a chat message containing -number as A substring
- Player - Player 9 (Gray) types a chat message containing -number as A substring
- Player - Player 10 (Light Blue) types a chat message containing -number as A substring
- Player - Player 11 (Dark Green) types a chat message containing -number as A substring
- Player - Player 12 (Brown) types a chat message containing -number as A substring
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Substring((Entered chat string), 1, 8)) Equal to -number
-
If - Conditions
-
Then - Actions
- Set YourInteger[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 9, 12))))
- Game - Display to (Player group((Triggering player))) the text: ((|c00FFFF00 + (String(YourInteger[(Player number of (Triggering player))]))) + |r)
Adding a Ceiling
Now, one last thing:
Adding a ceiling.
-
Trigger
-
Events
- Player - Player 1 (Red) types a chat message containing -number as A substring
- Player - Player 2 (Blue) types a chat message containing -number as A substring
- Player - Player 3 (Teal) types a chat message containing -number as A substring
- Player - Player 4 (Purple) types a chat message containing -number as A substring
- Player - Player 5 (Yellow) types a chat message containing -number as A substring
- Player - Player 6 (Orange) types a chat message containing -number as A substring
- Player - Player 7 (Green) types a chat message containing -number as A substring
- Player - Player 8 (Pink) types a chat message containing -number as A substring
- Player - Player 9 (Gray) types a chat message containing -number as A substring
- Player - Player 10 (Light Blue) types a chat message containing -number as A substring
- Player - Player 11 (Dark Green) types a chat message containing -number as A substring
- Player - Player 12 (Brown) types a chat message containing -number as A substring
-
Conditions
- (Substring((Entered chat string), 1, 8)) Equal to -number
-
Actions
- Set YourInteger[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 8, 99))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- YourInteger[(Player number of (Triggering player))] Greater than or equal to 500
-
Then - Actions
- Set YourInteger[(Player number of (Triggering player))] = 500
- Game - Display to (Player group((Triggering player))) the text: ((|c00FFFF00 + (String(YourInteger[(Player number of (Triggering player))]))) + |r)
-
Else - Actions
- Set YourInteger[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 9, 12))))
- Game - Display to (Player group((Triggering player))) the text: ((|c00FFFF00 + (String(YourInteger[(Player number of (Triggering player))]))) + |r)
-
If - Conditions
-
Events
De-Construction
Lets take a more detailed look.
-
If - Conditions
- YourInteger[(Player number of (Triggering player))] Greater than to 5000
-
Then - Actions
- Set YourInteger[(Player number of (Triggering player))] = 5000
With the addition of a simple if/then/else the ceiling (maximum value) is added. If you want it so that it has no effect, then just leave the area blank. Instead of re-setting the variable.
Additional Notes
You could replace the integer with a real if you wanted, just change the variable type and all of the conversions.
This wraps up my tutorial here. I hope that you enjoyed it, and that you find it useful. If you think that I need to improve something, or have found a bug, then please contact me.
Thanks to PurplePoot for pointing out a further refinement.
~Updated Demo Map. Now has add gold, and spawn.
~Changed if/then/else to condition
~Fixed Error with order of ceiling in demo
~hawk900
Attachments
Last edited: