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

SubStrings and Strings and whatnot

Status
Not open for further replies.
Level 2
Joined
Mar 31, 2005
Messages
23
I'm a little confused on how to work this, so if someone could explain it to me, it would be really helpful. I figured out how to get "-setname" working as a substring, but I can't figure out how to do anything with following String, can anyone help me with this?

Sorry if I didn't explain this so well. :?
 
greenbaron said:
but I can't figure out how to do anything with following String, can anyone help me with this?

what do you mean with that? please specify your problem a bit. only saying tell me about strings is a bit rare... what is 'anything'? :?
 
I want to do things like "-setname 01 (player number) MYNAMEHERE" and have it change the player name to "MYNAMEHERE." That a good enough explanation?
 
Actually you didn't explain very well, but I guess your trying to make a setname system like in DoBRP.

Requirements (you must have this first):

-Two variables of type String. Name it OneName1 and Name02 (for example). Enable Array and set it to 8.

This should do it:

Events:

Player - Player 1(Red) types a chat message containing setname as A substring
Player - Player 2(Blue) types a chat message containing setname as A substring
Player - Player 3(Teal) types a chat message containing setname as A substring
(Do this for all players)

Conditions:

String Comparison: (Substring((Entered chat string), 1, 8 )) Equal to setname>

Actions:

Set Variable: Set Name02[(Player number of (Triggering player))] = ((OneName1[(Player number of (Triggering player))] + (Substring((Entered chat string), 9, 119))) + |r)


I hope you can find all the stuff when making Actions. Good Luck.:wink:

-Rui
 
greenbaron said:
I want to do things like "-setname 01 (player number) MYNAMEHERE" and have it change the player name to "MYNAMEHERE." That a good enough explanation?

well then you quest is answered by rui :D
 
Well, I sort of made the trigger, though I'd appreciate it if you'd explain what the two numbers after subtring are supposed to do.
 
I don't know how to explain that very well but I guess this explenation does it: the 1-8 detects the number of letters you write.

s-e-t-n-a-m-e->
1-2-3-4-5-6-7-8

subtring 1 - 8

This means that only the setname isn't stored.

The ones at the end,

9,119

The number 9, is to prevent the trigger to store the setname>, otherwise when you typed for example -hi, the name (for example) John: Hi wouldn't appear. It would show up like this setname>John: Hi.
For the number 119, I belive that it's the limit of letters you can write when playing in-game.

Substrings are easy to understand if you master them.

-Rui
 
Your welcome, I figured out how to make most things of DoBRP myself. In fact, I kind of guessed what that Substrings meant by myself, but just thinking like this. If the 8 first letters is setname>, then a subtring might work on this :P. It's a long story =P

-Rui
 
Rui said:
The ones at the end,

9,119

The number 9, is to prevent the trigger to store the setname>, otherwise when you typed for example -hi, the name (for example) John: Hi wouldn't appear. It would show up like this setname>John: Hi.
For the number 119, I belive that it's the limit of letters you can write when playing in-game.

correct, but instead of 119 you can use string length of (entered chat string). so you get the exact word without " " space.
 
Status
Not open for further replies.
Back
Top