CMANO Fooling with Fuel (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> The War Room



Message


mikmykWS -> CMANO Fooling with Fuel (6/2/2017 6:57:07 PM)

Quick article on a few fuel related lua scripts

http://www.mikmyk.com/cmano/cmano-fooling-with-fuel/




Dan109 -> RE: CMANO Fooling with Fuel (6/3/2017 1:45:02 AM)

Hi Mike,

Great example. But this got me to thinking, LUA scripts can be run in parallel? Use of the "wait" command is telling me LUA will be stuck in that loop for a while. I didn't realize LUA was able to run in parallel with the scenario.

An explicit example of what I was wanting to do was to work on a shoot-n-scoot script for Radars. Rather than call the script every 5s, I can launch it once, go through my code and wait(5) and repeat? All, while having other scripts that might get triggered in parallel?

Cheers,
Dan




Dan109 -> RE: CMANO Fooling with Fuel (6/6/2017 7:44:06 AM)

Mike,

I was fooling around with 'wait' - well, the 5.3 LUA Documentation I looked at didn't have it, but saw from google searches, that people have made home grown wait functions using the clock library. So, It tried it...and it kinda just froze all of CMANO during the wait period - so, fairly useless IMO in 1.12. Was your script using a future dev build that will have some interesting LUA improvements?

Cheers,
Dan

(Or was I taking your script WAY TOO literally, and you meant that the wait statement was for just a general amount of time passing in the game)




mikmykWS -> RE: CMANO Fooling with Fuel (6/7/2017 11:27:48 AM)

Hi Dan

Wrote it some time ago for a pro request and worked great. I'll take a look though and see what's going on. Will update the blog post with any findings or new code.

Mike




mikmykWS -> RE: CMANO Fooling with Fuel (6/7/2017 4:11:37 PM)

Yeah wait isn't a good option but there is an easier way. A regular time trigger offers a form of persistence.

So fix would be something like this.

1. Create a regular time trigger for a second.
2.lua action to run the check.
3. Create a repeatable event and suppress the event log message

Mike




Dan109 -> RE: CMANO Fooling with Fuel (6/7/2017 8:41:34 PM)

Ok, that makes sense. And that also makes me conclude that multiple LUA scripts cannot be executing at the same time, and unless doing your above suggested "event wait 1s" technique, all UI time is considered frozen until the completion of a LUA script.




mikmykWS -> RE: CMANO Fooling with Fuel (6/7/2017 9:02:04 PM)

I've executed multiple scripts using the same trigger so I don't arrive at the conclusion they can't be run at the same time although would have to watch the execution to know for sure. It could very well be one after another. Given these scripts achieved their purpose I'm not sure I really care [8D]

Mike




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.671875