Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

CMANO Fooling with Fuel

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> The War Room >> CMANO Fooling with Fuel Page: [1]
Login
Message << Older Topic   Newer Topic >>
CMANO Fooling with Fuel - 6/2/2017 6:57:07 PM   
mikmykWS

 

Posts: 11524
Joined: 3/22/2005
Status: offline
Quick article on a few fuel related lua scripts

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

_____________________________

Post #: 1
RE: CMANO Fooling with Fuel - 6/3/2017 1:45:02 AM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
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

(in reply to mikmykWS)
Post #: 2
RE: CMANO Fooling with Fuel - 6/6/2017 7:44:06 AM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
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)

(in reply to Dan109)
Post #: 3
RE: CMANO Fooling with Fuel - 6/7/2017 11:27:48 AM   
mikmykWS

 

Posts: 11524
Joined: 3/22/2005
Status: offline
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

_____________________________


(in reply to Dan109)
Post #: 4
RE: CMANO Fooling with Fuel - 6/7/2017 4:11:37 PM   
mikmykWS

 

Posts: 11524
Joined: 3/22/2005
Status: offline
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


_____________________________


(in reply to mikmykWS)
Post #: 5
RE: CMANO Fooling with Fuel - 6/7/2017 8:41:34 PM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
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.

(in reply to mikmykWS)
Post #: 6
RE: CMANO Fooling with Fuel - 6/7/2017 9:02:04 PM   
mikmykWS

 

Posts: 11524
Joined: 3/22/2005
Status: offline
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

Mike

_____________________________


(in reply to Dan109)
Post #: 7
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> The War Room >> CMANO Fooling with Fuel Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.906