Jump to content
M1ke_SK

[RELEASE] Simple Bomb Defuse [script]

Recommended Posts

1. dedicated

 

2. advanced ace medic system 

defaut explosion class

yes we use modded uniforms

no eventhandlers 

yes we use a lot of mods its would be hard to list them as we use differents presets

Share this post


Link to post
Share on other sites
I checked your scenarios and tested it on dedicated server. Locality of hint should be fixed now. As of "not damaging unit with ACE3 mod" it should be fixed too. In further you should test it with your mods. I added debug logs, so if you can, please send me rpt file.

 

 

Updated to version v1.2

 

 

Changelog:

 


v1.2

- reformat to functions

- added multiplayer / dedicated server support (tested)

- added JIP support (tested)

- hint showing to only defuser (tested)

- battle-tested in real environment

- changed to "plug & play" system

- added settings.sqf file

- added readme.txt file for instructions

- cleaned code

  • Like 1

Share this post


Link to post
Share on other sites

Good job.

any variable to check if bomb has been disabled? for trigger condition example

_status = _bomb getVariable "a3f_bomb_active";
if(_status == false) then { /* bomb deactivated */ };
  • Like 1

Share this post


Link to post
Share on other sites

Awesome script. Very easy to implement. I'm trying to build it into a mission where once you defuse two bombs, an objective is completed. Can anyone walk a noob through how to do this? I'm assuming a simple piece of script in the activation or condition field of a trigger will do the trick... Thanks.

Share this post


Link to post
Share on other sites

Not tested, but you got the idea how to do it now:

if ( { (alive _x) && (_x getVariable "a3f_bomb_active" == false) } count (allMissionObjects "Land_MetalBarrel_F") == 2 ) then { /* Two bombs deactivated */ };

Share this post


Link to post
Share on other sites

Much appreciated, though I'm not entirely sure where to put that..?

 

I'm coming from the most basic of basics. My objective is set up as so-- objective module placed, set task state synced to obj module, and an empty trigger synced to set task state. Objective module is of course linked to players and trigger to set it once blufor gets close enough. It's probably way easier than I'm imagining, but I'm looking for the set task state to fire "succeeded" via the trigger, once the two bombs are disarmed. I just have no idea how to link any of that in a working manner. Basically need an extreme hand-holding walk through on what piece of script I need to copy/paste and to where...lol. Sorry to ask so much.

Share this post


Link to post
Share on other sites

Heyhey, thanks for the script. Found it just recently and it works fine - mostly.

I can attach it and I have the blinking light etc. Howerver there is no beeping sound.

So I was looking for ages to find the solution. I even copied the barrel from your test mission into mine.

Now it get interesting. It beeps. Awesome. Then I moved it to another location - no beeping sound again. Moved it back - beeping like intended.

Any idea where my mistake is?

 

Thanks in advance!

Slingshot

Share this post


Link to post
Share on other sites
38 minutes ago, Lostan said:

Heyhey, thanks for the script. Found it just recently and it works fine - mostly.

I can attach it and I have the blinking light etc. Howerver there is no beeping sound.

So I was looking for ages to find the solution. I even copied the barrel from your test mission into mine.

Now it get interesting. It beeps. Awesome. Then I moved it to another location - no beeping sound again. Moved it back - beeping like intended.

Any idea where my mistake is?

 

Thanks in advance!

Slingshot

 

Make sure that barrel is NOT simpleObject and have simulation ENABLED.

 

Can you post your mission so we can have better look?

Share this post


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

Thanks for the fast reply.

Ofc, here you go. Right click - save as.

https://www.dropbox.com/s/kg5m1tktezs5ylc/Ipota_v6.Tanoa.rar?dl=0

 

The mission is not ready yet though. You find the barrel (copied from your mission) without sound in the hotel disctric on the northest island.

 

Cheers Slingshot

Can you wrote dependencies (mods used) ? I dont have all mods you need for mission.

Share this post


Link to post
Share on other sites

Sorry, my bad. I am quite new to mission building and totally forgot about it. Hope this is what you need:

@ace

@BWMod

@CBA_A3

@CUP_Terrains_Complete

@Project OPFOR

@RHSUSAF

@task_force_radio

 

Slingshot

 

Edited by Lostan

Share this post


Link to post
Share on other sites
On 6/5/2017 at 2:12 PM, Lostan said:

Sorry, my bad. I am quite new to mission building and totally forgot about it. Hope this is what you need:

@ace

@BWMod

@CBA_A3

@CUP_Terrains_Complete

@Project OPFOR

@RHSUSAF

@task_force_radio

 

Slingshot

 

Sorry for delay. I was away. Will test shortly, Did you tried script without mods ?

Share this post


Link to post
Share on other sites

Hey M1ke,

 

don't worry too much. There is no rush needed.

I tried the script with your included mission. Works perfect. Tried it with my mission - only works in a specific spot. As I meantioned above it's just the beeping sound missing.

Everything else works perfectly fine and as intended.

 

Cheers Slingshot

 

Share this post


Link to post
Share on other sites

Hi so i'm training to use this on my mission, but im getting into some problem, i'm trying to add this if you defuse the bomb but i don't get it to work on the server.
Its in the fn_defuseSuccsess.sqf
 

params ["_object"];
diag_log format ["fn_defuseSuccess | _object: %1", _object];

private _defuser = _object getVariable ["a3f_bomb_defuser", 0];
{
	detach _x;
	deleteVehicle _x;
} forEach attachedObjects _object;
"bomb deactivated" remoteExec ["hintSilent", _defuser, true];
sleep 1;
[64825,0] call HG_fnc_addOrSubCash;
sleep 1;
[9945,0] call HG_fnc_addOrSubXP;
sleep 1;
hintSilent parseText format["<t size='1' font='PuristaMedium' color='#d79420'>You defuse the BOMB, you get $64825 and 9945Xp. %1!</t>", name player];
"bomb","bomb2","bomb3","bomb4","bomb5","bomb6","bomb7","bomb8","bomb9","bomb10","bomb11","bomb12","bomb13","bomb14","bomb15" setMarkerAlpha 0;
"bomb","bomb2","bomb3","bomb4","bomb5","bomb6","bomb7","bomb8","bomb9","bomb10","bomb11","bomb12","bomb13","bomb14","bomb15" setMarkerText "";
"The BOMB is Defused" remoteExecCall ["hint",-2,false];

i made a script so it will spawn in to some random markers.

 

MySideMissionFunctionBOMB =
{
    onGoing = false;

    _airDrop =
	{
    //////////////////////////////////////  CUSTOM FUNCTION  //////////////////////////////////////
   //
   //			This function is My Terrorist Attack Function
   //
   //

   "Prevent the Terrorist Attack in 25 minutes, check the location on the map" remoteExecCall ["hint",-2,false];
   _rnd = selectRandom ["bomb","bomb2","bomb3","bomb4","bomb5","bomb6","bomb7","bomb8","bomb9","bomb10","bomb11","bomb12","bomb13","bomb14","bomb15"];
   _rnd setMarkerAlpha 1;
   _rnd setMarkerText "Here is where the terrorists will attack.. Deactivate the BOMB";
   sleep (10 * 60);
   "Prevent the Terrorist Attack in 10 minutes, check the location on the map" remoteExecCall ["hint",-2,false];
   sleep (10 * 60);
   "Prevent the Terrorist Attack in 5 minutes, check the location on the map" remoteExecCall ["hint",-2,false];
   sleep (5 * 60);
   _object = "Land_MetalBarrel_F" createVehicle (markerPos _rnd);
   _object setPos [(markerPos _rnd) select 0,(markerPos _rnd) select 1,1];
   [objNull,_object] call BIS_fnc_findSafePos;
   _object setVariable["persistent",true];

   [_object, 13, true, false] execVM "bomb\bomb.sqf";
   "You have 25 mins left to Prevent the Terrorist Attack, hurry up lads" remoteExecCall ["hint",-2,false];
   sleep (10 * 60);
   "You have 35 mins left to Prevent the Terrorist Attack, hurry up lads" remoteExecCall ["hint",-2,false];
   sleep (10 * 60);
   "You have 20 mins left to Prevent the Terrorist Attack, hurry up lads" remoteExecCall ["hint",-2,false];
   sleep (10 * 60);
   "You have 5 mins left to Prevent the Terrorist Attack, hurry up lads" remoteExecCall ["hint",-2,false];
   sleep 43;
   _rnd setMarkerAlpha 0;
   _rnd setMarkerText "";
   _object spawn bomb_fnc_defuseFail;
   detach _object;
   deleteVehicle _object;
   attachedObjects _object;
   "The terrorist plan was a success, better luck next time..." remoteExecCall ["hint",-2,false];
   sleep (10 * 60);
   
  onGoing = false;
	};

	while {true} do
	{
	  sleep 15;
		[] spawn _airDrop;
		onGoing = true;
		waitUntil {!onGoing};
	};
};


[] spawn MySideMissionFunctionBOMB;

Dont know if you still are her in the forum but if you understand i'm trying to make the point and Xp go to the player who has defuse the bomb and it goes in a loop.
THANKS

Share this post


Link to post
Share on other sites

What seems to be problem? Show your errors.

 

quick look: 

_object spawn bomb_fnc_defuseFail;

should be

[_object] spawn bomb_fnc_defuseFail;

 

What these commands supposed to do by your definition?

detach _object;
deleteVehicle _object;
attachedObjects _object;
 This code ...
"bomb","bomb2","bomb3","bomb4","bomb5","bomb6","bomb7","bomb8","bomb9","bomb10","bomb11","bomb12","bomb13","bomb14","bomb15" setMarkerAlpha 0;
"bomb","bomb2","bomb3","bomb4","bomb5","bomb6","bomb7","bomb8","bomb9","bomb10","bomb11","bomb12","bomb13","bomb14","bomb15" setMarkerText "";

replace with

{ 
	_x setMarkerAlpha 0;
	_x setMarkerText "";
} 
forEach ["bomb","bomb2","bomb3","bomb4","bomb5","bomb6","bomb7","bomb8","bomb9","bomb10","bomb11","bomb12","bomb13","bomb14","bomb15"];

Share this post


Link to post
Share on other sites

HI thanks for taking a look.

 

detach _object;
deleteVehicle _object;
attachedObjects _object;

I was hoping that it will take of the things that was on the object when it spawn to another location, but as i add this to it it will blow up, wan time is up.

 

14 hours ago, M1ke_SK said:

[_object] spawn bomb_fnc_defuseFail;



what about this code, do you know where i can add it if it's sukses wan defusing the bomb, this will give the players some points for defusing the bomb.
 

[64825,0] call HG_fnc_addOrSubCash;
sleep 1;
[9945,0] call HG_fnc_addOrSubXP;

thanks for looking at it.

Share this post


Link to post
Share on other sites

Hello, I have this error message appears:

Script bomb\functions\fn_attachObjects.sqf not found

What should I do thanks?

Share this post


Link to post
Share on other sites
13 hours ago, ricoarma said:

Hello, I have this error message appears:


Script bomb\functions\fn_attachObjects.sqf not found

What should I do thanks?

 

You are missing sqf file in your mission folder.

 

Do you have folder "bomb" and all files in your mission folder?

Share this post


Link to post
Share on other sites
On 17/11/2017 at 10:19 AM, M1ke_SK said:

 

You are missing sqf file in your mission folder.

 

Do you have folder "bomb" and all files in your mission folder?

In my mission file xxx.malden, I have the files "mission.sqm", "description.ext" (with this):

class CfgFunctions
{
    #include "scripts\bomb\cfgFunctions.hpp"
};

and, "init.sqf", a folder "images", and a folder "scripts" with the folder "bomb" and all the files...

Share this post


Link to post
Share on other sites

You have defined wrong path to functions. It should be (if folder bomb is in root of mission folder) :

class CfgFunctions
{
    #include "bomb\cfgFunctions.hpp"
};

Share this post


Link to post
Share on other sites
17 hours ago, M1ke_SK said:

You have defined wrong path to functions. It should be (if folder bomb is in root of mission folder) :


class CfgFunctions
{
    #include "bomb\cfgFunctions.hpp"
};

It's good I found, as the file "bomb" is in a file must add this command line in the init:
0 = [_ thisTrigger] execVM "scripts \ cz75_breachingdoors.sqf";
and in the cfgFunctions.hpp put this:

class bomb
{
    class BombClass
    {
        tag = "bomb";
        file = "scripts\bomb\functions";


Stupid boy I am:down:

Share this post


Link to post
Share on other sites

Hi man,
Trying to make a task with the bomb but i can't create a trigger for changing the task stats to succedded after desarming it,
already tryied :
_status = _bomb getVariable "a3f_bomb_active"; if(_status == false) then { /* bomb deactivated */ };

But the editor return with a error "Condition: Generic error in expression."

I new on this, thanks

Share this post


Link to post
Share on other sites
7 hours ago, MarceloBoZo said:

Hi man,
Trying to make a task with the bomb but i can't create a trigger for changing the task stats to succedded after desarming it,
already tryied :
_status = _bomb getVariable "a3f_bomb_active"; if(_status == false) then { /* bomb deactivated */ };

But the editor return with a error "Condition: Generic error in expression."

I new on this, thanks

condition should return BOOL value, that means true or false. In your case it return null/nil as you add code with " ; " at end. Also you are using LOCAL variables (_bomb, _status) in global condition.

 

Try to name bomb object with global name, as "bomb1" (without "") and then in condition:

 

! (bomb1 getVariable ["a3f_bomb_active", true])

 

bomb1 - is name of your bomb object

true - is default condition in idle status of bomb

! - negation of status ( true is false and false is true ) - because we are waiting for bomb to have FALSE value, so when it does, condition in trigger will be TRUE and activate trigger

  • Thanks 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

×