the hero is a space marine and shoud have some names, chosen random at placing/buiding of the hero - Jim Raynor, Arnold Schwarzenegger, etc.
so the unit does not have the same name every time.
is this doable with triggers or just some editing in the data editor?
didnt find anything about that with the search function - or maybe im just blind :o
Events
Map Initialization
Local variables
Names = "" <String[3]>
Actions
Variable - Set Names[0] = "Arnold"
Variable - Set Names[1] = "Garfield"
Variable - Set Names[2] = "Batman"
Catalog - Set value of Units "Marine" "Name" for player 1 to Names[(Random integer between 0 and 2)]
Unit - Create 1 Marine for player 1 at (Center of Region 001) using default facing (No Options)
This should hopefully do the trick, albeit multiple of these units will have the same name for a single player. If only one unit is going to be alive at a time it's not a problem to randomize between each death/respawn, but otherwise I think the old units too will recieve the new name if re-randomized. Different players can have different names though I belive, as each player has his own duplicate of the dataset if I understand correctly.
Yes, Marine and Name are just values you type in. If you've already changed the name of the unit you might have to change it for whatever you switched the name to manually (So where it says "Marine" in my triggers it should say i.e. "Space Marine" in yours). That would be my first guess to what could be wrong at least. If not, what error message are you getting?
Apparently it seems like even if you've already changed the name of the unit in the data editor the trigger should still be called with "Marine" in the entry field, so it's weird if it didn't work first time around. What error did you get if you put "marine" there?
okay, i tried it out it definatly works, didnt figured out whats wrong with my hero - theoretically are all names changed to commander cryfor so it should be everthing allright.
tryd it with "Ghost" and it worked properly when i create a Ghost afterwards.
i didnt copy the hero from a unit, did everthing up from the scratch, maybe i forgott something
hi, my question for today:
the hero is a space marine and shoud have some names, chosen random at placing/buiding of the hero - Jim Raynor, Arnold Schwarzenegger, etc.
so the unit does not have the same name every time.
is this doable with triggers or just some editing in the data editor?
didnt find anything about that with the search function - or maybe im just blind :o
Here's one way to do it with triggers...
Events
Map Initialization
Local variables
Names = "" <String[3]>
Actions
Variable - Set Names[0] = "Arnold"
Variable - Set Names[1] = "Garfield"
Variable - Set Names[2] = "Batman"
Catalog - Set value of Units "Marine" "Name" for player 1 to Names[(Random integer between 0 and 2)]
Unit - Create 1 Marine for player 1 at (Center of Region 001) using default facing (No Options)
This should hopefully do the trick, albeit multiple of these units will have the same name for a single player. If only one unit is going to be alive at a time it's not a problem to randomize between each death/respawn, but otherwise I think the old units too will recieve the new name if re-randomized. Different players can have different names though I belive, as each player has his own duplicate of the dataset if I understand correctly.
hm something is wrong with it, i dont know did you just add values at the point:
Catalog - Set value of Units "Marine" "Name" for player 1 to ...
is Marine and Name just a value? if yes, it doesnt work so far :< got an ingame error.
Yes, Marine and Name are just values you type in. If you've already changed the name of the unit you might have to change it for whatever you switched the name to manually (So where it says "Marine" in my triggers it should say i.e. "Space Marine" in yours). That would be my first guess to what could be wrong at least. If not, what error message are you getting?
thats the error i got - Commander Cryfor is the unit wich name should be changed
Apparently it seems like even if you've already changed the name of the unit in the data editor the trigger should still be called with "Marine" in the entry field, so it's weird if it didn't work first time around. What error did you get if you put "marine" there?
okay, i tried it out it definatly works, didnt figured out whats wrong with my hero - theoretically are all names changed to commander cryfor so it should be everthing allright.
tryd it with "Ghost" and it worked properly when i create a Ghost afterwards.
i didnt copy the hero from a unit, did everthing up from the scratch, maybe i forgott something