Jump to content

ViperSix

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by ViperSix

  1. Thanks for the answer an first of all, thank you for this awesome framework you provided!!!! Now the whole story: What I want to archive is a group of vehicles that stops its spawning cycle (with a "max-unit-alive" limit of x) if another designated group is not alive. So a vehicle group that spawns as long as another group is alive. Basically just like the code you provided on gitHub, but instead for a single unit, for a group: local Tank1 = UNIT:FindByName( "Tank A" ) local Tank2 = UNIT:FindByName( "Tank B" ) -- Here we subscribe to the Dead events. So, if one of these tanks dies, the Tank1 or Tank2 objects will be notified. Tank1:HandleEvent( EVENTS.Dead ) Tank2:HandleEvent( EVENTS.Dead ) --- This function is an Event Handling function that will be called when Tank1 is Dead. -- @param Wrapper.Unit#UNIT self -- @param Core.Event#EVENTDATA EventData function Tank1:OnEventDead( EventData ) self:SmokeGreen() end --- This function is an Event Handling function that will be called when Tank2 is Dead. -- @param Wrapper.Unit#UNIT self -- @param Core.Event#EVENTDATA EventData function Tank2:OnEventDead( EventData ) self:SmokeBlue() end So something like: group1 (alive) = group 2 spawning -> on group1 (dead) = group 2 spawning -> off Thank You!!! :-) Im so exited about Moose.... Its just what DCS needs!
  2. Hi @ all. I am trying to handle an event of a group being dead, and activating a "SpawnScheduleStop" when this happens. I was trying to modify the "UNIT:FindByName" Class, by changing it as follows: (GROUP:FindByName) Obviously, this wasn't right... haha :megalol: What would be the right way to do this? I added the fraction of the code blow. :helpsmilie: _1st_OpFor_LMLRS_Base = [color="Red"]GROUP[/color]:FindByName( "1st OpFor LMLRS Group Base" ) _1st_OpFor_LMLRS_Base:HandleEvent( EVENTS.Dead ) function _1st_OpFor_LMLRS_Base:OnEventDead( EventData ) Respawn_1st_OpFor_LMLRS:SpawnScheduleStop() end Thanks!!!! :-D EDIT: Of course, above is more code, just for completion: -- Spawner Respawn_1st_OpFor_LMLRS = SPAWN :New("1st Grad Platoon (OpFor)") :InitLimit(8,0) :SpawnScheduled(6,0) -- Initialisation Spawns Respawn_1st_OpFor_LMLRS:Spawn() -- next
×
×
  • Create New...