• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Prefix/Rank Question

Status
Not open for further replies.
Level 2
Joined
Nov 26, 2021
Messages
11
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 39
Joined
Feb 27, 2007
Messages
5,033
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