Jump to content

Recommended Posts

hi all !
i was searching for a script that has the same effects as ACE3 explosives (i no longer use ACE3 because i want to keep it compatible with vanilla), and i found two great scripts,
3D explosives by Zorilya               http://www.armaholic.com/page.php?id=22059
SMS explosives by Voiper            http://www.armaholic.com/page.php?id=28266
now....both have theyr strenght and weakness, like 3D explosives miss the feature to detonate a specific charge and not all togheter, while SMS has this feature, but lack a good placement system (cannot stick to vertical surfaces,
cannot move mines in water ecc...)

my question is this: anyone knows a vanilla compatible script/addon that has all this working?

in case of a "no" .... i already tried to merge both, and was successful, but due to my lack of script ability, i'm actually placing 2 mines at once, one for each script, and i need a simple line to not drop the second mine if there are less than 2 in inventory!
can somepne help me ?
thanks !

Share this post


Link to post
Share on other sites

...or another (better) solution would be make the SMS script run on his own action (added with addaction), can anyone help please?

Share this post


Link to post
Share on other sites

Don't know how either one of those work and not keen on downloading them to find out, but here's a script to detonate a single explosive at a time (as it seemed smaller task to do):

  Reveal hidden contents

 

Now if the 3D explosives uses the vanilla way to place an explosive then placing this code into initPlayerLocal.sqf should do the job. But if it just creates one with createMine you need to edit the script. Also there's no range check on this unlike the basic Touch off action.

Share this post


Link to post
Share on other sites

Huge thanks man !! Gonna try it as soon as i get back from work !

Thanks !!

Share this post


Link to post
Share on other sites

yeeah it works perfectly in SP ! tonight will test it on dedicated!
huge thanks man !!

Share this post


Link to post
Share on other sites

Works on dedicated too !!

Really thanks man, awesome script, you re great !!!

Share this post


Link to post
Share on other sites

hello again!
i really wish to merge this awesome simple and efficient script of Kauppapekka into stealthstick's EtV script (so i can finally attach a charge and detonate just the one needed !).
i think the relevant part is where is the "attachTo", here is the code of this part:

  Reveal hidden contents

in case you need the full script, i paste it here :

  Reveal hidden contents


really thanks for the help, fixing this its like the end of a many-years-long nightmare for me :)
 

Share this post


Link to post
Share on other sites

I guess this should do it if you replace the spawn part with this spawn.
 

  Reveal hidden contents
Edited by kauppapekka
Pointless line in the script

Share this post


Link to post
Share on other sites

HUGE thanks man !
tested, it works perfectly !
really, really THANKS !

Share this post


Link to post
Share on other sites

hi all !
after accurate testing, i found 2 very hidden little problems :
1) the script offer to attach an explosive to a "simple map object" (like a tree in the map) , but trying to do it the result is that explosives get attached to your own left hand.
2) when attaching to an editor placed "simple object" , or to an object with  "enableSimulation FALSE" , it let it to attach, but when you try to detonate, it does not.
can someone understand whats wrong there ?
thanks !!!!!

PS: ( i wish to make it so it get attached to anything i'm pointing with cursor, and able to detonate it be it simple object or not )

Share this post


Link to post
Share on other sites

I noticed that the objects that allow attach actions, but dont actually attach explosive to, are nameless. Like trees, bushes ecc... Maybe thats related ?

Any way to attach something to a nameless object ?

Share this post


Link to post
Share on other sites

Yup attachTo doesn't seem to want to work with them map objects. One way would be to just place the object with the setPos commands and get the position you want with modelToWorld or lineIntersect, as it doesn't really need to be attached as the stuff won't move around.

 

Also might want to take this part away from the script if you're placing stuff on other than vehicles:

 + " [" + getText (configfile >> "CfgVehicles" >> typeOf _nearVehicle >> "displayName") + "]"



 

Share this post


Link to post
Share on other sites

Awesome !! 

Hem...im sorry to have to disturb you....but i need your help with code for this !

I wish to keep compatibility with vehicles and "displayName " if possible !

 

Really thanks for you help man really appreciated !!!


------------- E D I T ------------

well i was thinking, if its possible to discriminate the two situations, so can be used as it is for everything, but for a map object can be used a different system, and i found this:
https://community.bistudio.com/wiki/attachedTo
seems it returns the object , so a kind of check:
IF AttachedTo ObjNull THEN  ....  setpos (getpos player lefthand)   or something like it.   
the real point is being able to use this for example from underwater, where you try to attach a mine to an object and dont want it to fall,
a situation that normal game dont let you place a mine at all in water, and even if placed will probably fall to the sea bottom!

really thanks for any help !!

 

Share this post


Link to post
Share on other sites
[_explosive,_nearVehicle,_unit,_random0,_random1, _charge] spawn {        
    _explosive = _this select 0;
    _nearVehicle = _this select 1;
    _unit = _this select 2;
    _random0 = _this select 3;
    _random1 = _this select 4;
    _charge = _this select 5;
    
    sleep 1.5;
    _explosive attachTo [_nearVehicle];
    sleep 0.1;

    if (!(isNull attachedTo _explosive) && {!(isNull _nearVehicle)}) then {
        _explosive setPosWorld getPosWorld _nearVehicle;
    };

    [_explosive,_random0,_random1] call BIS_fnc_SetPitchBank;

    //_unit setVariable ["charges",(_unit getVariable ["charges",[]]) + [_explosive]];

    //[_explosive,_unit] spawn EtV_TimedCharge;

    private ["_actionID"];
    _actionID = 0;

    if (_nearVehicle isKindOf "LandVehicle" || _nearVehicle isKindOf "Air" || _nearVehicle isKindOf "Ship") then {
        _actionID = _unit addAction [
            "Detonate " + getText (configfile >> "CfgMagazines" >> _charge >> "displayName") + " [" + getText (configfile >> "CfgVehicles" >> typeOf _nearVehicle >> "displayName") + "]", 
            {_this select 3 setDamage 1}, 
            _explosive
        ]; 
    } else {
        _actionID = _unit addAction [
            "Detonate " + getText (configfile >> "CfgMagazines" >> _charge >> "displayName") + " [" + mapGridPosition _explosive + "]", 
            {_this select 3 setDamage 1}, 
            _explosive
        ]; 
    };

    [_explosive, _unit, _actionID] spawn {
        waitUntil {sleep 0.5; !alive (_this select 0) || !alive (_this select 1)}; 
        if (alive (_this select 1)) then {
            _this select 1 removeAction (_this select 2);
        };
    };     
};

 

Share this post


Link to post
Share on other sites

man.... really i wish to thank you somehow !
you're my personal explosives hero !!

H U G E   THANKS  !!!!!!!!!

Share this post


Link to post
Share on other sites

Hey guys

Sorry for the stupid question...

I think this script is the solution to my problem

But i don't hav e a clue where i need to paste this script or what to do with it in this form...

 

Can you please tell me where to paste it and if i need to make sure that i have additional files to make it work?

 

Thanks a lot!!!

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

×