Jump to content

MIssion Scripting Tools (Mist)- enhancing mission scripting Lua


Recommended Posts

edit: sniped ;)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

  • ED Team
Good call. No I have not tried that, testing.....

 

EDIT: That works perfect! Just set speed 0 and add one waypoint in the heading you want and set the height. The speed on the first waypoint can’t be set under 1 so with this you will not be able to change position. Thanks to SiThSpAwN, rep inbound.

 

 

Excellent, glad it worked!

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Link to comment
Share on other sites

Updates to MIST3_2.lua

 

Hello Grimes,

 

I upgraded my mission to MIST 3.2 today from (my upgraded) MIST 3.1, which i debugged while making my mission. And my mission did not work anymore using MIST 3.2.

 

I recommend you add the following code in your MIST 3.2 file, and all will be okay. It is a dump from the unix diff tool, so the first is the line number and then the code. When you want to change, start from the bottom to the top, or the line numbers won't match anymore.

 

I also attached my updated MIST3_2_Sven.lua in case you find it more useful.

 

Line 1540

mist.DBs.units[coa_name][countryName][category][group_num]["communication"] = group_data.communication
mist.DBs.units[coa_name][countryName][category][group_num]["modulation"] = group_data.modulation
mist.DBs.units[coa_name][countryName][category][group_num]["frequency"] = group_data.frequency

Line 4460

elseif catName == 'HELICOPTER' and string.upper(groupType) == 'HELICOPTER' then
newCat = 'HELICOPTER'

Line 4629

newData.country = groupData.country
newData.task = groupData.task -- new
newData.communication = groupData.communication -- new
newData.modulation = groupData.modulation -- new
newData.frequency = groupData.frequency -- new

 

Hope you appreciate the update. Saw that you did some updates as i recommended in previous posts, but some we not done yet. So add these and it'll be fine.

 

 

Sven


Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

I have been using Mist 3.2 in 1.2.7 while I build/test a mission and assorted other stuff. However I have not tried using any of the spawning functions yet.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Okay, thanks.

 

With this being said, however... many of the functions would work when I tested them in "fly mission" in the ME, or when I was looking from the server side in an MP session-

 

When I joined on another computer as a client, however, I found that they wouldn't work.

 

Have you tried testing as a client?

 

Sorry to harp on it- very curious as to whether or not these are working again on the client side.

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Posting my killbox mission again. This is the one that used to result in crashing as soon as other clients joined (but it ran okay during the "fly mission" attempts.) The problem was originally seen as being the "group to random zone" function... and in the MP environment the vehicles would "de-sync" and eventually result in a crash.

 

Now it basically locks up right out of the gate...

 

00059.570 ERROR DCS: Mission script error: : [string "C:\Users\Eno\AppData\Local\Temp\DCS.openbet..."]:4244: Unit doesn't exist

stack traceback:

[C]: ?

[C]: in function 'getName'

[string "C:\Users\Eno\AppData\Local\Temp\DCS.openbet..."]:4244: in function 'f'

[string "C:\Users\Eno\AppData\Local\Temp\DCS.openbet..."]:509: in function 'onEvent'

[string "Scripts/World/EventHandlers.lua"]:13: in function <[string "Scripts/World/EventHandlers.lua"]:11>

[C]: in function 'addStaticObject'

[string "C:\Users\Eno\AppData\Local\Temp\DCS.openbet..."]:673: in function 'ConfigObject'

[string "C:\Users\Eno\AppData\Local\Temp\DCS.openbet..."]:647: in function 'NewStructure'

[string "C:\Users\Eno\AppData\Local\Temp\DCS.openbet..."]:1552: in function 'CallSpawnLogistics'

[string "CallSpawnLogistics("blue", 8, "us supplies"..."]:1: in main chunk

 

 

I think this is more CTTS related since it seems to revolve around calling out the logistical pieces at the mission start.

Eno's Killbox.1.2.7.miz

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Something changed with how static objects are handled as birth events which is causing an issue with the mist code because it doesn't completely support adding dynamically spawned objects to the mist DBs. I'll tidy up mist 3.3, add the required fix, and release asap.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

HELP. How do i determine the bearing from one unit to another?

mist.getBRString doesnt work, its not returning anything, and also not executing code thereafter.

 

My init code;

local unitpos = unit:getPoint()

local playerpos = playerUnit:getPoint()

 

local tblBrinfo1 = {playerpos , unitpos, true, true}

local sPos4 = mist.getBRString( tblBrinfo1 )

 

mist.message.add({text = ´target bearing´ .. sPos4 , displayTime = 5, coa = {'all'})

 

Problem -- the mist.message isnt executed. Why?


Edited by pappavis

met vriendelijke groet,

Михель

 

"умный, спортсмен, комсомолетс"

 

[sIGPIC]159th_pappavis.jpg[/sIGPIC]

 

[TABLE]SPECS: i9-9900K 32gigs RAM, Geforce 2070RTX, Creative XFi Fata1ity, TIR5, Valve Index & HP Reverb, HOTAS Warthog, Logitech G933 Headset, 10Tb storage.[/TABLE]

Link to comment
Share on other sites

HELP. How do i determine the bearing from one unit to another?

mist.getBRString doesnt work, its not returning anything, and also not executing code thereafter.

 

SOLVED with this 1-liner. :pilotfly:

 

local playerpos = playerUnit:getPoint()

mist.getBRString{units = { 'Unit4' }, ref = playerpos, alt = playerpos.y, metric = true}

 

RESULT:

(Unit4) '329 for 66 at 4593'

 

The catch is, that the unitlist must be a single unitname string, passed through as table.

met vriendelijke groet,

Михель

 

"умный, спортсмен, комсомолетс"

 

[sIGPIC]159th_pappavis.jpg[/sIGPIC]

 

[TABLE]SPECS: i9-9900K 32gigs RAM, Geforce 2070RTX, Creative XFi Fata1ity, TIR5, Valve Index & HP Reverb, HOTAS Warthog, Logitech G933 Headset, 10Tb storage.[/TABLE]

Link to comment
Share on other sites

Help wanted for a pre damage script for the RNLAF Apache D

 

Hi,

 

I'm Wine of the Virtual Aerobatic Group from the Netherlands.

For several years we are virtualy demostrating the RNLAF Apache Demo in BS1/FC2 at VFAT.

We would like to move towards BS2/DCS-W with the demo and fly it at VFAT 2014 in BS2/DCS-W.

 

But, we have one big wish !

We want the Longbow radar removed from the Apache, because the "Dutch" Apache D's don't have these. ( In the past we could hide it within a Alpha Layer of the skin texture. )

I discovered that in DCS this aint possible, but the Longbow radar should be removeable by using a (DAMAGE ) script which is activated at mission start.

 

I need desperate help with a .lua script file (or text) to add to the mission trigger.

 

Below a few screenshots that should be helpfull,

 

The argument #53 in the model viewer example is set to -0.002 , that makes the Longbow radar to disappear from the Apache D model or any value below zero.

 

modelviewer.jpg

 

 

In the mission triggers damage can be edit to a unit ( in this case pilot#001 )

But, the trigger still needs an action .. ?

And I think, that's where I need the .lua script for the removal of the Longbow radar.

 

triggers.jpg

 

 

The damage.lua file in the "aircrafts" folder shows the argument #53 and more values.

(The AH-64A_cells_properties are used by the AH-64D too.)

 

damage.jpg

 

 

A picture of the operational "Dutch" Apache AH-64D shows that they do not have the Longbow Radar.

 

Apache_Model_Update_1.jpg

 

 

The Apache Demo in BS1/FC2: If you zoom in closely towards the spot of the Longbow Radar, you'll see some small texture fragments left, but in flight you don't notice it to much ..

 

apache-d-2013.jpg

 

I really, really hope "Grimes", "Speed" or another .lua script able writer can help me !

 

Greets, Wine.


Edited by Wine
Link to comment
Share on other sites

@Wine

 

If I understand what you are trying to do, your trigger condition may be incorrect. With what you have the trigger will execute the script action only if the unit takes damage.

 

It sounds like you want to damage the unit so that the radar is gone.

 

You may want to use:

 

function trigger.action.explosion(Vec3 point, number power)

creates an explosion.

- point: point in 3D space.

- power: explosion power

 

Set your trigger once to execute when time is more than say 2 seconds and set the action to a script (or do script)

 

In your script you will want to get the vec3 position of your unit.

 

local unit_obj = Unit.getByName('name of your unit')

local vec3pos = unit_obj:getPosition()

-- Here you will need to experiment with the height of the explosion
vec3pos.z = vec3pos.z + 0.005 -- Try decimals or whole numbers

trigger.action.explosion(vec3pos, 1) -- You may want to try decimal numbers such as 0.3 to see if you can get a smaller magnitude

314-я смешанная авиационная дивизия

314th Mixed Aviation Division: The "Fighting Lemmings"- Forums: http://314thsquadron.enjin.com/ - ED Forum Group: http://forums.eagle.ru/group.php?groupid=119

Link to comment
Share on other sites

Wine, aside from creating an explosion, which might not reliably ONLY damage/remove the longbow radar, there is nothing in the scripting engine capable of helping you.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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