Jump to content

Controller.resetTask() crashes DCS


TOViper

Recommended Posts

Hello!

 

For a unit "APC 1043 HMMWV Armament" having group name "JTAC_Group" and unitname "JTAC_Unit" if I use a waypoint action "Perform command" > "Run script", using this text here:

 

JTACcontroller = Unit.getByName("JTAC_Unit"):getController()
JTACcontroller:resetTask()

 

... DCS crashes 100% of the time.

 

Map Persian Gulf, OpenBeta 2.5.5.35461.

 

What can I do?


Edited by TOViper

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G | NVIDIA GTX 1080 Ti OC 11GB | 32 GB 3200 MHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TPR | Rift CV1

 

Link to comment
Share on other sites

Ground units don't have unit controllers. Try Group.getByName('JTAC_Group'):getController() to see if that crashes.

 

edit:

 

It crashes if you do it as part of a waypoint command. It doesn't crash if you trigger it.


Edited by Grimes

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

Ground units don't have unit controllers. Try Group.getByName('JTAC_Group'):getController() to see if that crashes.

 

edit:

 

It crashes if you do it as part of a waypoint command. It doesn't crash if you trigger it.

 

Unfortunately it does crash using this method too.

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G | NVIDIA GTX 1080 Ti OC 11GB | 32 GB 3200 MHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TPR | Rift CV1

 

Link to comment
Share on other sites

Did you trigger it on switching the waypoint? At least on the test build it crashed whenever the script was assigned around the moment the AI switched waypoints. However if the AI was in between waypoints the function worked fine.

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

Did you trigger it on switching the waypoint? At least on the test build it crashed whenever the script was assigned around the moment the AI switched waypoints. However if the AI was in between waypoints the function worked fine.

 

 

Ok, I will try to insert a time delay after passing the waypoint of a few seconds. Will report back. Thanks so far for the tips!

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G | NVIDIA GTX 1080 Ti OC 11GB | 32 GB 3200 MHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TPR | Rift CV1

 

Link to comment
Share on other sites

To sum it up quickly:

 

The delayed resetTask() works now (5 seconds after passing a waypoint triggered by a "Time Since Flag" trigger), but then the vehicle doesn't perform the waypoint tasks of the next waypoint (which I am sending it to by using a triggered action 1 second after the resetTask()).

 

Background is the following:

I cannot make the HMMWV to perform JTAC two or more times by attacking more than one group (one after the other). Seems I am spending useless time here on this old story.

 

Do we have any other solution to make JTAC work several times?

 

JTAC_resetTask_Test_Big.miz


Edited by TOViper

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G | NVIDIA GTX 1080 Ti OC 11GB | 32 GB 3200 MHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TPR | Rift CV1

 

Link to comment
Share on other sites

  • 2 years later...

Digging this thread up cus, well, it would seem resetTask() is a sneaky little bugger. I'm basically doing the same thing (setting the 'Mission' task) as mist is doing...BTW, thanks to the author of that - I hadn't really looked into it much until after day 3 of trying to kill this bug, to see how they did it. 

It's a complicated, multi-module, set of scripts and it would work fine, for a while. Runs for and hour ('soak' test) with no issues. Then it would crash after 5 minutes the next time (very intermittent).

This was a crash like "poof', back to desktop. No Windows "boing", no assert()'s, nothing in the log. Zero clues. Just blink, back to desktop. Somewhere I got the idea you needed resetTask() when 'uploading' a new 'Mission' task. And it worked fine for weeks, months even.

 

Anyway, hope this at least gives someone else some clue where to look when things get all pear-shaped on them for no obvious reason.

i6700k 4.4mhz, 32Gb, nVidia 1080, Odyssey+, CH Products, Derek Speare Designs button box, Bass shaker w/SimShaker For Aviators

Link to comment
Share on other sites

  • Recently Browsing   0 members

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