Changing a unit's race

Seprest

New Member
Reaction score
15
Hello!

I am wondering what is the appropriate action to change a unit's race? I can use a unit's race in booleans, but I can't set it! I can set unit classifications ect, but not what race the unit is considered! :banghead:

If anyone know how to do this, it would be greatly appreciated.


PS: I will take custom scripts too!
 

Happy

Well-Known Member
Reaction score
71
sure you can set the race...its in the editor......just take a look...i dont have WE at the moment so sry that i cant tell you the line...
 

Seprest

New Member
Reaction score
15
No I mean set the race via a trigger. Like change a unit that starts as a human to undead, keeping the same exact unit, but with 1 changed variable.

Sorry for not clarifying that, I know where the race field is in the object editor :shades:

current if/then/else:

If ((Race of (Triggering unit)) Equal to Undead) then do (Do nothing) else do (Do nothing)



need to make it do something like this:

If ((Race of (Triggering unit)) Equal to Undead) then do (Do nothing) else do (set the darn race to UNDEAD!)

But I can't find the correct action to change a units variables. There are some, such as classification, health, mana, ect. But can't change the race! Which is why I believe a custom script(which I don't know how to do but one for this sounds like it could be simple) is neccesary.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
simple answer:
you cant...

more advanced answer:
you still cant. but you might make an exact copy of that unit, change its race to undead in object editor and morph the first unit via trigger into the second by using the chaos ability.
 

Seprest

New Member
Reaction score
15
depends on what you call easy...

I'm just going to make all heroes undead from the beggining, and make it so death coil just does dmg, not heal undead ppl and stuff, -1 utility +1 paladins mining haunted gold mines:cool:
 

jig7c

Stop reading me...-statement
Reaction score
123
there is a native called
JASS:

not sure what it does though... i also don't have WE on this computer..


maybe something like this...
JASS:
local unit u = GetTriggerUnit()

if IsUnitRace(u, 3) then
 DoNothing()
elseif
 ConvertRace (3)
endif
set u = null


JASS:
 

Chaos_Knight

New Member
Reaction score
39
there is a native called
JASS:

not sure what it does though... i also don't have WE on this computer..


maybe something like this...
JASS:

local unit u = GetTriggerUnit()

if IsUnitRace(u, 3) then
 DoNothing()
elseif
 ConvertRace (3)
endif
set u = null


JASS:

constant race               RACE_HUMAN                      = ConvertRace(1)
constant race               RACE_ORC                        = ConvertRace(2)
constant race               RACE_UNDEAD                     = ConvertRace(3)
constant race               RACE_NIGHTELF                   = ConvertRace(4)
constant race               RACE_DEMON                      = ConvertRace(5)
constant race               RACE_OTHER                      = ConvertRace(7)

That could work.
 

Seprest

New Member
Reaction score
15
I gave up on all the jass, just made it be a normal gold mine but with the haunted goldmine model ^.^

Never used jass b4 except custom lines. Wasn't sure if I could put a chunk of jass in the middle of my trigger, or have to make the whole trigger out of jass. I have other stuff in the trigger, so I didn't want to do a whole trigger in jass with all my other stuff. I probably could have just called on a 2nd trigger inside the jass trigger so I wouldn't have to code all the other junk.


And if Chaos_Knight sais it will work, it must!

Edit: but don't think your data mining was wasted, I bookmark all pages with nifty WC3 stuff, and I will certainly use this sometime in the future. And I'm sure you've educated a few random viewers of this thread <3
 

Lehona

New Member
Reaction score
12
That won't work (At least I think it won't). ConvertRace(x) is, just as other natives like ConvertPlayerEvent(x) etc. just to convert an integer to a handle (in this case: to 'race').
 

Seprest

New Member
Reaction score
15
Yeah you are probably right when you explain it like that. So it would just convert an integer to a handle huh. Exciting :rolleyes:

Though, I never tried it out, so anything could(possibly) be possible(possibly).
 

jig7c

Stop reading me...-statement
Reaction score
123
That won't work (At least I think it won't). ConvertRace(x) is, just as other natives like ConvertPlayerEvent(x) etc. just to convert an integer to a handle (in this case: to 'race').

so you can't change a unit's race with triggers..

this myth is BUSTED!
 

Lehona

New Member
Reaction score
12
Well, if you can write at the data segment you'd be abled to change a unit's race. Though you need at least some programming-skills to do that (Or at least JASS if someone could rebuild the classes and make a nice interface).

And I'm kinda sure that you can't write in the data segment anymore.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top