• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] - round #

Status
Not open for further replies.
Level 24
Joined
May 9, 2007
Messages
3,561
I have a problem.


I am making a map which is kind of a cross in between elimination tournament and warlocks with some elements of it's own.

I want to make it so that player 1 red can set round #.

Is there a way to do this without making 100 if then else statments.

(I tried searching tutorials but I could not find one)
 
Easy, long way:

Go to the search gamechat trigger for "-round." Turn on a trigger searching for an integer. Store the next typed integer as the number of rounds. This would require 2 lines from the host though.

I was thinking of the converting strings --> integers function if you can find a way to use it.
 
  • a
    • Events
      • Player - Player 1 (Red) types a chat message containing -round(space) as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions) (this is for rounds 1-9)
        • If - Conditions
          • And - all cond are true
            • (Length of (Entered chat string)) Equal to 7
            • Integer((Substring((Entered chat string), 7, (Length of (Entered chat string)))))) not equal to 0
        • Then - Actions
          • Set TempInteger = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions) (this is for rounds 10-99)
        • If - Conditions
          • (Length of (Entered chat string)) Equal to 8
        • Then - Actions
          • Set TempInteger = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
        • Else - Actions
i made it very quick. you should try it and see if it works
 
Ady_illadin's trigger is actually a little bit sexier than this, but mine is slightly easier to understand, so hopefully you should be able to change it around to suit your own map. Good luck!
 

Attachments

Go with what ady_illidan did.
But you have to check if the entered chat string suits you.
First the trigger conditions should check if substring from 0 to 7 from the entered chat string is equal to -round(space).
Than check if the integer from the substring from the entered chat string from 7-9 is greater than 0(if it contains other stuff(chars and space) it will be 0).
Also using
Integer((Substring((Entered chat string), 7, (Length of (Entered chat string)))))) not equal to 0
(stress on (Length of (Entered chat string)))
is pointless, just use 8, as (Length of (Entered chat string)) Equal to 7.
 
Status
Not open for further replies.
Back
Top