Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

setting a hostFacility property

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> setting a hostFacility property Page: [1]
Login
Message << Older Topic   Newer Topic >>
setting a hostFacility property - 6/19/2020 10:45:38 PM   
wqc12345


Posts: 250
Joined: 12/7/2015
From: San Francisco, CA
Status: offline
Ok, this took me a while.. but I finally was able to dump all properties of the Unit object.

local a = ScenEdit_GetUnit({ side = 'USSR' , name = 'Roxy #1' })
print(a.fields)
for k,v in pairs(a.fields) do
if string.find(k,'property_') ~= nil then
local t = string.find(v," , ") -- location of first ,
print("\r\n[object] = " .. string.sub(v,2,t-1) ) -- property name
print( a[string.sub(v,2,t-1)] ) -- value of property
end
end


All I want to do is assign the BASE of the unit, there appears to be a properly called "hostFacility" but when I go to set this, nothing happens to the unit.

local a = ScenEdit_GetUnit({ side = 'USSR' , name = 'Roxy #1' })
ScenEdit_SetUnit({ side = 'USSR' , name = 'Roxy #1'}, {hostFacility='Nairobi Air Force Base (KDPA)'})

Tried tables, selectors, etc.. nothing.

Any ideas? I'm not even sure that's the right lua wrapper, but there is no other host or assignedBase property.

Thanks,
Post #: 1
RE: setting a hostFacility property - 6/20/2020 1:32:49 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
To change base using the unit wrapper.
quote:


local u = ScenEdit_GetUnit({name='Looking #1', guid='207d76e0-e5be-4012-bbc8-93a142bb5b7b'})
print(u.base)
-- new base has to be a unit wrapper for some reason (I can't recall why)
u.base = ScenEdit_GetUnit({name='Tsu'})
print(u.base)


_____________________________

Michael

(in reply to wqc12345)
Post #: 2
RE: setting a hostFacility property - 6/20/2020 1:34:29 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
unit.hostFacility from memory is the the facility holding the unit (such as a Hanger)

_____________________________

Michael

(in reply to michaelm75au)
Post #: 3
RE: setting a hostFacility property - 6/20/2020 1:41:16 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
quote:

ScenEdit_SetUnit({ side = 'USSR' , name = 'Roxy #1', base = 'Nairobi Air Force Base (KDPA)'})


This should work also as long as the base can host the unit.

_____________________________

Michael

(in reply to michaelm75au)
Post #: 4
RE: setting a hostFacility property - 6/20/2020 6:13:19 PM   
wqc12345


Posts: 250
Joined: 12/7/2015
From: San Francisco, CA
Status: offline
Thanks. That worked.


(in reply to michaelm75au)
Post #: 5
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> setting a hostFacility property Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.934