Questipon on QueryDB function...

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

Questipon on QueryDB function...

Post by jkgarner »

The CommandLua help page says the following about ScenEdit_QueryDB
ScenEdit_QueryDB

Query database use the wrapper_object_variable.fields to see what can be returned
Parameters

objectType string The type of item to query; 'weapon', 'mount', 'sensor'
DBID number The databse id of item to query

Returns

objectObject wrapper

Can this function be used to get DB data for more than just weapon, mount, sensor objects. For example, could I pass in the DBID of a 'Facility', or an 'Aircraft' type to get data regarding the facility or aircraft?

KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Questipon on QueryDB function...

Post by KnightHawk75 »

fb.asp?m=4802328 was that last I heard on the status about that.
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

RE: Questipon on QueryDB function...

Post by jkgarner »

@KnightHawk75:
I don't think you understood what I was asking. I'll give you a concrete example.

Say that from my Lua script I want to access operation service that is part of the Facility, as stored in the DB.

I have the dbid of the facility from the unit object.

ScenEdit_QueryDB returns a nil when I pass in 'Facility'.
It also returns nil if I use 'Aircraft', or 'Ship'.

It ONLY seems to work for 'weapon','mount', or 'sensor' (what they call an object type)

I don't see a way to access any data about the unit other than what is directly in the unit object.

Any thoughts?
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Questipon on QueryDB function...

Post by KnightHawk75 »

I understood perfectly, if you read the post I linked the answer for the rest, in April was...
Only weapon, mount and sensor have been converted.

So no, nothing but those are available as of 1147.5
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

RE: Questipon on QueryDB function...

Post by jkgarner »

I wonder when they will 'convert' the other objects, like units.
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Questipon on QueryDB function...

Post by KnightHawk75 »

I have no idea, perhaps more pressing priorities, but it would be crazy useful for scripting more adaptive or detailed logic, not to mention other things like the ToT Special Action 'thingy' I was working on.
User avatar
michaelm75au
Posts: 12464
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Questipon on QueryDB function...

Post by michaelm75au »

The reason I tackled the component parts first was to allow better control over using them in Lua scripts. And then things got 'busy'.[:D]
Michael
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

RE: Questipon on QueryDB function...

Post by jkgarner »

And then things got 'busy'.
'busy'!? I never get 'busy'
--yeah right! [X(]

OK, Mike, I understand busy...

Is there a plan to 'finish' and do the other objects?
Post Reply

Return to “Lua Legion”