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

Prefix/Rank Question

Status
Not open for further replies.
Level 3
Joined
Nov 26, 2021
Messages
25
I wanna add ranks to my Save/Load Game, and i have tried it, however you load without a rank, and you save with the rank, so u cant load the save without having the rank already

Name - You load like this obviously
[Rank]Name - When you save name looks like this

So the Save code Requires name to be [Rank]Name to load, so i am wondering a way around it
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Temporarily remove the rank from the player name before performing the save, then add it back in after the save has occurred. If the [ and ] characters always surround the rank before the name and there's never a space afterward, you can loop over the player's name to figure out what has to be temporarily removed for the save even if there are multiple ranks with different character lengths. Another option would be to save every player's name into an array when the map starts, then just set their names to that saved value (temporarily) while saving.
 
Status
Not open for further replies.
Top