• 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.

[Trigger] - round #

Status
Not open for further replies.
Level 24
Joined
May 9, 2007
Messages
3,563
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)
 
Level 2
Joined
Dec 2, 2007
Messages
14
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.
 
Level 11
Joined
Dec 11, 2007
Messages
888
  • 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
 
Level 2
Joined
Jun 15, 2008
Messages
18
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

  • Round Number Trigger.w3m
    8.4 KB · Views: 40
Level 12
Joined
Apr 27, 2008
Messages
1,228
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.
Top