create-unit: add nickname option

develop
lethosor 2015-10-26 21:02:03 -04:00
parent daf20c16bd
commit 7dd091e57a
1 changed files with 8 additions and 1 deletions

@ -330,6 +330,7 @@ validArgs = --[[validArgs or]]utils.invert({
'flagSet', 'flagSet',
'flagClear', 'flagClear',
'name', 'name',
'nick',
'location', 'location',
'age' 'age'
}) })
@ -369,6 +370,8 @@ arguments:
set the unit's name to be a random name appropriate for the given entity set the unit's name to be a random name appropriate for the given entity
examples: examples:
MOUNTAIN MOUNTAIN
-nick nickname
set the unit's nickname directly
-location [ x y z ] -location [ x y z ]
create the unit at the specified coordinates create the unit at the specified coordinates
-age howOld -age howOld
@ -505,6 +508,10 @@ else
end--]] end--]]
end end
if args.nick and type(args.nick) == 'string' then
dfhack.units.setNickname(df.unit.find(unitId), args.nick)
end
if civ_id then if civ_id then
local u = df.unit.find(unitId) local u = df.unit.find(unitId)
u.civ_id = civ_id u.civ_id = civ_id