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

uses of substrings

Status
Not open for further replies.
Level 13
Joined
May 11, 2008
Messages
1,198
so how about it? my map doesn't really make use of chat messages from players to perform various map functions... although just recently i finally added camera changing with chat commands, and it's subject to streamlining...but that's irrelevant to this topic.

strings are extremely useful in warcraft 3 editing...but what about substrings? i hear they're good for chat messaging commands, but, is there something else?

i tried using them but i can't find any advantage in using them. it seems like regular strings work just fine. what am i missing?
 
Level 2
Joined
Jan 10, 2009
Messages
30
You are right, normal / regular strings work just fine...
Substrings are more like, for example in dota:

This is a normal string: "-apem"
If you use substring, the player can type "-apem2343252523" and it will still work.
One example is:

Events
Player 1 (Red) types a chat message containing "_" as an Substring
Conditions
(Matching String) Equal to (-apem)
Actions
bla bla bla...

I think that works atleast :p
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Well, lets say you can change your name by typing:
'-name Yixx'
How would you do that? you cant use (Entered Chat string) since it will change my name to '-name Yixx'
So, use substrings, this way you can take a part of the string and use THAT instead of the whole one,,

Other:
Lets say you have an RPG, you want the players name to change to the name of the Hero, but the Hero's name is:
Peter Paladin
(Paladin indicates the type of hero)
You want his name to change to 'Peter',, then you can use substrings,,

Yet another:
You have an Control Zone map, when you take control of one, you want to tell it to all players,
one zone is named: 'Research Center Radeon'
You dont want everyone to search for a research center building, so you only display the name,
Use substrings to display 'Radeon' or 'Yixx has Taken Zone Radeon'

Hope this helps =)

-Yixx,,-

BTW: There examples might be really silly, but it gives you an idea ;)
 
Level 13
Joined
May 11, 2008
Messages
1,198
oh i think i get it now. you can use a string which is name of a unit or building or something like that and take only part of it and use it. right away i can't think of any uses off the top of my head for this in my map...but i'll keep it in mind as i play test it some more. hopefully i'll come up with something.

i guess this would work pretty good with game-wide announcements.

yeah definitely. this will help with most of my announcements actually. which i don't have many of but i'll use them more.
 
Status
Not open for further replies.
Top