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

Renaming Heroes

Status
Not open for further replies.
Level 14
Joined
Oct 27, 2007
Messages
1,395
Yes it is possible. It's probable that you've seen it in every map in Wc3.
Open the world editor, open up your map, then open the Object Editor.
Then go to the unit you want to change and then on the right go to the bottom of it, and where it says unit name, Change it to what you want.

Hope that helps :)
 
Level 14
Joined
Oct 27, 2007
Messages
1,395
OH noes! I misread something! Crucify me! I is evil!1!!1!

Anyway. Taking a quick look at the editor I don't see any action that can change the name, but you can try the Unit - Replace action. Just use the same model and have a different name.
 
Level 10
Joined
Jun 21, 2007
Messages
643
bummer, oh well thanks for the help guys and its an easy mis-read Arvedui . . . xD

Replacing is not an option, not for 367 units anyway.

If anyone has any better ideas for naming planets in a solar system, with a name randomly generated from an array ideas on a postcard plz. :)

The only things I can think of now is either text above each planet(messy) or erm.. thats it . . . xD

Regards,
MadCD
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
I don't understand. If the planets are organized then create different units in the object editor.
If the planets are only organized by type, for example:
Suns - Sol1, Sol2, Sol...
Gas Giants - GG1, GG2, GG..
Earth-like - Terra1, Terra2..
Name them like this. It's not clear what you want.
 
Level 10
Joined
Jun 21, 2007
Messages
643
yeah I do that a lot . . xD

Ok, at the start of the game a random number of solar systems are generated with a random number of planets between (5-7), each sun is given a name from a randomly generated list, could be done with heroes, but each planet has to have the name of the solar system. I.e. Sol + roman numeral I.e. Sol I sol II etc.

if I could've renamed heroes it would have been simple, but as I can't I think its gonna have to be text name for each planet (they are static).

Reason for non-replacing is there are 367 differant solar system names to choose from, x 7 planet each.. far too many units.

The problem with text above a planet is it looks messy, so anyone got a better solution?

Regards,
MadCD:infl_thumbs_up:

EDIT: Just a thought...

Is it possible either via gui or Jass to search for a units name/proper name as a string?

I.e. have a planet called Sol with 1 proper name, then let warcraft affix the roman numerals, but I'd have to be able to search for strings coz 367 if statments is gonna take a while . . xD unless there's a switch statement in jass...
 
Last edited:
Level 17
Joined
Apr 13, 2008
Messages
1,608
Yes, it's possible. You can reference to a hero's proper name as a string.
There is a JASS function called GetProperName()
JASS:
native GetHeroProperName takes unit whichHero returns string
And I'm sure there is a GUI equivalent for it.

So base your suns on 1 hero with a lot of proper names well naming the orbiting planets would require some more thinking, if you would elaborate a little more on how the planets are named I would try to help, but I'm not 100% sure about your method at the moment.
 
Level 10
Joined
Jun 21, 2007
Messages
643
if each planet has the same name as the sun, then warcraft will automatically append I,II,III etc to the end of each planet.

So if I have a epic switch statement that matches the name of the sun to the name of the planet I.e. finds the planet with the name matching the name of the sun then I can simply spawn planets and warcraft will automatically name them numerically for me.

Regards,
MadCD:infl_thumbs_up:
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
Well, if I understand right then you have 367 solar names.. hmm well.. You wouldn't need to do 367 if syntaxes here, but it would be an insane amount of work to create 367 planet type heroes..

Okay, so here is the best I could come up with in one minute. I don't think there is a better solution.

You are going to need a system which first places your suns. Let's place 3 suns now.
Your suns' names are Sol, Sun, Joe (haha :p)

JASS:
native CreateUnitByName takes player whichPlayer, string unitname, real x, real y, real face returns unit
Since you can create units by name (string value) you can do this:
CreateUnitByName(Player(0), GetHeroProperName(Sun[0]) .....
I'm sure there is a GUI equivalent to this.

This is going to be a hard part. You should create as many types of units as the number of sun unit type's proper names.
The unit's should have 7 proper names if that's the maximum number of planets a sun can have orbiting around them.
BUT. Here is another problem. If your solar system has 5 planets then you can get Sol VI or Sol VII so you'll have to write a little code for this problem.

I would go recursive when placing the planets.
loop
set PlanetsPlaced = PlanetsPlaced + 1
Place 1 planet around your star.
If the planet's hero name contains VI or VII, but the number of planets is 5 then remove the planet. PlanetsPlaced = PlanetsPlaced - 1
If the planet's hero name contains VII, but the number of planets is 6 then remove the planet. PlanetsPlaced = PlanetsPlaced - 1
exitwhen PlanetsPlaced = YourDesiredNumberOfPlanetsAroundThisSun
endloop

Meh, okay, I know my post is a little messy here and there, but I think it's understandable and I'm about to die of hunger so if it's not clean what I suggested then I'll come and correct it in half an hour.
 
Status
Not open for further replies.
Top