Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

How to add a Satellite by using lua?

 
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 >> How to add a Satellite by using lua? Page: [1]
Login
Message << Older Topic   Newer Topic >>
How to add a Satellite by using lua? - 5/19/2019 2:39:14 PM   
M1A2G

 

Posts: 29
Joined: 9/13/2017
Status: offline
I entried this in the Lua Console:
ScenEdit_AddUnit({side='C',name='X',type='Satellite',dbid=70,orbit=15,lat='23',lon='112'})

It showed 'ScenEdit_AddUnit 0 : ,Unable to create new unit'.
Was it because of my wrong entrying or the function itself had a bug?
Post #: 1
RE: How to add a Satellite by using lua? - 5/19/2019 3:58:07 PM   
stilesw


Posts: 1497
Joined: 6/26/2014
From: Hansville, WA, USA
Status: offline
M1A2G,

I just checked the online Lua reference (http://commandlua.github.io/index.html#Unit) and it looks like you should include the "NewUnit" parameter within the ScenEdit_AddUnit command.

ScenEdit_AddUnit
New unit selector.
... lists minimum fields required. Other fields from Unit may be included.

type string The type of unit (Ship, Sub, Aircraft, Facility, Satellite)
unitname string The name of the unit
side string The side name or GUID to add unit to
dbid number The database id of the unit
latitude Latitude Not required if a base is defined
longitude Longitude Not required if a base is defined
base string Unit base name or GUID where the unit will be 'hosted' (applicable to AIR, SHIP, SUB)
loadoutid number Aircraft database loadout id (applicable to AIR)
altitude number Unit altitude (applicable to AIR)
depth number Unit depth (applicable to SUBMARINE - note no sign)
orbit number Orbit index (applicable to SATELLITE)
guid string Optional custom GUID to override auto one

-Wayne


(in reply to M1A2G)
Post #: 2
RE: How to add a Satellite by using lua? - 5/19/2019 4:46:20 PM   
Whicker

 

Posts: 664
Joined: 6/20/2018
Status: offline
if you drop the orbit it works but it is non functional - looks like it is on the ground. What is orbit=15? where did you get that?

I don't see any examples of adding a satellite via lua, only thing I found was something about changing an existing ones orbit:
https://steamcommunity.com/app/321410/discussions/0/3362406825547730620/

(in reply to stilesw)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> How to add a Satellite by using lua? 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

2.406