• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Command Systemv1.04

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
[font=+1]
What is command ?[/font]

Command is an instruction to a computer or device to perform a specific task. Commands come in different forms. They can be:
-special words (keywords) that a program understands.
-function keys
-choices in a menu
-buttons or other graphical objects on your screen
Every program that interacts with people responds to a specific set of commands. The set of commands and the syntax for entering them is called the user interface and varies from one program to another.



[trigger=Colour Counter]
Color Counter
Events
Conditions
Actions
-------- Colour [1] stand by colour player one . And the code stand by red colour . --------
Set Colour[1] = |c00ff0303
Set Colour[2] = |c000042ff
Set Colour[3] = |c001ce6b9
Set Colour[4] = |c00540081
Set Colour[5] = |c00fffc01
Set Colour[6] = |c00feba0e
Set ColourEnd = |r
-------- More colour code can be find at www.hiveworkshop.com . --------
[/trigger]


[trigger=Change name]
Change name
Events
Player - Player 1 (Red) types a chat message containing -name as A substring
Player - Player 2 (Blue) types a chat message containing -name as A substring
Player - Player 3 (Teal) types a chat message containing -name as A substring
Player - Player 4 (Purple) types a chat message containing -name as A substring
Player - Player 5 (Yellow) types a chat message containing -name as A substring
Player - Player 6 (Orange) types a chat message containing -name as A substring
Conditions
(Substring((Entered chat string), 1, 7)) Equal to -name
Actions
-------- Name of (Triggering player) stand for previous name . Substring (Entered chat string) stand for new name that entered just now. --------
Game - Display to (All players) the text: ((Colour[(Player number of (Triggering player))] + ((Name of (Triggering player)) + ColourEnd)) + ( change his name to + (Colour[(Player number of (Triggering player))] + ((Substring((Entered chat string), 7, 26)) + ColourEnd))))
-------- Name can just contain 20 word . If you want more , increase the value of 26. --------
Player - Set name of (Triggering player) to (Substring((Entered chat string), 7, 26))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 7, 26)) Equal to <Empty String>
Then - Actions
Skip remaining actions
Else - Actions
[/trigger]



  • Zoom
    • Events
      • Player - Player 1 (Red) types a chat message containing -zoom as A substring
      • Player - Player 2 (Blue) types a chat message containing -zoom as A substring
      • Player - Player 3 (Teal) types a chat message containing -zoom as A substring
      • Player - Player 4 (Purple) types a chat message containing -zoom as A substring
      • Player - Player 5 (Yellow) types a chat message containing -zoom as A substring
      • Player - Player 6 (Orange) types a chat message containing -zoom as A substring
    • Conditions
    • Actions
      • Set Real[1] = (Real((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
      • Camera - Set (Triggering player)'s camera Distance to target to Real[1] over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[1] Less than 1200.00
        • Then - Actions
          • -------- The minimum value is 1200.Change "1200" if you want the minimum value become lower --------
          • Camera - Set (Triggering player)'s camera Distance to target to 1200.00 over 0.00 seconds
          • Game - Display to (All players) the text: The minimum distanc...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[1] Greater than 3600.00
        • Then - Actions
          • -------- The Maximum value is 3600 .Change "3600" if you want the maximum value become higher. --------
          • Camera - Set (Triggering player)'s camera Distance to target to 3600.00 over 0.00 seconds
          • Game - Display to (All players) the text: The maximum value i...
        • Else - Actions


  • Change Angle
    • Events
      • Player - Player 1 (Red) types a chat message containing -angle as A substring
      • Player - Player 2 (Blue) types a chat message containing -angle as A substring
      • Player - Player 3 (Teal) types a chat message containing -angle as A substring
      • Player - Player 4 (Purple) types a chat message containing -angle as A substring
      • Player - Player 5 (Yellow) types a chat message containing -angle as A substring
      • Player - Player 6 (Orange) types a chat message containing -angle as A substring
    • Conditions
    • Actions
      • Set Real[2] = (Real((Substring((Entered chat string), 8, (Length of (Entered chat string))))))
      • Camera - Set (Triggering player)'s camera Angle of attack to Real[2] over 0.00 seconds
      • -------- Angle 300 to 360 is front view. In other word is 0 degree to 90 degree after 90 degree will upside down. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[2] Less than 300.00
        • Then - Actions
          • -------- 300 is the normal angle . Delete this if you don want. --------
          • Camera - Set (Triggering player)'s camera Angle of attack to 300.00 over 0.00 seconds
          • Game - Display to (Player group((Triggering player))) the text: You can only change...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[2] Greater than 360.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Angle of attack to 360.00 over 0.00 seconds
          • Game - Display to (Player group((Triggering player))) the text: You can only change...
        • Else - Actions


  • Rotation
    • Events
      • Player - Player 1 (Red) types a chat message containing -rotate as A substring
      • Player - Player 2 (Blue) types a chat message containing -rotate as A substring
      • Player - Player 3 (Teal) types a chat message containing -rotate as A substring
      • Player - Player 4 (Purple) types a chat message containing -rotate as A substring
      • Player - Player 5 (Yellow) types a chat message containing -rotate as A substring
      • Player - Player 6 (Orange) types a chat message containing -rotate as A substring
    • Conditions
    • Actions
      • -------- To change back the normal angle . Type -rotate 90 . --------
      • Set Real[3] = (Real((Substring((Entered chat string), 9, (Length of (Entered chat string))))))
      • Camera - Set (Triggering player)'s camera Rotation to Real[3] over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[3] Less than 0.00
        • Then - Actions
          • Game - Display to (All players) the text: You can only rotate...
          • Camera - Set (Triggering player)'s camera Rotation to 0.00 over 0.00 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[3] Greater than 360.00
        • Then - Actions
          • Game - Display to (All players) the text: You can only rotate...
          • Camera - Set (Triggering player)'s camera Rotation to 360.00 over 0.00 seconds
        • Else - Actions




  • AllRandom
    • Events
      • Player - Player 1 (Red) types a chat message containing -ar as An exact match
      • Player - Player 1 (Red) types a chat message containing -allrandom as An exact match
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Selection - Select Heroes[Random] for (Player((Integer A)))
          • Selection - Select Heroes[Random] for (Player((Integer A)))


  • Movespeed
    • Events
      • Player - Player 1 (Red) types a chat message containing -ms as An exact match
      • Player - Player 2 (Blue) types a chat message containing -ms as An exact match
      • Player - Player 3 (Teal) types a chat message containing -ms as An exact match
      • Player - Player 4 (Purple) types a chat message containing -ms as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -ms as An exact match
      • Player - Player 6 (Orange) types a chat message containing -ms as An exact match
    • Conditions
    • Actions
      • Set UnitGroup = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Game - Display to (Player group((Triggering player))) the text: (Colour[(Player number of (Owner of (Triggering unit)))] + (((Name of (Triggering unit)) + ColourEnd) + ( movement speed is + (String((Current movement speed of (Picked unit)), 4, 3)))))



[jass=host]function GetHost takes nothing returns nothing
local gamecache g = InitGameCache("Map.w3v")
call StoreInteger ( g, "Your Map's Name", "Host", GetPlayerId(GetLocalPlayer ())+1)
call TriggerSyncStart ()
call SyncStoredInteger ( g, "Your Map's Name", "Host" )
call TriggerSyncReady ()
set udg_host = Player( GetStoredInteger ( g, "Your Map's Name", "Host" )-1)
call FlushGameCache( g )
set g = null
endfunction
[/code]


[trigger=Detect Host]Host
Events
Player - Player 1 (Red) types a chat message containing -host as An exact match
Player - Player 2 (Blue) types a chat message containing -host as An exact match
Player - Player 3 (Teal) types a chat message containing -host as An exact match
Player - Player 4 (Purple) types a chat message containing -host as An exact match
Player - Player 5 (Yellow) types a chat message containing -host as An exact match
Player - Player 6 (Orange) types a chat message containing -host as An exact match
Conditions
(Substring((Entered chat string), 1, 5)) Equal to -host
Actions
Custom script: call GetHost()
Game - Display to (All players) the text: (Host is + (Colour[(Player number of host)] + ((Name of host) + ColourEnd)))
[/trigger]




[Trigger=Hero Select (Player 1 )]P1 Select
Events
Player - Player 1 (Red) Selects a unit
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to SelectedHero[1]
(Triggering unit) Not equal to Random Hero 0020 <gen>
(Choose Hero <gen> contains (Triggering unit)) Equal to True
Then - Actions
Unit - Change ownership of (Triggering unit) to Player 1 (Red) and Change color
Unit - Move (Triggering unit) instantly to (Player 1 (Red) start location)
Camera - Pan camera for Player 1 (Red) to (Position of (Triggering unit)) over 0.00 seconds
Trigger - Turn off (This trigger)
Else - Actions
Set SelectedHero[1] = (Triggering unit)
[/trigger]
[trigger=Player 2]
P2 Select
Events
Player - Player 2 (Blue) Selects a unit
Conditions
(Triggering unit) Not equal to Random Hero 0020 <gen>
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to SelectedHero[2]
(Choose Hero <gen> contains (Triggering unit)) Equal to True
Then - Actions
Unit - Change ownership of (Triggering unit) to Player 2 (Blue) and Change color
Unit - Move (Triggering unit) instantly to (Player 2 (Blue) start location)
Camera - Pan camera for Player 2 (Blue) to (Position of (Triggering unit)) over 0.00 seconds
Trigger - Turn off (This trigger)
Else - Actions
Set SelectedHero[2] = (Triggering unit)
[/trigger]
[Trigger=Player 3]
P3 Select
Events
Player - Player 3 (Teal) Selects a unit
Conditions
(Triggering unit) Not equal to Random Hero 0020 <gen>
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to SelectedHero[3]
(Choose Hero <gen> contains (Triggering unit)) Equal to True
Then - Actions
Unit - Change ownership of (Triggering unit) to Player 3 (Teal) and Change color
Unit - Move (Triggering unit) instantly to (Player 3 (Teal) start location)
Camera - Pan camera for Player 3 (Teal) to (Position of (Triggering unit)) over 0.00 seconds
Trigger - Turn off (This trigger)
Else - Actions
Set SelectedHero[3] = (Triggering unit)
[/trigger]
[trigger=Player 4]
P4 Select
Events
Player - Player 4 (Purple) Selects a unit
Conditions
(Triggering unit) Not equal to Random Hero 0020 <gen>
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to SelectedHero[4]
(Choose Hero <gen> contains (Triggering unit)) Equal to True
Then - Actions
Unit - Change ownership of (Triggering unit) to Player 4 (Purple) and Change color
Unit - Move (Triggering unit) instantly to (Player 4 (Purple) start location)
Camera - Pan camera for Player 4 (Purple) to (Position of (Triggering unit)) over 0.00 seconds
Trigger - Turn off (This trigger)
Else - Actions
Set SelectedHero[4] = (Triggering unit)
[/trigger]
[trigger=Player 5]
P5 Select
Events
Player - Player 5 (Yellow) Selects a unit
Conditions
(Triggering unit) Not equal to Random Hero 0020 <gen>
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to SelectedHero[5]
(Choose Hero <gen> contains (Triggering unit)) Equal to True
Then - Actions
Unit - Change ownership of (Triggering unit) to Player 5 (Yellow) and Change color
Unit - Move (Triggering unit) instantly to (Player 5 (Yellow) start location)
Camera - Pan camera for Player 5 (Yellow) to (Position of (Triggering unit)) over 0.00 seconds
Trigger - Turn off (This trigger)
Else - Actions
Set SelectedHero[5] = (Triggering unit)
[/trigger]
[trigger=Player 6]
P6 Select
Events
Player - Player 6 (Orange) Selects a unit
Conditions
(Triggering unit) Not equal to Random Hero 0020 <gen>
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to SelectedHero[6]
(Choose Hero <gen> contains (Triggering unit)) Equal to True
Then - Actions
Unit - Change ownership of (Triggering unit) to Player 6 (Orange) and Change color
Unit - Move (Triggering unit) instantly to (Player 6 (Orange) start location)
Camera - Pan camera for Player 6 (Orange) to (Position of (Triggering unit)) over 0.00 seconds
Trigger - Turn off (This trigger)
Else - Actions
Set SelectedHero[6] = (Triggering unit)
[/trigger]
[trigger=Random]
Random
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Conditions
(Triggering unit) Equal to Random Hero 0020 <gen>
Actions
Selection - Select Heroes[Random] for (Triggering player)
Selection - Select Heroes[Random] for (Triggering player)
[/trigger]





v1.04
-Random Hero selected added
-All random added
-Hero Move speed added
-Fix Colour counter , set hero

v1.03
-Added Camera system.(Zoom distance helped by IcemanBo and deathismyfriend)
Sorry hero system still unavailable

v1.02
-Added hero system .(- repick , -random and -all random will be in next version)
-Display Triggering player name with colour of triggering player.

v1.01
-From change name system into command pack.(Suggested by Chaosy)
-Added two system .(Will be added more)
-Skip remaining action for change name system.


Keywords:
Command
Contents

Command System v1.01 (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 15:10, 5th Jan 2015 Maker: Check my reply in this thread.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

15:10, 5th Jan 2015
Maker: Check my reply in this thread.
 

Deleted member 219079

D

Deleted member 219079

The hell? Of course name change has a place in a game and is useful o_O Why did you post that here? This is his first spell contribution, let's help him to get started.

1. You need to add in a condition block which checks for whether the start of the entered chat string stand for "-name ".
2. You need to make this MPI. Add in Player 2... Player 12 events as well.
3. Set the last Action's string targeter to 7 through the size entered chat string. I'm pretty sure Warcraft decreases the name length by itself.

Edit: Well actually knowing hiveworkshop which is full of vJass minded nerds oops too offensive - geeks - this might get rejected. This is the reason I decided not to submit systems here, everyone just mocks others' contributions.

Proper reason for rejection would be that this is a duplicate.
 
The hell? Of course name change has a place in a game and is useful o_O Why did you post that here? This is his first spell
I don't see a reason to import this as a system in my map, as I can just implement this one line action on my own without any problem.

Edit: And there should be no exception, also not that it's the first submission.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Yes this will need to be expanded on a lot and coded more efficiently to make it a system.

Anything you use twice or more should be stored into a variable and the variable should be used.

Check out my tutorial things you should know when using triggers / gui. It will help you with better coding. Link is in my sig.

Try to implement things like Chaosy has said. That will make it better. Currently it will just be graveyarded.
 
Level 7
Joined
Feb 28, 2014
Messages
185
If you expand it to a command package, it can be useful.

it could include commands such as:
-zoom <number>
-name
-pause
-unpause
-votekick
-help (shows all commands)
Thanks for the useful suggestion .+rep

Yes this will need to be expanded on a lot and coded more efficiently to make it a system.

Anything you use twice or more should be stored into a variable and the variable should be used.

Check out my tutorial things you should know when using triggers / gui. It will help you with better coding. Link is in my sig.

Try to implement things like Chaosy has said. That will make it better. Currently it will just be graveyarded.
I have no idea to expanded more fore the system .I would try my best to expand my system and also will add more command in the map soon .

The hell? Of course name change has a place in a game and is useful o_O Why did you post that here? This is his first spell contribution, let's help him to get started.

1. You need to add in a condition block which checks for whether the start of the entered chat string stand for "-name ".
2. You need to make this MPI. Add in Player 2... Player 12 events as well.
3. Set the last Action's string targeter to 7 through the size entered chat string. I'm pretty sure Warcraft decreases the name length by itself.

Edit: Well actually knowing hiveworkshop which is full of vJass minded nerds oops too offensive - geeks - this might get rejected. This is the reason I decided not to submit systems here, everyone just mocks others' contributions.

Proper reason for rejection would be that this is a duplicate.
Thanks guys and thanks for your suggestion .:D

Hmm... How to change the image of system ?
 
Could you post triggers in spell description, please?

- repick , -random and -all random
Just as note that a system should not be too specific. It should be tried to keep a system clean and simple, and not to put not necessarily features into main code.
But of course you can make a general collection of commands like "zoom", "colour", "kick", ... that might be used in almost any kind of map.
 
Level 7
Joined
Feb 28, 2014
Messages
185
Could you post triggers in spell description, please?


Just as note that a system should not be too specific. It should be tried to keep a system clean and simple, and not to put not necessarily features into main code.
But of course you can make a general collection of commands like "zoom", "colour", "kick", ... that might be used in almost any kind of map.

I will post the trigger in this Sunday . The command what is the function for "colour" ? Thanks for the review .
 
The things in the last hidden tag with multiple triggers; they leak (Position of (Trig..). Also, can't the indices be stored as (Player number of (Triggering Player)) to avoid multiple triggers? There's no real difference between the triggers.

The turn off can be handled by an arrayed Boolean, while the player variable can be stored via converting player to player index (GUI).
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Anything used twice or more should be stored in a variable. Example you use triggering unit in a lot of your triggers. This should be stored.

As mythic has said the triggers should be combined and just use triggering player for the indexes to the arrays. That way you only need one trigger.

Your camera triggers are inefficient and only allow for certain values.
You should use a camera system found here on the hive.

This also just seems like a system of systems. No real purpose of it. There are other systems on here that will do each part of your system better and more efficient. (Most with more usability than yours. )
 
Level 7
Joined
Feb 28, 2014
Messages
185
Sorry for the lately reply.
The turn off can be handled by an arrayed Boolean, while the player variable can be stored via converting player to player index (GUI).
I have try with boolean many time but wont work . Can you show me how to work?:D
[trigger=Hss]Hero Select SystemHSS
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to SelectedHero[(Player number of (Triggering player))]
(Triggering unit) Not equal to Random Hero 0020 <gen>
(Choose Hero <gen> contains (Triggering unit)) Equal to True
Then - Actions
Unit - Change ownership of (Triggering unit) to (Triggering player) and Change color
Unit - Move (Triggering unit) instantly to ((Triggering player) start location)
Camera - Pan camera for (Triggering player) to (Position of (Triggering unit)) over 0.00 seconds
Trigger - Turn off (This trigger)
Else - Actions
Set SelectedHero[(Player number of (Triggering player))] = (Triggering unit)
[/trigger]

Your camera triggers are inefficient and only allow for certain values.
You can make it into unlimited value by delete these trigger.Recommend limit the value ,because if there is unlitimited value , perhaps player will crash their In-game/ the camera will upside-down .
  • Change Angle
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[2] Less than 300.00
        • Then - Actions
          • -------- 300 is the normal angle . Delete this if you don want. --------
          • Camera - Set (Triggering player)'s camera Angle of attack to 300.00 over 0.00 seconds
          • Game - Display to (Player group((Triggering player))) the text: You can only change...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[2] Greater than 360.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Angle of attack to 360.00 over 0.00 seconds
          • Game - Display to (Player group((Triggering player))) the text: You can only change...
        • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
-Use a smart loop to add the events to triggers. Now the user has to edit the triggers. Try controller == human and player is playing conditions
-Skip remainin actions action is not needed in name change. Move the rest of the actions inside the ELSE
-The move speed trigger leaks player group

Needs Fix
 
Top