Chat as substring?

takethat

Active Member
Reaction score
12
Is this how the pudge war works?

Code:
Killscount
    Events
        Player - Player 1 (Red) types a chat message containing (-km + (String((Random integer number between 1 and 100)))) as A substring
    Conditions
        (Integer((Substring((Entered chat string), 5, 7)))) <= 100
    Actions
        Set Killstowin = (Integer((Substring((Entered chat string), 5, 7))))
        Set Killsstring = (Substring((Entered chat string), 5, 7))
        Game - Display to (All players) the text: (Kill + (Killsstring + times to win))
        Quest - Display to PlayerGroup the Hint message: (Kill + (Killsstring + times to win))
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Is this how the pudge war works?

The what?


The event is certainly wrong.
It's enough to say "-km " as a substring.

It's also probably enough to show the text just once.

On a related note, the substring from 5 to 7 can't be greater than 99 anyway...
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
If I may explain, Pudge Wars is a game where you play as Pudge(s) (<-- a unit/Hero with Abomination model which is originated from DotA)

The Pudge has an ability called Meat Hook (or usually called just 'Hook'; I'm sure you've heard this before)

So the game is about hooking your enemies across the river to kill them.

What he want is how to set the amount of kills needed to win the game.
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
Err... can you type more than 99 characters?
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
I was refering to chat because the question IS about converting a chat to a substring, not integer.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
> (Integer((Substring((Entered chat string), 5, 7)))) <= 100

This converts the Substring to an Integer.
The one you're probably thinking of is 'Length of String' :p
 

chango

New Member
Reaction score
1
> the substring from 5 to 7 refers to the chars 5, 6 and 7 so it can be 999

I'd suggest you try it out first.

Ok here is the test:

We need a variable for the numbers of kill we called killsVictoria

First the trigger to set up the numbers of kills to 999
Code:
NumeroMuertesVictoria
    Events
        Player - Player 1 (Red) types a chat message containing -kills  as A substring
    Conditions
    Actions
        Set killsVictoria = (Integer((Substring((Entered chat string), 8, 10))))

you should type it before 15 secs.

Then we show it in a leaderboard:

Code:
Crear Leaderboard
    Events
        Time - Elapsed game time is 15.00 seconds
    Conditions
    Actions
        Leaderboard - Create a leaderboard for (All players) titled (kills to win  + (String(killsVictoria)))
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
        Leaderboard - Show (Last created leaderboard)

if you type -kills 999 you will see the leaderboard: "kills to win 999"

so 10 - 8 = 2 but the limits are included in the substring. so are 3 characters instead of 2.

Sorry for my bad english :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top