[Release] Pop-Up Targets (Shooting Range) for 1.8.0.3 w/ rMod 2.1+

BDC

Well-Known Member
Howdy gang, been playing around a lot with rMod lately. I cooked up a simple script for being able to use the pop-up targets (TargetEPopUp) that may be added into the database on a private server. It is a part of rMod 2.1+ but I'm not sure if it's a part of vanilla DayZ or not. I suspect not.

This one's very simple. It makes the target not only stand up initially upon server reset but also bounce back up after a few seconds after being shot.

Step 1) Modify Server_Monitor.SQF

This one's in \dayz_server\system. Go to around line 110 or so and look for this line:

Code:
if (_damage < 1) then {

This is the section that handles loading in an object in the database to be put active on the map. It's normally used for vehicles but some folks (like me) like to add static objects like guns or buildings to it as well.

Find this section within the area we're looking:

Code:
if (_object isKindOf "TentStorage" || _object isKindOf "CamoNet_DZ" || _object isKindOf "Land_A_tent") then {
                    _pos set [2,0];
                    _object setpos _pos;
                    _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
                };

...and add this below it:

Code:
// Special considerations - ^bdc
                if (_object isKindOf "TargetEPopup") then { // Monitor script for Pop-Up targets at shooting range - ^bdc
                    [_object] execVM "fixes\popuptarget.sqf";
                };

The script we're calling is in fixes folder within \dayzserver\MPMissions\dayz1.Chernarus mission folder. However, some use a 'scripts' folder or 'addons'. It doesn't really matter as long as it's running in the proper place.

Step 2) Create PopUpTarget.SQF

Once you're done here, make a new file in your fixes or scripts folder (within your mission folder) and name it "popuptarget.sqf". This is the simple, looped monitor function that animates/re-animates the popuptarget 'TargetEPopUp' object:

Code:
_target = _this select 0;
diag_log format["PopUpTarget.SQF called for TargetEPopUp object %1. Running scheduled looped routine.",_target];
 
// First pop-up
_target animate["terc",0];
 
while {alive _target} do
{
    if (_target animationPhase "terc" > 0.1) then {
        sleep 7;
        _target animate["terc",0];
    };
    sleep 2;
};
 
diag_log format["PopUpTarget (TargetEPopUp) object %1 has been destroyed. Stopping animate loop.",_target];

.. and save it. Pretty simple! Make sure you re-compile your dayz_server.pbo and place it back into the proper folder (\dayzserver\@hive\addons for pwnzor0z users).

B
 
Back
Top