HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[HELP] Setting max kills by chat.

01-16-2008, 11:42 AM#1
Elhyse
I wanted to make my map flexible in such a way that the host(Red player) may set the max kills possible for the match by chat. example...

-setkills 50

that will set the kills needed to win....to 50 kills.

Can't find a way to make it though...

Can anyone guide me?
01-16-2008, 11:57 AM#3
Elhyse
Trigger:
Set Kills
Collapse Events
Player - Player 1 (Red) types a chat message containing -setkills as A substring
Conditions
Collapse Actions
Set killset = (Integer((Substring(-setkills, 1, 150))))

Uhm....did I do it right?
01-16-2008, 12:04 PM#4
Troll-Brain
Quote:
Originally Posted by Elhyse
Trigger:
Set Kills
Collapse Events
Player - Player 1 (Red) types a chat message containing -setkills as A substring
Conditions
Collapse Actions
Set killset = (Integer((Substring(-setkills, 1, 150))))

Uhm....did I do it right?

uhmm not ...
I know that the gui example suck because you can undersand two different way.
First number is the begin, and last number is the end of the string.
with gui
Substring("-setkills",2,5) == "setk"
Btw instead of the last number you should use lenght of string
01-16-2008, 12:07 PM#5
Elhyse
Could you provide me with a clear guide?

I can't understand.
01-16-2008, 12:09 PM#6
Troll-Brain
Quote:
Originally Posted by Elhyse
Could you provide me with a clear guide?

I can't understand.

1) -
2) s
3) e
4) t
5) k ...
01-16-2008, 12:15 PM#7
Elhyse
.....................I'm very sorry. Come again? I REAAALLY can't understand.
01-16-2008, 12:43 PM#8
Troll-Brain
i know my english is very bad but ...
see the numbers and you must understand ...
01-16-2008, 01:14 PM#9
moyack
Why Substring("-setkills",2,5) will return "setk"??

The uber prwnage answer!!!:
Word: -setkills
      ^^^^^^^^^
      |||||||||
      123456789
01-16-2008, 01:19 PM#10
TEC_Ghost
Ok bud, basically the Substring function grabs stuff by it's number of letters, so you have -setkills which is 9 charectors but you want to grab the number they type after -setkills with a space so the space is another char, you want a two digit number, so that's the 11th and 12th space.


Trigger:
String Function
Collapse Events
Player - Player 1 (Red) types a chat message containing (Substring(-setkills, 1, 9)) as An exact match
Conditions
Collapse Actions
Set MaxKills = (Integer((Substring((Entered chat string), 11, 12))))

So you're grabbing the 11th and 12th position of the entered string, which is the 2 number and converting the string into an integer.
01-16-2008, 02:55 PM#12
Elhyse
So since it grabs the 11th and the 12th character, when i say i want the game to end after 5 kills, i have to type -setkills 05?
01-16-2008, 02:59 PM#13
Troll-Brain
Quote:
Originally Posted by Elhyse
So since it grabs the 11th and the 12th character, when i say i want the game to end after 5 kills, i have to type -setkills 05?

no need, you can say "-setkills 5".
Cause when you convert a string to an integer he stop the conversion when a character is not a number (space,nothing, a letter, etc).
Btw instead of 12, use String lenght of entered chat string
01-16-2008, 04:06 PM#15
Troll-Brain
Quote:
Originally Posted by Need_O2
>.< damn I totally forgot that -rep for me pls
xD, the rep system is so useless