Jump to content

Map Objects as mission targets


A2597

Recommended Posts

I'm working on a mission where I want to use map objects as mission targets, but having some trouble doing so.

 

 

 

I know I can use MIST to track map object destruction, which is needed because I'll be adding a secondary explosion and smoke effect on destruction. The main issue is the objects are fuel/oil tanks, and their hit points are excessive for such.

 

 

I can unload a full set of rockets onto the tank and it won't blow up, and that just feels wrong, especially since the mission goal is to take out as many as possible.

 

 

 

I experimented with placing a unit by the fuel tanks, but it still feels weird because the damage area isn't exactly on the fuel tank model. (Worked well otherwise, could use that unit to trigger the explosion and smoke, track score, etc)

 

 

 

Is there a way to pre-damage a map object so it doesn't take so much to destroy it? Also open to other suggestions on how to implement this. At most, a couple rockets should cause the unit destruction, and for some a guns pass should trigger it. After destruction, need to trigger secondary explosion and smoke, and add points to player score.

Link to comment
Share on other sites

You could just set a zone around each target tank and then set off an explosion at mission start using the "Explosion" trigger action... It would take some experimenting to figure out exactly what size of explosion would cripple the tank to a desired way but that's the first step I would try.

 

I thought there may be a way to use the in game system to detect your rockets (there are options for detecting missiles and bombs in zones) and set off the explosion to make the effect really inspiring- but you'd need to figure out if your mission can be tailored in such a way that specific ordinance can be expected in the zone.

 

You may be able to do that through MIST easily... I'm not that great with some of the deeper functionality in addEventHandler etc.

 

Anyway, if it were me and I needed an easy solution I'd start by trying an explosion in all of the zones with tanks in them... and adjust the explosion so they were damaged but not destroyed.

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Could you use a zone/zones and use the trigger action 'remove scenery' to take out the original tanks then replace them with new static objects-structures-chemical tank (or whatever it's called). I think there are a quite a few buildings in the list.

Link to comment
Share on other sites

You could just set a zone around each target tank and then set off an explosion at mission start using the "Explosion" trigger action... It would take some experimenting to figure out exactly what size of explosion would cripple the tank to a desired way but that's the first step I would try.

 

I thought there may be a way to use the in game system to detect your rockets (there are options for detecting missiles and bombs in zones) and set off the explosion to make the effect really inspiring- but you'd need to figure out if your mission can be tailored in such a way that specific ordinance can be expected in the zone.

 

You may be able to do that through MIST easily... I'm not that great with some of the deeper functionality in addEventHandler etc.

 

Anyway, if it were me and I needed an easy solution I'd start by trying an explosion in all of the zones with tanks in them... and adjust the explosion so they were damaged but not destroyed.

 

 

So trigger explosion on mission start. Probably have to stagger them, as the goal is a refinery so there's lots and lots of targets... Will take some experimentation, but thank you! :)

Link to comment
Share on other sites

I think the best design would be just an event handler recording a hit on one, then trigger an explosion (or more) as a secondary explosion. Would make a nice delayed double bang.

 

 

Should have mentioned; to find the object.id you need to do an explosion on zone first and look to what id's the event handler returns in order to track the map objects. Map objs are not easily found because there are millions of them. Mist counts the dead ones in zone, not sure if he returns the unit id so you can make the event handler, so destroying it with an open event handler printing to logs will give you the detail. here's a moose example but it's almost identical

 

EventHandler = EVENTHANDLER:New()

EventHandler:HandleEvent( EVENTS.Dead )

function EventHandler:OnEventDead( EventData )

 

if EventData.IniUnitName == 74645955 then --Scenery has a IniUnitName. You can find it by blowing it up first and catching the ID

MESSAGE:New("Poti East Bridge destroyed",10):ToAll()

trigger.action.outSound("radio1.ogg")

elseif EventData.IniUnitName == 74645956 then

MESSAGE:New("Poti East Bridge destroyed",10):ToAll()

trigger.action.outSound("radio1.ogg")

end

--You can do loads more

end


Edited by Pikey

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

I think the best design would be just an event handler recording a hit on one, then trigger an explosion (or more) as a secondary explosion. Would make a nice delayed double bang.

 

 

Should have mentioned; to find the object.id you need to do an explosion on zone first and look to what id's the event handler returns in order to track the map objects. Map objs are not easily found because there are millions of them. Mist counts the dead ones in zone, not sure if he returns the unit id so you can make the event handler, so destroying it with an open event handler printing to logs will give you the detail. here's a moose example but it's almost identical

 

EventHandler = EVENTHANDLER:New()

EventHandler:HandleEvent( EVENTS.Dead )

function EventHandler:OnEventDead( EventData )

 

if EventData.IniUnitName == 74645955 then --Scenery has a IniUnitName. You can find it by blowing it up first and catching the ID

MESSAGE:New("Poti East Bridge destroyed",10):ToAll()

trigger.action.outSound("radio1.ogg")

elseif EventData.IniUnitName == 74645956 then

MESSAGE:New("Poti East Bridge destroyed",10):ToAll()

trigger.action.outSound("radio1.ogg")

end

--You can do loads more

end

This is undoubtedly the more elegant way to do it- if you have any scripting experience or someone would

Help with something specific. I recommend the MOOSE discord.

 

I used to run a number of explosions at mission start to add some sense of a war torn region to my missions... and it worked reasonably well and since it happens almost immediately nobody sees them.

 

With that said Pikey definitely has the better solution and would be what I’d have recommended if I had his scripting skills.


Edited by ENO

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Could you use a zone/zones and use the trigger action 'remove scenery' to take out the original tanks then replace them with new static objects-structures-chemical tank (or whatever it's called). I think there are a quite a few buildings in the list.

its necessary to mention that Remove scenery is bugged and not synchronized over network in multiplayer.

CPU: AMD Ryzen 5 1600X

GPU: AMD RX 580

Link to comment
Share on other sites

so work flow =

 

1: Identify map object ID

 

2: track a hit event on that object ID

3: trigger explosion to weaken object, which may be enough to kill it depending on what the initial hit was

4: detect object death, and trigger secondary explosion.

 

 

 

And do this for over 100 objects. This sounds fun. :D

Link to comment
Share on other sites

Not viable for hundreds of objects. Concentrate on the ones you are actually attacking in your mission. If you want to go round changing the map to suit your explosive tastes you should surrender now.

 

 

 

Leave out (3) three. You need to do this manually to find it's ID though, a matter of placing zones and using the event onhit to work out what it is with an explosion (best to make a continuous trigger to explode on zone coordinate via menu item, it takes a few attempts to work out the object id as you tend to hit MANY with on blast so keep it small).

 

 

4. detect object HIT, then trigger an explosion at it's coord.

 

 

When you have the event reporting the x,y of the location you can do additional things like create a BIGSMOKE there, create timers with secondaries and so on.

 

 

There's no good way to obtain map object id's BEFORE something happens with them, there are literally millions. Ever since 2.1 things like bins and cars and fire extinguishers and fence parts are all unique.

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

I worked out a way of doing this some time ago without having to know or identify the object.

 

Basically a map object name is replaced by a destroyed version of the same when it is destroyed.

The trick is to capture the original name of the object in the target zone and then to monitor if this name has changed...

 

using Moose, the basics for capturing the initial object name is like this...

 

local Zone = ZONE:New("example zone")

Zone:Scan( Object.Category.SCENERY )

for scenery,object in pairs (Zone:GetScannedScenery()) do

table.insert (Scenery_Objects_in_Zone, object)

end

 

This object can then be stored in a table and checked periodically against the present object. This way, it is not necessary for the scripter to know the original name... only if that name has changed... if it has changed then it has been destroyed.

 

There are a couple of exceptions though... scenery ships etc.. simply disappear when destroyed and so the trick here is simply to see if the zone contains any scenery.. if not it has been destroyed.

Also, some buildings seem to be made of 2 objects and so both have to be tested. I've not tried this with static cars and planes etc.. so I'm not sure how well this would work.


Edited by FubarBundy
Link to comment
Share on other sites

Sounds useful, i'm interested in that. Only thing with this though is that the OP is finding it hard to actually destroy said map object in the first place. In reality some of them are very hard or indestructible (Bandar Abbas fuel tanks come to mind, may have changed). So he can't get that info until he kills one (or hits one and the event is returned). Catch 22.

 

I worked out a way of doing this some time ago without having to know or identify the object.

 

Basically a map object name is replaced by a destroyed version of the same when it is destroyed.

The trick is to capture the original name of the object in the target zone and then to monitor if this name has changed... If the name has changed then it has been destroyed. it is not necessary for the scripter to know the name... only if that name has changed.

 

There are a couple of exceptions though... scenery ships simply disappear when destroyed and so the trick here is simply to see if the zone contains any scenery.. if not it has been destroyed.

Also, some buildings seem to be made of 2 objects and so both have to be tested.

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

Yes on re-reading the original post I see the problem.

 

I think that the names of all objects, (even the Bandar Abbas fuel tanks ), can be captured (QED) but because they can't be destroyed, the name will never change. I'm thinking though, that as long as the name can be captured, it should still be possible to capture any hit on that object using an event handler (also QED)

 

I'll do some experimenting over the next few days and see if I an get it to work.


Edited by FubarBundy
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...