Jump to content

Recommended Posts

Posted

As the title says. 

If I output the value for

Unit.getByName(unitName):getID()

it is surrounded by quotes and it's type is a string

But if I do this:

Unit.getGroup(Unit.getByName(unitName)):getID()

It's type is number.

So to make the first statement work I have to cast the return value 'tonumber'.

 

 

Posted

Hi. I'm no Grimes: my scripting abilities are very limited.

Could you please attach a .miz demonstrating the issue? Maybe by adding 1 to the result, so the first expression works OK, and the second one throws a "string is no number" kind of error.

---

Posted

Okay, you're going to need to view the DCS.log as it's running to see the output.

I'd suggest the free app called 'BARETAIL' or you can just let this mission run for 5 seconds and then open dcs.log in your texteditor of choice. 

This is the results you get from the two function calls listen in my original post:

2024-05-07 10:26:37.427 INFO    SCRIPTING (Main): {
  [1] = "1",
  [2] = 1,
}

Notice that the first result as double quotation marks around it? That denotes that the value is of type STRING. 

The seconds one has no quotes, this denotes that it is of type NUMBER. 

They BOTH should be numbers. 

typeBugDemo.lua typeBugDemo.miz

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...