Jump to content
Kreyne

Validate a task by destroying a game object

Recommended Posts

I would like to validate a mission when I destroy an object like a mining shovel.

Share this post


Link to post
Share on other sites
5 hours ago, Kreyne said:

I would like to validate a mission when I destroy an object like a mining shovel.

 

Welcome on BI forums

You can't destroy objects like mining shovel.

  • Like 1

Share this post


Link to post
Share on other sites
9 minutes ago, pierremgi said:

Welcome on BI forums

You can't destroy objects like mining shovel.

But you can place a small destructible object near the mining shovel, and base your trigger off that .  I'm assuming you are having player place explosives near the mining shovel.  You can even place a hidden AI, hide him (hideObjectGlobal true), and set him to have no voice (so you don't have a talking shoel!), and attach him to the shovel so he can't move.  Now an explosion near that unit would kill this ai, and you could detect that and use it for your trigger condition.

  • Like 5

Share this post


Link to post
Share on other sites

@johnnyboy it's an alternative idea, thank you!

  • Like 1

Share this post


Link to post
Share on other sites
On 1/4/2020 at 10:31 AM, johnnyboy said:

But you can place a small destructible object near the mining shovel, and base your trigger off that .  I'm assuming you are having player place explosives near the mining shovel.  You can even place a hidden AI, hide him (hideObjectGlobal true), and set him to have no voice (so you don't have a talking shoel!), and attach him to the shovel so he can't move.  Now an explosion near that unit would kill this ai, and you could detect that and use it for your trigger condition.

 

Good idea, but to take it further.

 

It's best to avoid unnecessary attach commands for performance reasons, same with placing unnecessary AI units.

 

Best would be to place some small destructible object (I know Johnnyboy knows this, posting this for the OP). 

  • Like 2

Share this post


Link to post
Share on other sites

Or just detect the  explosive ammo. Depending on what you intend to do for "destroying" the object.

 

In one of my (old) scenario (end Game fashion) , I had to blow up a C130 wreck (name C130_1 here). As wreck, the object isn't destroyable.

So i placed a trigger  any player present

In on act:
 

{
  _handle = _x addEventHandler["take", {
    params ["_plyr","","_charge"];
    if ( toLowerANSI _charge in ["democharge_remote_mag","satchelcharge_remote_mag","claymoredirectionalmine_remote_mag","slamdirectionalmine_wire_mag"]) then { 
      _charge_to_place = allmines select (count allmines -1); 
      [_plyr,_charge_to_place,_thisEventHandler] spawn {
      	params ["_plyr","_charge","_eh"];
        waituntil {isnull _charge};
        deleteVehicle c130_1;
        _plyr removeEventHandler ["take",_eh];
      };
    };
  }]
} forEach thisList;

 

EDITED

  • Like 3

Share this post


Link to post
Share on other sites
30 minutes ago, pierremgi said:

Or just detect the  explosive ammo. Depending on what you intend to do for "destroying" the object.

Perfect solution, all coded, and ready to use, with a bow on it!  You should reward yourself and head immediately to a beautiful Tahitian beach!  🐠🌴🌺🐟🍺🌞😎

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

My bad. I simplified too quickly my script. Corrected now.

 

 

It's working perfectly now, thanks.

 

Here's a little video of it in use, with a little extra I added for more effect.

 

 

  • Like 4

Share this post


Link to post
Share on other sites
23 minutes ago, stburr91 said:

Here's a little video of it in use, with a little extra I added for more effect.

Awesome added detail of replacing whole object with parts.  That extra effort pays off in immersion IMO. @Kreyne in your case, you could sink the Steam Shovel via setpos with a  negative z value, and use BIS_fnc_setPitchBank to tilt it.  You could even simulate breaking the shovel in 2 pieces by tilting and sinking original shovel so only backend showing above ground, and creating a second steam shovel next to it that is sunk and tilted differently so only the shovel part above ground.  And possibly add a couple airplane crater objects around it for rubble (filter objects with word "crater" to find these"). 

 

#ImmersionMatters!!!

  • Like 5

Share this post


Link to post
Share on other sites
2 hours ago, johnnyboy said:

Awesome added detail of replacing whole object with parts.  That extra effort pays off in immersion IMO. @Kreyne in your case, you could sink the Steam Shovel via setpos with a  negative z value, and use BIS_fnc_setPitchBank to tilt it.  You could even simulate breaking the shovel in 2 pieces by tilting and sinking original shovel so only backend showing above ground, and creating a second steam shovel next to it that is sunk and tilted differently so only the shovel part above ground.  And possibly add a couple airplane crater objects around it for rubble (filter objects with word "crater" to find these"). 

 

#ImmersionMatters!!!

 

 

I completely agree, it's well worth the time to create a little immersion.

 

Here's a little test I did for destroying the large shovel using your suggestion.

 

 

  • Like 5

Share this post


Link to post
Share on other sites
54 minutes ago, stburr91 said:

Here's a little test I did for destroying the large shovel using your suggestion.

Perfect!  Agreed, totally worth it.

Share this post


Link to post
Share on other sites

Bad guys destroying nice shovel thingies.

Me no like.

 

Spoiler

Looks pretty neat though.

 

Cheers

 

  • Haha 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×