• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Player letters

Status
Not open for further replies.
Level 5
Joined
Mar 21, 2007
Messages
155
hi

sorry but basically, long story short, i want to make a condition (hopefully in GUI) that references a player's name. i was hoping for something like

  • If - Conditions
    • player-player name (string,1,1) = A
  • Then - Actions
    • player - set players gold to 10000000
  • Else - Actions
    • game - text saying : invalid code
a condition that checks a character in the players name (e.g a,b,c,d,e,f,g,1,2,3,4,5) in a certain spot (e.g bumPer (string 4,4) or bUmper (string 2,2). its for a save/load code.

ty
 
Level 5
Joined
Jul 11, 2007
Messages
152
If you're shooting for a save load code using this idea won't bUmper hUnter sUperman etc work too so they all have the same code?
I would suggest just using the whole name instead of trying for one character, and if you're going for a real save/load code JASS is the best way to go.
 
Level 5
Joined
Mar 21, 2007
Messages
155
NOOOOOOOOO. I HATE JASS. i will only use jass if its really the only way.

no, i am going to take more than just 1 letter, otherwise it would be a tad guessable. so is there a kind of if trigger that you know of?

or how can i link it in some way to the whole name then?
 
Level 5
Joined
Jul 11, 2007
Messages
152
I hate JASS too but I don't think you can do it that way, but it'd be nice if someone else could prove me wrong.

The closest thing I can think of is by putting the info in the game. For example

  • Time Elapsed - Time equal to 0.50 seconds
  • Player Group - Pick all players in player group - player name equal to subressor OR player name equal to Maddawg101 and do (Player - add property - add 100000 gold to picked players current gold)
You could add a lot of names through the OR condition, but this whole trigger requires that you know the people you want to give the bonus to already. So as you continue making versions you could update it each time with more people or different rewards.

Hope that helps :wink:
 
Level 5
Joined
Mar 21, 2007
Messages
155
solved

ahhh. i have solved it. sorry. mods, move this thread to somewhere...something...

but for archive purposes, i did this. may everybody learn of me =D

  • tesating Copy
    • Events
      • Player - Player 1 (Red) types a chat message containing -load as A substring
    • Conditions
    • Actions
      • Set player_name = (Name of (Triggering player))
      • Set players_name_for_code[1] = (Substring(player_name, 1, 1))
      • Set players_name_for_code[2] = (Substring(player_name, 2, 2))
      • ------------you can use as many parts of his name as you like, i used 6)-----------------
and now, you have a players letter isolated as a variable. you can then use string conditions and actions relating to that variable e.c.t =D

hope this helps someone in the future :wink:
 
Status
Not open for further replies.
Top