MOOSE - Mission Object Oriented Scripting Framework - Page 133 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 11-02-2018, 03:56 AM   #1321
sSkullZnBoneZz
Member
 
sSkullZnBoneZz's Avatar
 
Join Date: Apr 2013
Posts: 213
Default

Quote:
Originally Posted by Hardcard View Post
Seems like we're in sync or something.
I spent the whole day trying to create a MOOSE script that successfully returns unit climb/descent rate.
It's still work in progress, but it seems to work decently (the returned values are quite close to indicator readings, which is a good sign).

Here's the script:
Spoiler:
SCHEDULER:New( nil,
function()

local Client = UNIT:FindByName("Client")
local ClientVelocityMPS = Client:GetVelocityMPS()
local ClientVelocityMach = ClientVelocityMPS / 330 --Approximate conversion from m/s to Mach. The returned values seem accurate enough--
local ClientMOOSEDescentAngle = Client:GetClimbAnge() --I think that this might be actually returning the climb/descent angle in radians instead of degrees, contrary to what the documentation and intellisense say--
local ClientMOOSEDescentAngleDegree = UTILS.ToDegree(ClientMOOSEDescentAngle) --After adding this line, the script seems to work as intended!--

--This is one of the descent rate approximations I've tried. The returned values seem to be accurate enough--
local ClientDescentRateMOOSEFtM = ClientMOOSEDescentAngleDegree * ClientVelocityMach * 1165 --Returns climb/descent rate in feet per minute--
local ClientDescentRateMOOSEMpS = ClientDescentRateMOOSEFtM / 196.85 --Returns climb/descent rate in meters per second--

MESSAGE:New("Velocity (m/s):"..ClientVelocityMPS.."\nVelocity (Mach):"..ClientVelocityMach..
"\nMOOSE Descent Angle (Radians?):"..ClientMOOSEDescentAngle.."\nMOOSE Descent Angle (Degrees?):"..ClientMOOSEDescentAngleDegree..
"\nDescent Rate (Ft/min):"..ClientDescentRateMOOSEFtM.."\nDescent Rate (m/s):"..ClientDescentRateMOOSEMpS,5,nil,true):ToAll()

end, {}, 1, 5
)


Now, this script will only give you the following values:
- Unit's velocity (expressed in m/s and Mach number)
- Unit's climb/descent angle (expressed in radians and degrees... if I'm not mistaken)
- Unit's climb/descent rate (expressed in feet per minute and meters per second)

It won't set up any checkers, flags or triggers (which you'll probably need in order to accomplish what you described).
Lucky for you, that's the easy part

PS. If anyone knows a better way of getting unit climb/descent rates, I'm all ears!
Thanks! I’ll give a try.
__________________
sSkullZnBoneZz is offline   Reply With Quote
Old 11-02-2018, 06:11 PM   #1322
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 186
Default

So, using the script I provided before as a means to get your plane's descent rate, you could simply add a few extra lines inside that same scheduler (at the bottom, before the end) in order to receive those messages you mentioned
when the client is within that zone.

I think these extra lines should do the trick:
Spoiler:
local Carrier = UNIT:FindByName("UNIT name of the carrier in ME")
local CarrierZone = ZONE_UNIT:New("Name of the carrier zone in ME", Carrier, radius of the zone in ME)
local ClientCheck = Client:IsInZone(CarrierZone)

if ClientDescentRateMOOSEFtM < -800 and ClientCheck == true --I'm using a "<" (less than) operator in this check, since we're dealing with a negative value. It should work, haven't tested it, though!--
then
MESSAGE:New("Don't Settle!", 10, nil, true):ToAll()
USERSOUND:New("Name of your sound file.ogg"):ToAll()
end


Of course, in order for all this to work, the units and zone names in the script must match the ones you defined in ME.

Last edited by Hardcard; 11-02-2018 at 06:18 PM.
Hardcard is offline   Reply With Quote
Old 11-02-2018, 07:50 PM   #1323
Habu_69
Member
 
Join Date: Jul 2011
Location: USA VA
Posts: 546
Default

Anyone have a simple example of method: BIGSMOKEPRESET.MediumSmokeAndFire? to smoke static or coordinate?
Habu_69 is offline   Reply With Quote
Old 11-05-2018, 01:25 AM   #1324
rooster328
Junior Member
 
Join Date: Feb 2010
Posts: 51
Default

For some reason with this Moose script attached my CAP patrols are shooting down awacs and refuellers and sometimes own planes. Any idea why?
the link has the file
https://drive.google.com/open?id=1uR...IPlCCO1ithaBRX
rooster328 is offline   Reply With Quote
Old 11-05-2018, 05:51 AM   #1325
rooster328
Junior Member
 
Join Date: Feb 2010
Posts: 51
Default

weird. I went into trigggers and reloaded MIST, CTLD , MOOSE and the mission script and AI planes back to normal.
rooster328 is offline   Reply With Quote
Old 11-08-2018, 12:25 AM   #1326
Viper79
Senior Member
 
Viper79's Avatar
 
Join Date: Aug 2013
Location: Taranto - Puglia - Italy
Posts: 1,033
Default

Quote:
Originally Posted by rooster328 View Post
weird. I went into trigggers and reloaded MIST, CTLD , MOOSE and the mission script and AI planes back to normal.
Hello sorry for the stupid question, but MIST MOOSE and CTLD can I stay in the same mission? Do not they create conflicts?
__________________

________________

CPU i5 4690k@4.4ghz | COOLER CM MasterLiquid lite 240 | MB Asrock z97 pro4 | RAM 16GB G.Skill Sniper DDR3 1866@2000 mhz | GPU MSI GTX 1070 Armor OC | SSD Samsung M.2 860 EVO 250 + Kingston ssdNow 240GB | HDD 500GB x3 meccanici | PSU Coolermaster GX650W 80 plus bronze | SO Windows 10 pro 64bit | TrackIR 5 | Logitech X56 Rhino | Logitech DFGT

"Mai discutere con un idiota, ti trascina al suo livello e ti batte con l'esperienza" cit. Oscar Wilde
Viper79 is offline   Reply With Quote
Old 11-08-2018, 01:51 AM   #1327
Dino Might
Member
 
Dino Might's Avatar
 
Join Date: May 2015
Posts: 545
Default

Been trying to figure this for a couple of days and unable to determine whether the following is doable.

Spawn cargo static objects (e.g., uh1 cargo, container, ammo) that can be sling loaded, using similar methods to control total number of cargos available at once and redrawn or despawn in certain zones.

I can get this working with regular ground units, but not with statics.
Dino Might is offline   Reply With Quote
Old 11-08-2018, 08:29 AM   #1328
Viper79
Senior Member
 
Viper79's Avatar
 
Join Date: Aug 2013
Location: Taranto - Puglia - Italy
Posts: 1,033
Default

Has anyone tried using the newhornet LMAVs with the JTAC script? When I try, I find it impossible to do an uncage, while if I use the JTAC vanilla everything works perfectly.

EDIT: Sorry I saw that it is a bug reported, the MOOSE JTAC works fine, hopefully fix the mav with tomorrow's hotfix
__________________

________________

CPU i5 4690k@4.4ghz | COOLER CM MasterLiquid lite 240 | MB Asrock z97 pro4 | RAM 16GB G.Skill Sniper DDR3 1866@2000 mhz | GPU MSI GTX 1070 Armor OC | SSD Samsung M.2 860 EVO 250 + Kingston ssdNow 240GB | HDD 500GB x3 meccanici | PSU Coolermaster GX650W 80 plus bronze | SO Windows 10 pro 64bit | TrackIR 5 | Logitech X56 Rhino | Logitech DFGT

"Mai discutere con un idiota, ti trascina al suo livello e ti batte con l'esperienza" cit. Oscar Wilde

Last edited by Viper79; 11-08-2018 at 10:23 AM.
Viper79 is offline   Reply With Quote
Old 11-08-2018, 10:37 PM   #1329
Zaz0
Member
 
Zaz0's Avatar
 
Join Date: Jan 2012
Posts: 210
Default

Hi all,

I'm sorry if it's already answered, I didn't find anything here or at MOOSE web:

anyone knows how to get groups instead isolated aircrafts at GCI and CAP using GCICAP script? I using this code:

Code:
A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "RED EWR" }, { "enemigo" }, "invasion_FIR", { "CAP" }, 2, nil, nil, nil, 6 )

A2ADispatcher:SetDefaultOverhead( 1.5 )

A2ADispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Cold )

A2ADispatcher:SetDefaultGrouping( 2 )
and I get individual aircraft groups

Thanks!
Zaz0 is offline   Reply With Quote
Old 11-08-2018, 11:31 PM   #1330
Johnny_Rico
Senior Member
 
Johnny_Rico's Avatar
 
Join Date: Jul 2017
Posts: 1,372
Default

Quote:
Originally Posted by Dino Might View Post
Been trying to figure this for a couple of days and unable to determine whether the following is doable.

Spawn cargo static objects (e.g., uh1 cargo, container, ammo) that can be sling loaded, using similar methods to control total number of cargos available at once and redrawn or despawn in certain zones.

I can get this working with regular ground units, but not with statics.

It is doable, but a bit of work
__________________
METAR weather for DCS World missions

Guide to help out new DCS MOOSE Users -> HERE
Havoc Company Dedicated server info Connect IP: 94.23.215.203
SRS enabled - freqs - Main = 243, A2A = 244, A2G = 245
Please contact me HERE if you have any server feedback or METAR issues/requests
Johnny_Rico is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 06:48 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.