ah right, i thought you meant name as in "David Armstrong"...
i encountered a few difficulties with this issue, and i found the key is in
pausing... here's how i did it:
you create your unit as normal, assigning a group and so on. in the 'script' part of the createunit command, you tell it to execute a separate script. this is the only way i got flashpoint to reliably perform commands on the unit as it's being created. it looks something like this...
_loontype createUnit [[x,y,z],group_name, {this exec "setup_spawn.sqs"}]
then in "setup_spawn.sqs"....
;establish loon
_who = _this
;set loon's attributes
_who setskill 1
_who setspeedmode "full"
_who setcombatmode "red"
_who allowfleeing 0
etc....
i suppose at the end there you could put
variable = _who
but that variable will be the same for every unit created. so you need a separate global counter, which you increment every time a unit is created. add something like this to "setup_spawn.sqs" -
call format ["unit_name%1 = _who", global_unitcounter]
global_unitcounter = global_unitcounter + 1
don't forget to declare the global variable in your init file - global_unitcounter = 0. your units will be called
unit_name1,
unit_name2,
unit_name3, etc...
this is totally untested, but give it a go. i think it may work