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


Notices

Reply
 
Thread Tools Display Modes
Old 11-19-2017, 03:31 AM   #911
Delta99
Member
 
Delta99's Avatar
 
Join Date: Jan 2017
Posts: 146
Reputation power: 1
Delta99 is on a distinguished road
Default

Quote:
Originally Posted by L39Tom View Post
Thanks delta99!
So it seams impossible to get the distance between a bomb impact and a target on a shooting range!? What a pity
Do not take my word as final. There might be something, it’s just I haven’t heard of it.
__________________
My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements
Delta99 is offline   Reply With Quote
Old 11-19-2017, 10:41 AM   #912
Quax456
Member
 
Quax456's Avatar
 
Join Date: May 2012
Location: Lübeck, Germany
Posts: 562
Reputation power: 7
Quax456 will become famous soon enoughQuax456 will become famous soon enough
Default

A long time ago. Bunnyjap made a precision bombing contest. He mesured it out via MIST and Lua script. I'm pretty shure!
__________________
"The sky's the limit!'

Modules: A-10C, Mirage 2000C, Mig15, F-86F, UH-1, Gazelle, BF-109K, P-51D, F-5E, CA, Spitfire IX, SAAB Viggen, FC3, Su33...

My Rig: Windows 10 Pro, AMD FX8350, 16GB DDR3 RAM, Gigabyte GA-990FXA-UD3, Samsung SSD 850 EVO 500GB, 2xSamsung 1,5TB HDD, GTX1070 G1, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals + TrackIR5

Quax456 is offline   Reply With Quote
Old 11-19-2017, 11:29 AM   #913
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,003
Reputation power: 149
Grimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud ofGrimes has much to be proud of
Default

Quote:
Originally Posted by Quax456 View Post
A long time ago. Bunnyjap made a precision bombing contest. He mesured it out via MIST and Lua script. I'm pretty shure!
Yep, using default scripting functions mostly. Just run land.getIP really fast with information updated on the bombs current position and velocity vector. Whatever was the last known intersect point will be pretty damn close to where the bomb impacted. The FC3 mission Sukhoi Surprise should have a working example to work from.

Its always good to know what the scripting engine can and can't do. Mist, moose, etc don't add any functionality to the scripting engine. They just package functions/object oriented approaches to make aspects of it more practical.
__________________
You can only tie the world record for lowest flight.
Current Projects: Scripting Wiki, Something...
Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD for DCS 1.5/2.0, IADScript, Mission Editing Wiki!, Mission Building Forum
Grimes is offline   Reply With Quote
Old 11-19-2017, 11:33 AM   #914
L39Tom
Junior Member
 
Join Date: Aug 2016
Posts: 15
Reputation power: 0
L39Tom is on a distinguished road
Default

Thanks funkyfranky again helping with the moving zones.
@quax456: Sounds good. I think there is a shooting range mission made by Snafu with MIST, too. Hope dies last.
L39Tom is offline   Reply With Quote
Old 11-19-2017, 05:35 PM   #915
Habu_69
Member
 
Join Date: Jul 2011
Posts: 234
Reputation power: 7
Habu_69 is on a distinguished road
Default

Another older Noobie attempting to figure this stuff out, so bear with me. I have wathed the vids and read most of the docs. Questions nevertheless.

1. What is purpose/usage of Moose_Dynamic_Loader.lua and Moose_Static_Loader.lua, Moose_Create.lua? Are these install files the user should ignore?

2. What is usage and purpose of Moose_Update_Missions.bat?

3. Some of the code examples lack the do/end function. Does such a script work independently, or is it meant to be copy/pasted into other scripts?

4. Does Moose_.lua function exactly like Moose.lua only a smaller file with no comments?

I marvel at the effort required to develop and promote Moose, and the functionality it provides. Many thanks to FlightControl and others involved.
Habu_69 is offline   Reply With Quote
Old 11-19-2017, 09:18 PM   #916
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Trymheim, Asgård
Posts: 1,167
Reputation power: 19
funkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of light
Default

Quote:
Originally Posted by Habu_69 View Post
1. What is purpose/usage of Moose_Dynamic_Loader.lua and Moose_Static_Loader.lua, Moose_Create.lua? Are these install files the user should ignore?
You can ignore those.

Quote:
Originally Posted by Habu_69 View Post
2. What is usage and purpose of Moose_Update_Missions.bat?
It puts the (updated) Moose.lua into the example mission files. So you can also safely ignore it.

Quote:
Originally Posted by Habu_69 View Post
3. Some of the code examples lack the do/end function. Does such a script work independently, or is it meant to be copy/pasted into other scripts?
Do/end is usually used to keep local variables defined just within that structure. I also don't know why exactly they are there sometimes and other times not.

Quote:
Originally Posted by Habu_69 View Post
4. Does Moose_.lua function exactly like Moose.lua only a smaller file with no comments?
Yes, the files do exactly the same. As you say, the Moose_.lua is just without any comments and blank lines. Makes it harder to read but a little lighter to load over the network.

Good questions! Keep asking
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-4790K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 1866 MHz DDR-3| Win 10 64-bit | Asus Maximus Hero VII | Samung EVO 850 SSD | TM HOTAS Warthog | MFG Crosswind | TrackIR 5 | HTC Vive | CV1
funkyfranky is offline   Reply With Quote
Old 11-20-2017, 08:34 PM   #917
Habu_69
Member
 
Join Date: Jul 2011
Posts: 234
Reputation power: 7
Habu_69 is on a distinguished road
Default

OK. First attempt at MOOSE has me blocked. Scenario: test mission Normandy theater. 4 (red) CAP groups positioned in ME, each with its own CAP zone. I wish to spawn 1 of the groups randomly, have it CAP in its associated zone and engage enemy (blue) when in specified range. Player should not know direction of attack, if any. Note that 1 of the groups is a null group that has no zone and will not engage. Code:

Code:
-- Habu: Nov 2017

-- Spawn randomly 1 of 3 CAP groups, or none, in patrol zones. Attack enemy at engagement range.


Templates = { 
    "3R_Cap #001", 
    "3R_Cap #002", 
    "3R_Cap #003", 
    "3R_Cap #004" 
    }                               -- Array of 4 potential CAP plane groups

Spawn_CAP = SPAWN:New( "3R_Cap" )
    :InitLimit( 1, 1 )
    :InitRandomizeTemplate(Templates)   -- Randomly spawn 1 plane template group

PatrolZoneN = ZONE:New( "Cap Zone N" )   -- Initialize 3 CAP zones
PatrolZoneS = ZONE:New( "Cap Zone S" )
PatrolZoneE = ZONE:New( "Cap Zone E" )

AICapZoneN = AI_CAP_ZONE:New( PatrolZoneN, 2500, 3000, 320, 380 )   -- CAP parameters
AICapZoneS = AI_CAP_ZONE:New( PatrolZoneS, 2500, 3000, 320, 380 )
AICapZoneE = AI_CAP_ZONE:New( PatrolZoneE, 2500, 3000, 320, 380 )

AICapZoneN:SetControllable( Spawn_CAP )   -- Assign Spawn_CAP to the CAP zones. Not sure about this.
AICapZoneS:SetControllable( Spawn_CAP )
AICapZoneE:SetControllable( Spawn_CAP )

AICapZoneN:SetEngageRange( 15000 )
AICapZoneS:SetEngageRange( 15000 ) 
AICapZoneE:SetEngageRange( 15000 )  -- Set the Engage Range to 15,000 meters.

AICapZone:__Start( 1 ) -- Startup after 1 sec., and start patrolling in the PatrolZone.
The mission spawns only the target blue aircraft. I suspect the primary issue is assigning the spawned CAP to its associated zone. Of course this may be only one of the problems. The template array might also be amiss. Mission file attached.
CAP Test.miz
Habu_69 is offline   Reply With Quote
Old 11-20-2017, 08:54 PM   #918
Delta99
Member
 
Delta99's Avatar
 
Join Date: Jan 2017
Posts: 146
Reputation power: 1
Delta99 is on a distinguished road
Default

Quote:
Originally Posted by Habu_69 View Post
OK. First attempt at MOOSE has me blocked. Scenario: test mission Normandy theater. 4 (red) CAP groups positioned in ME, each with its own CAP zone. I wish to spawn 1 of the groups randomly, have it CAP in its associated zone and engage enemy (blue) when in specified range. Player should not know direction of attack, if any. Note that 1 of the groups is a null group that has no zone and will not engage. Code:

Code:
-- Habu: Nov 2017

-- Spawn randomly 1 of 3 CAP groups, or none, in patrol zones. Attack enemy at engagement range.


Templates = { 
    "3R_Cap #001", 
    "3R_Cap #002", 
    "3R_Cap #003", 
    "3R_Cap #004" 
    }                               -- Array of 4 potential CAP plane groups

Spawn_CAP = SPAWN:New( "3R_Cap" )
    :InitLimit( 1, 1 )
    :InitRandomizeTemplate(Templates)   -- Randomly spawn 1 plane template group

PatrolZoneN = ZONE:New( "Cap Zone N" )   -- Initialize 3 CAP zones
PatrolZoneS = ZONE:New( "Cap Zone S" )
PatrolZoneE = ZONE:New( "Cap Zone E" )

AICapZoneN = AI_CAP_ZONE:New( PatrolZoneN, 2500, 3000, 320, 380 )   -- CAP parameters
AICapZoneS = AI_CAP_ZONE:New( PatrolZoneS, 2500, 3000, 320, 380 )
AICapZoneE = AI_CAP_ZONE:New( PatrolZoneE, 2500, 3000, 320, 380 )

AICapZoneN:SetControllable( Spawn_CAP )   -- Assign Spawn_CAP to the CAP zones. Not sure about this.
AICapZoneS:SetControllable( Spawn_CAP )
AICapZoneE:SetControllable( Spawn_CAP )

AICapZoneN:SetEngageRange( 15000 )
AICapZoneS:SetEngageRange( 15000 ) 
AICapZoneE:SetEngageRange( 15000 )  -- Set the Engage Range to 15,000 meters.

AICapZone:__Start( 1 ) -- Startup after 1 sec., and start patrolling in the PatrolZone.
The mission spawns only the target blue aircraft. I suspect the primary issue is assigning the spawned CAP to its associated zone. Of course this may be only one of the problems. The template array might also be amiss. Mission file attached.
Attachment 172516
Couple of things. First, you are not actually spawning the CAP group. You need Spawn_CAP:Spawn()

Second, I very highly doubt you can assign to all 3 zones. That will likely break things or only really work with the last zone.

Just saw a third thing. You are attempting to start a CAP Zone that doesn't even exist. You are issuing __Start() on a variable that is not defined.

What I would do if I were you is get this working with just one CAP zone and then think about where you want to take it once that works.

Also that NULL group (however you are defining that) will likely break things too. I would approach this a bit differently. I would have an array with 3 real groups defined and a NIL value. I would then randomly select a value from that array. If its NIL do nothing, otherwise continue with spawning the random one you picked.

Further, it depends on whether you are going to be playing with InitLimit here. If so, you need to take probably yet another approach and catch when the units are spawned and then attach them to the CAP ZONE etc.
__________________
My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements
Delta99 is offline   Reply With Quote
Old 11-20-2017, 11:31 PM   #919
Habu_69
Member
 
Join Date: Jul 2011
Posts: 234
Reputation power: 7
Habu_69 is on a distinguished road
Default

Hmmm. Tx for looking into this. Much to think about. Having a different CAP zone for each of the CAP groups seems to present a difficult scenario.
Habu_69 is offline   Reply With Quote
Old 11-21-2017, 12:10 AM   #920
Delta99
Member
 
Delta99's Avatar
 
Join Date: Jan 2017
Posts: 146
Reputation power: 1
Delta99 is on a distinguished road
Default

Quote:
Originally Posted by Habu_69 View Post
Hmmm. Tx for looking into this. Much to think about. Having a different CAP zone for each of the CAP groups seems to present a difficult scenario.
You will find with Moose that there are many ways to approach things.

For instance you might be looking for something that is more suited for AI-A2A-Dispatcher: http://flightcontrol-master.github.i...ispatcher.html
__________________
My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements
Delta99 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 02:04 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.