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


Notices

Reply
 
Thread Tools Display Modes
Old 10-18-2019, 02:10 PM   #1791
BoneDust
Senior Member
 
BoneDust's Avatar
 
Join Date: Nov 2007
Location: NB, Canada
Posts: 1,035
Default

Is there a way in MOOSE to have get player name and unit then play a sound file when they join the unit? I see a way in MIST but would prefer to use MOOSE.



cheers
__________________


Spoiler:
Windows® 10 Home Premium | 64bit, Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (Cores 6) (Logical/Core 2) | NVIDIA GeForce GTX 1080 Ti 11GB | 1 X 1TB SSD | 1 X 275GB SSD | Sound Blaster X-Fi Xtreme Audio sound card | 16GB Dual Channel DDR3 SDRAM at 1333MHz | Oculus Rift S
BoneDust is offline   Reply With Quote
Old 10-21-2019, 02:57 PM   #1792
ataribaby
Member
 
Join Date: Feb 2009
Location: Czechia
Posts: 130
Default

Hello,
I have problem with static spawn. When I spawn smoke+fire effect via:

PointVec2:BigSmokeAndFireHuge(1)

It works fine in SP, in MP on dedicated server it only works if player is connected. Otherwise no static smoke+fire effects are placed. No scripting bug in log. It is just not there.

Is there some workaround or it is DCS limitation please?

Last edited by ataribaby; 10-21-2019 at 06:59 PM.
ataribaby is offline   Reply With Quote
Old 10-21-2019, 04:07 PM   #1793
Delta99
Member
 
Delta99's Avatar
 
Join Date: Jan 2017
Posts: 411
Default

Quote:
Originally Posted by ataribaby View Post
Hello,
I have problem with static spawn. When I spawn smoke+fire effect via:

PointVec2:BigSmokeAndFireHuge(1)

It works fine in SP, in MP on dedicated server it only works if player is connected. Otherwise no static smoke+fire effects are placed. No scripting bug in log. It just not there.

Is there some workaround or it is DCS limitation please?
This is one of those typical DCS MP issues.
__________________
My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements
Delta99 is offline   Reply With Quote
Old 10-22-2019, 11:34 PM   #1794
AbortedMan
Member
 
Join Date: Jul 2012
Posts: 314
Default

Can anyone help identify whether this is a DCS/MOOSE bug or am I doing something wrong?...

I went to the MOOSE discord to seek assistance with creating a respawning "stream" of APCs filled with infantry using AICargoDispatchAPC that will continuously attempt to enter a zone (inevitably being destroyed until a player intervenes and clears the way). This requires the APC and its CARGO infantry group to respawn and function again as it did at the start of the mission. AICargoDispatcherAPC breaks unless the :OnSpawnGroup/CARGO_GROUP etc lines are added, but when those are added the :InitLimit line is ignored and infantry gets spawned infinitely. I only want a small number of APCs and infantry alive at one time so it doesn't bog down the mission, but the script I found on the Discord (from someone that had an identical request back in July) seems to be missing something or bugged so it's ignoring :InitLimit( 5,25 ) or any other number I enter...it just keeps creating infantry infinitely.

I suspect it's something to do with the :OnSpawnGroup changing the whatever the InitLimit is looking to count so it never reaches its designated limit. Does anyone have any insight on how to fix this?

Code:
Zone1 = ZONE:New("spawn1")
Zone2 = ZONE:New("spawn2") 
Destination1 = ZONE:New("DeployZone")

Zonegroup1 = {Zone1}
Zonegroup2 = {Zone2}

CargoInfantrySet = SET_CARGO:New():FilterTypes( "Unit" ):FilterStart()
SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart()
DeployZonesSet = SET_ZONE:New():FilterPrefixes( "DeployZone" ):FilterOnce()
AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, CargoInfantrySet, nil, DeployZonesSet,500 ) 
AICargoDispatcherAPC:SetDeploySpeed(40)
AICargoDispatcherAPC:SetPickupSpeed(40)
AICargoDispatcherAPC:__Start(10)


Spawn_LCAC = SPAWN:New("APC")
:InitKeepUnitNames()
:InitLimit(4,15)
--:InitRandomizeTemplate( LCACPlatoons )
:InitRandomizeZones(Zonegroup1) 
:SpawnScheduled( 7, 0 )
        

Spawn_Infantry = SPAWN:New("Unit")
  :InitKeepUnitNames()
  :InitLimit(5,25)
--  :InitRandomizeTemplate(LCACInfantry)
 :InitRandomizeZones(Zonegroup1) 
  --:InitCleanUp(240)
  :OnSpawnGroup( 
    function( SpawnGroup )
      CARGO_GROUP:New(SpawnGroup,"Unit",SpawnGroup:GetName(),150,20) 
    end)
  :SpawnScheduled( 5, 0 )
AbortedMan is offline   Reply With Quote
Old 10-24-2019, 04:54 PM   #1795
A101Wayz
Member
 
Join Date: Feb 2019
Posts: 121
Default

Quote:
Originally Posted by BoneDust View Post
Is there a way in MOOSE to have get player name and unit then play a sound file when they join the unit? I see a way in MIST but would prefer to use MOOSE.
cheers
You can use EVENTS.Birth to check when a unit has spawned... Then check EventData for IniPlayerName...

Code:
function OnEventBirth(EventData)
  if EventData.IniPlayerName then
    [insert logic for playing soundfiles here]

  end
end
Never used it for that exact purpose, but I see no reason why it shouldn't work. EVENTS.PlayerEnterUnit works in SP, but not in MP.
EVENTS.Birth works in MP just fine.
__________________
Wayz Out


Intel Core i9 9900K | ASUS ROG Strix Z390E Gaming MB | G.Skill Ripjaws V 32gb DDR4-3200 | GeForce GTX 1070 Ti FTW2 | Samsung 970 EVO Plus NVMe
HTC Vive Pro VR | Logitech G x56 HOTAS | Logitech G PRO Pedals
A101Wayz is offline   Reply With Quote
Old 10-24-2019, 05:24 PM   #1796
assafm25
Member
 
assafm25's Avatar
 
Join Date: Oct 2012
Location: israel
Posts: 679
Default

Where can I found a list of all the Parsion Gulf Air fiealds name?
__________________


IAF Bell205
IAF Anafa

-----------------------
DCS World Modules: A-10C, FC3, MiG-21BiS, F-86, P-51, KA-50, UH-1H Huey, Mi-8, M2000K, Gazal, Bf109, Mig-15, Hawk and NTTR
-----------------------
My System - ASUS Maximus HERO iiiv, CoolMaster 120 Sadion Plus, I7 -6700K @4.0, G.Skill ddr4 16GB ram, Gigabyte GTX 1070 G1 , PSU Seasonic X-650W, OCZ 150 500Gb ssd drive X2, Seagate 7200 1T X2.
-------------
assafm25 is offline   Reply With Quote
Old 10-25-2019, 11:51 AM   #1797
hobus
Junior Member
 
hobus's Avatar
 
Join Date: Feb 2013
Location: Sweden
Posts: 4
Default

Quote:
Originally Posted by assafm25 View Post
Where can I found a list of all the Parsion Gulf Air fiealds name?

https://flightcontrol-master.github....E).PersianGulf
hobus is offline   Reply With Quote
Old 10-25-2019, 01:20 PM   #1798
assafm25
Member
 
assafm25's Avatar
 
Join Date: Oct 2012
Location: israel
Posts: 679
Default

Thanks.
But i not think this is the names i should use in the RAT script.
__________________


IAF Bell205
IAF Anafa

-----------------------
DCS World Modules: A-10C, FC3, MiG-21BiS, F-86, P-51, KA-50, UH-1H Huey, Mi-8, M2000K, Gazal, Bf109, Mig-15, Hawk and NTTR
-----------------------
My System - ASUS Maximus HERO iiiv, CoolMaster 120 Sadion Plus, I7 -6700K @4.0, G.Skill ddr4 16GB ram, Gigabyte GTX 1070 G1 , PSU Seasonic X-650W, OCZ 150 500Gb ssd drive X2, Seagate 7200 1T X2.
-------------
assafm25 is offline   Reply With Quote
Old 10-25-2019, 01:45 PM   #1799
hobus
Junior Member
 
hobus's Avatar
 
Join Date: Feb 2013
Location: Sweden
Posts: 4
Default

Quote:
Originally Posted by assafm25 View Post
Thanks.
But i not think this is the names i should use in the RAT script.

You can mix the references to the airports like this, either by name or by calling the AIRBASE reference:
Code:
Airport_red = ({"Gelendzhik",AIRBASE.Caucasus.Mineralnye_Vody})

Here is the whole list coiped from the moose.lua file:
Code:
AIRBASE.PersianGulf = {
  ["Abu_Dhabi_International_Airport"] = "Abu Dhabi International Airport",
  ["Abu_Musa_Island_Airport"] = "Abu Musa Island Airport",
  ["Al_Ain_International_Airport"] = "Al Ain International Airport",
  ["Al_Bateen_Airport"] = "Al-Bateen Airport",
  ["Al_Dhafra_AB"] = "Al Dhafra AB",
  ["Al_Maktoum_Intl"] = "Al Maktoum Intl",
  ["Al_Minhad_AB"] = "Al Minhad AB",
  ["Bandar_Abbas_Intl"] = "Bandar Abbas Intl",
  ["Bandar_Lengeh"] = "Bandar Lengeh",
  ["Bandar_e_Jask_airfield"] = "Bandar-e-Jask airfield",
  ["Dubai_Intl"] = "Dubai Intl",  
  ["Fujairah_Intl"] = "Fujairah Intl",
  ["Havadarya"] = "Havadarya",
  ["Jiroft_Airport"] = "Jiroft Airport",
  ["Kerman_Airport"] = "Kerman Airport",
  ["Khasab"] = "Khasab",
  ["Kish_International_Airport"] = "Kish International Airport",
  ["Lar_Airbase"] = "Lar Airbase",
  ["Lavan_Island_Airport"] = "Lavan Island Airport",
  ["Liwa_Airbase"] = "Liwa Airbase",
  ["Qeshm_Island"] = "Qeshm Island",
  ["Ras_Al_Khaimah_International_Airport"] = "Ras Al Khaimah International Airport",
  ["Sas_Al_Nakheel_Airport"] = "Sas Al Nakheel Airport",
  ["Sharjah_Intl"] = "Sharjah Intl",
  ["Shiraz_International_Airport"] = "Shiraz International Airport",
  ["Sir_Abu_Nuayr"] = "Sir Abu Nuayr",
  ["Sirri_Island"] = "Sirri Island",
  ["Tunb_Island_AFB"] = "Tunb Island AFB",
  ["Tunb_Kochak"] = "Tunb Kochak",
}

Last edited by hobus; 10-25-2019 at 01:53 PM.
hobus is offline   Reply With Quote
Old 10-25-2019, 07:50 PM   #1800
AbortedMan
Member
 
Join Date: Jul 2012
Posts: 314
Default

InitLimit is broken when spawning CARGO_GROUP using function(SpawnGroup) (as in my post above)...I'm a Lua newb, but trying to work on a way to manually stop spawning of units that have been spawned in with the code that is misbehaving to create a workaround for the issue. It's currently crippling the mission I have planned.

Can anyone assist with this?

Code:
--Add Infantry to CARGO SET
local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()

-- Here we setup the spawning of Infantry..
local SpawnCargoInfantry = SPAWN
  :New( "Infantry" )
  :InitLimit( 40, 60 )
  :InitRandomizeZones( { ZONE_POLYGON:NewFromGroupName( "Pickup Location" ) } )
  :OnSpawnGroup(
    function( SpawnGroup )
      -- This will automatically add also the CargoInfantry object to the SetCargoInfantry (in the background through the event system).
      -- This line below breaks the InitLimit function by, I suspect, changing the name of the group that is spawned before InitLimit can count it
      local CargoInfantry = CARGO_GROUP:New( SpawnGroup, "Infantry", SpawnGroup:GetName(), 150 )
    end
  )
  :SpawnScheduled( 2, 0.5 )
--Here is my code to try and stop spawning after 10 Infantry have been spawned
local SpawnCargoInfantry = GROUP:FindByName( "Infantry" )
    SpawnCargoInfantry:HandleEvent( EVENTS.Birth )
    function SpawnCargoInfantry:OnEventBirth( EventData )
           InfantrySize = SpawnCargoInfantry:GetSize()
        if InfantrySize > 10 then
           self:SpawnScheduleStop()
    end
  end
--Here is my code to try and start spawning once <10 Infantry are alive
      SpawnCargoInfantry:HandleEvent( EVENTS.Dead )
      function SpawnCargoInfantry:OnEventDead( EventData )
        self:SpawnScheduleStart()
        end
Neither of my additions are working. Is self:SpawnScheduleStop() and start not seeing the original SpawnScheduled(2, 0.5) to identify what to start/stop?

Last edited by AbortedMan; 10-25-2019 at 07:54 PM.
AbortedMan 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 - 2019, Jelsoft Enterprises Ltd.