• 🏆 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!

[General] question about, set kill, -kills #

Status
Not open for further replies.
Level 4
Joined
Dec 16, 2013
Messages
84
i have a question again, how to set kill by using text chat
minimum= 30 kills, and max= 300 kills
like:
-kills 250
then any team which reached 250 kills first will win the game
 
Level 6
Joined
Jan 8, 2009
Messages
140
  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) types a chat message containing -kills as A substring
    • Conditions
    • Actions
      • Set tmpString = (Substring((Entered chat string), 8, (Length of (Entered chat string))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer(tmpString)) Greater than 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer(tmpString)) Greater than or equal to 30
              • (Integer(tmpString)) Less than or equal to 300
            • Then - Actions
              • Set tmpInt = (Integer(tmpString))
            • Else - Actions
              • Game - Display to (All players) the text: Enter a number betw...
        • Else - Actions
          • Game - Display to (All players) the text: Enter numbers only.
 
Last edited:
Level 4
Joined
Dec 16, 2013
Messages
84
Using substrings. Look at my tutorial Things a GUIer should know. The chapter on substrings will show you how.

  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) types a chat message containing -kills as A substring
    • Conditions
    • Actions
      • Set tmpString = (Substring((Entered chat string), 8, (Length of (Entered chat string))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer(tmpString)) Greater than 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer(tmpString)) Greater than or equal to 30
              • (Integer(tmpString)) Less than or equal to 300
            • Then - Actions
              • Set tmpInt = (Integer(tmpString))
            • Else - Actions
              • Game - Display to (All players) the text: Enter a number betw...
        • Else - Actions
          • Game - Display to (All players) the text: Enter numbers only.

ok i did it and works
but how to apply it to the win condition?
here is my current trigger
- Condition for Team A to win
Team1 Wins
Events
Time - Every 1.00 seconds of game time
Conditions
Team1_Kills Greater than or equal to 30
Actions
Game - Victory Player 1 (Red) (Show dialogs, Show scores)
Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
Game - Victory Player 3 (Teal) (Show dialogs, Show scores)
Game - Victory Player 4 (Purple) (Show dialogs, Show scores)
Game - Victory Player 5 (Yellow) (Show dialogs, Show scores)

- trigger for team kills
Team1 Kills
Events
Unit - A unit Dies
Conditions
((Unit-type of (Triggering unit)) is A Hero) Equal to True
((Killing unit) is in Team1_Heroes) Equal to True
Actions
Set Team1_Kills = (Team1_Kills + 1)

so whenever i type -kills 250 (for example)
the "Team1_Kills Greater than or equal to 30" changed to "Team1_Kills Greater than or equal to 250"

ive been spent many hours to make it works, but still can't figure out


Using substrings. Look at my tutorial Things a GUIer should know. The chapter on substrings will show you how.

thanks, reading it right now
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
The problem is in your condition trigger you use a variable and a standard above 30 kills.
To make this work you need two variables. One to store the kill amount entered in by the user. The other to store the current kills that user has gotten.

In a unit dies trigger increase the current kills integer.
In the victory trigger check if current kills is greater than or equal to kills chosen.

Also take a look at this for posting triggers. http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/
 
Level 4
Joined
Dec 16, 2013
Messages
84
The problem is in your condition trigger you use a variable and a standard above 30 kills.
To make this work you need two variables. One to store the kill amount entered in by the user. The other to store the current kills that user has gotten.

In a unit dies trigger increase the current kills integer.
In the victory trigger check if current kills is greater than or equal to kills chosen.

Also take a look at this for posting triggers. http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/

ok it is working now
now i bit confused how to automatically set the kills to default when the player didnt type in specific time

but yeah i'm going to try first, then ask if got a problem hhe
 
Level 4
Joined
Dec 16, 2013
Messages
84
the variable you use for the player to set kills simply set it at map init to a default time. If player changes it it will update if not it will stay default.

yeah i already did that
i want ask something again

If player1 didnt type -kills ### within 15 seconds, the trigger (-set kills trigger) will turn off

how can i make that into trigger?

so if player1 didnt type -kills ### within 15 seconds, the set kills will stay at 30 kills as what i setup in Map Initialization before.
ofcourse since the -set kills trigger turned off, player1 can't no longer set the game kills

haha hope you understand

  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 15.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Trigger - Turn off Type <gen>
          • Game - Display to (All players) the text: Default kills 30
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Use a timer and have it end 15 seconds after the -kills message is displayed. Then in a timer ends trigger disable the trigger that registers the player chat message with -kills in it.

Also never use do nothing. The only thing it does is slow down triggers. It doesn't Do nothing like the action suggests. Use comments to separate things if needed.
 
Level 4
Joined
Dec 16, 2013
Messages
84
Use a timer and have it end 15 seconds after the -kills message is displayed. Then in a timer ends trigger disable the trigger that registers the player chat message with -kills in it.

Also never use do nothing. The only thing it does is slow down triggers. It doesn't Do nothing like the action suggests. Use comments to separate things if needed.

dont really get it
---edit----
ok i made it
 
Status
Not open for further replies.
Top