Sign in to follow this  
Anhor

DMS cleanup Problem

3 posts in this topic

Hallo Exile-Cracks,

ich habe versucht eine statische Mission von DMS auf meine Bedürfnisse umzuschreiben. D.h. auf das Serversetting zugeschnitten, keine Fahrzeuge, kein "Crate", reine Infantrie.

Das funktioniert auch soweit ganz gut. Die Mission wird vom Server angekündigt, der Marker erscheint an der richtigen Stelle der Karte, die AI steht bereit.

Soweit so gut ...... nach dem Timeout kommt auch die Lose-Message und der Marker wird von der Karte gelöscht. Kommt man nun aber ne Stunde später vorbei lauert da immer noch die AI von der Mission ...... was etwas überraschend und ärgerlich ist.

Eventuell kann mir irgendwer helfen mit einem Tipp was ich falsch gemacht habe ...... hier mal die Mission:

Spoiler

// For logging purposes
_num = DMS_MissionCount;


// Set mission side (only "bandit" is supported for now)
_side = "bandit";

_pos = [6081,6681,0];

if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};


// Set general mission difficulty
_difficulty = "difficult";


// Define spawn locations for AI Soldiers. These will be used for the initial spawning of AI as well as reinforcements.
// The center spawn location is added 3 times so at least 3 AI will spawn initially at the center location, and so that future reinforcements are more likely to spawn at the center.
_AISoldierSpawnLocations =
[
    _pos
];

// Create AI
_AICount = 20 + (round (random 5));


_group =
[
    _pos,
    _AICount,
    _difficulty,
    "random",
    _side
] call DMS_fnc_SpawnAIGroup;

/*
_staticGuns =
[
    [
        [15914.6,16284.2,0],
        [15919.9,16271.2,0],
        [16087.8,16229.4,1.4],
        [16088.7,16192.4,0.15],
        [16100.4,16225.1,0],
        [16019.2,16216.5,2.93]
    ],
    _group,
    "assault",
    _difficulty,
    "bandit",
    "random"
] call DMS_fnc_SpawnAIStaticMG;


// Define the classnames and locations where the crates can spawn (at least 2, since we're spawning 2 crates)
_crateClasses_and_Positions =
[
    [[6082,6682,0],"I_CargoNet_01_ammo_F"],
    [[6083,6683,0],"I_CargoNet_01_ammo_F"],
    [[6084,6684,0],"I_CargoNet_01_ammo_F"],
    [[6085,6685,0],"I_CargoNet_01_ammo_F"],
    [[6086,6686,0],"I_CargoNet_01_ammo_F"]
];

{
    deleteVehicle (nearestObject _x);        // Make sure to remove any previous crates.
} forEach _crateClasses_and_Positions;

// Shuffle the list
_crateClasses_and_Positions = _crateClasses_and_Positions call ExileClient_util_array_shuffle;


// Create Crates
_crate0 = [_crateClasses_and_Positions select 0 select 1, _crateClasses_and_Positions select 0 select 0] call DMS_fnc_SpawnCrate;
_crate1 = [_crateClasses_and_Positions select 1 select 1, _crateClasses_and_Positions select 1 select 0] call DMS_fnc_SpawnCrate;


// Disable smoke on the crates so that the players have to search for them >:D
{
    _x setVariable ["DMS_AllowSmoke", false];
} forEach [_crate0,_crate1];


// Don't think an armed AI vehicle fit the idea behind the mission. You're welcome to uncomment this if you want.
_veh =
[
    [
        [_pos,100,random 360] call DMS_fnc_SelectOffsetPos,
        _pos
    ],
    _group,
    "assault",
    _difficulty,
    _side
] call DMS_fnc_SpawnAIVehicle;
*/


// Define mission-spawned AI Units
_missionAIUnits =
[
    _group         // We only spawned the single group for this mission
];

// Define the group reinforcements
_groupReinforcementsInfo =
[
    [
        _group,            // pass the group
        [
            [
                -1,        // Let's limit number of units instead...
                0
            ],
            [
                10,    // Maximum 100 units can be given as reinforcements.
                0
            ]
        ],
        [
            240,        // About a 4 minute delay between reinforcements.
            diag_tickTime
        ],
        _AISoldierSpawnLocations,
        "random",
        _difficulty,
        _side,
        "reinforce",
        [
            8,            // Reinforcements will only trigger if there's fewer than 10 members left in the group
            2            // 7 reinforcement units per wave.
        ]
    ]
];


/*
// Define mission-spawned objects and loot values
_missionObjs =
[
    [_crate0,[50,100,2]],
    [_crate1,[3,150,15]]
];
*/


// Define Mission Start message
_msgStart = ['#FFFF00', "A Viet Cong Platoon was spotted at FSB Ripcord! Wipe them out!"];

// Define Mission Win message
_msgWIN = ['#0080ff',"A LRRP has wiped out the Viet Cong Platoon!"];

// Define Mission Lose message
_msgLOSE = ['#FF0000',"The LRRP suffers heavy casualties and must retrieve!"];

// Define mission name (for map marker and logging)
_missionName = "VC Platoon";

// Create Markers
_markers =
[
    _pos,
    _missionName,
    _difficulty
] call DMS_fnc_CreateMarker;

_circle = _markers select 1;
_circle setMarkerDir 20;
_circle setMarkerSize [150,50];


_time = diag_tickTime;

// Parse and add mission info to missions monitor
_added =
[
    _pos,
    [
        [
            "kill",
            _group
        ],
        [
            "playerNear",
            [_pos,100]
        ]
    ],
    _groupReinforcementsInfo,
    [
        _time,
        DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
    ],
    _missionAIUnits,
    _missionObjs,
    [_missionName,_msgWIN,_msgLOSE],
    _markers,
    _side,
    _difficulty,
    []
] call DMS_fnc_AddMissionToMonitor_Static;

// Check to see if it was added correctly, otherwise delete the stuff
if !(_added) exitWith
{
    diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_fnc_AddMissionToMonitor_Static! Deleting mission objects and resetting DMS_MissionCount.",_missionName];

    _cleanup = [];
    {
        _cleanup pushBack _x;
    } forEach _missionAIUnits;

    _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));

    {
        _cleanup pushBack (_x select 0);
    } forEach (_missionObjs select 2);

    _cleanup call DMS_fnc_CleanUp;


    // Delete the markers directly
    {deleteMarker _x;} forEach _markers;


    // Reset the mission count
    DMS_MissionCount = DMS_MissionCount - 1;
};


// Notify players
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

 

if (DMS_DEBUG) then
{
    (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
};

Und hier gleich der entsprechende Auszug aus der DMS Config ...... weil die Frage ja bestimmt kommt:

Spoiler

/*General settings for static missions*/
    DMS_StaticMission                    = true;                        // Enable/disable static mission system.
    DMS_MaxStaticMissions                = 1;                        // Maximum number of Static Missions running at the same time.
    DMS_TimeToFirstStaticMission        = [30,30];                    // [Minimum,Maximum] time between first static mission spawn. | DEFAULT: 3-7 minutes.
    DMS_TimeBetweenStaticMissions        = [600,900];                // [Minimum,Maximum] time between static missions (if static mission limit is not reached) | DEFAULT: 15-30 mins
    DMS_StaticMissionTimeOut            = [1800,2700];                 // [Minimum,Maximum] time it will take for a static mission to timeout | DEFAULT: 30-60 mins
    DMS_StaticMissionTimeoutResetRange    = 500;                        // If a player is this close to a mission then it won't time-out. Set to 0 to disable this check.
    DMS_SMissionTimeoutResetFrequency    = 180;                        // How often (in seconds) to check for nearby players and reset the mission timeout for static missions.
    DMS_ResetStaticMissionTimeoutOnKill    = false;                    // Whether or not to reset the mission timeout when an AI is killed (for Static Missions).
    DMS_StaticMinPlayerDistance            = 500;                        // If a player is this close to a mission location, then it won't spawn the mission and will wait 60 seconds before attempting to spawn it.
    DMS_AllowStaticReinforcements        = false;                    // Whether or not static missions will receive reinforcements. This will simply disable the calling of GroupReinforcementsMonitor;
    DMS_SpawnFlareOnReinforcements        = false;                    // Whether or not to spawn a flare and noise when AI reinforcements have spawned.
    /*General settings for static missions*/

Ich wäre für jede Hilfe dankbar!

 

Share this post


Link to post
Share on other sites

Hallo Anhor,

solche Fehler sollten vermieden werden, wenn du die Variablen in dem Skript am Anfang deklarierst mit

private ["_pos","_group"]; usw.

Benutze bitte mal statt der Variablen _group einfach mal _group1. Das sollte den Fehler vermeiden. Schreibe hier bitte rein, wenn es funzt.

Share this post


Link to post
Share on other sites

@CaptainChaos

Das Problem ging wohl tiefer. Da ich "nur" Infantrie spawnen lassen wollte hab ich kurzerhand die Teile für ein Fahrzeug, Objekte und Crates aus den Script entfernt.

Das hat mir DMS übel genommen. Hier der Eintrag in der rpt beim spawnen:

Spoiler

21:41:07 "DMS_SpawnAIGroup :: Spawned 23 AI at [5714,4190,0]."

21:41:07 Error in expression < (DMS_SpawnMinefieldForEveryMission && {_mines isEqualTo []}) then

{

_mines = [_>

21:41:07   Error position: <_mines isEqualTo []}) then

{

_mines = [_>

21:41:07   Error Undefined variable in expression: _mines

21:41:07 File \x\addons\dms\scripts\fn_AddMissionToMonitor_Static.sqf [DMS_fnc_AddMissionToMonitor_Static], line 129

21:41:07 Error in expression <l DMS_fnc_SelectRandomVal,[0]]

];

 

if !(_missionObjs params

[

["_buildings","",[>

21:41:07   Error position: <_missionObjs params

[

["_buildings","",[>

21:41:07   Error Undefined variable in expression: _missionobjs

21:41:07 File \x\addons\dms\scripts\fn_AddMissionToMonitor_Static.sqf [DMS_fnc_AddMissionToMonitor_Static], line 115

21:41:07 "DMS_DEBUG :: BroadcastMissionStatus :: Notification types: |[""ExileToasts""]| for broadcasting mission status: A Viet Cong Platoon was spotted at HILL 114! Wipe them out! |::|::| (DMS_Version: ""September 7, 2017"" | time: 6863.95 | diag_tickTime: 6902.68 | 45.3258 FPS)"

21:41:07 Error in expression <fnc_SelectRandomVal

],

_missionAIUnits,

_missionObjs,

[_missionName,_msgWIN,_msg>

21:41:07   Error position: <_missionObjs,

[_missionName,_msgWIN,_msg>

21:41:07   Error Undefined variable in expression: _missionobjs

21:41:07 File x\addons\DMS\missions\static\003.sqf, line 201

Und hier der Eintrag im rpt beim despawnen:

Spoiler

22:09:19 "DMS_DEBUG :: BroadcastMissionStatus :: Notification types: |[""ExileToasts""]| for broadcasting mission status: The LRRP suffers heavy casualties and must retrieve! |::|::| (DMS_Version: ""September 7, 2017"" | time: 8556.74 | diag_tickTime: 8595.47 | 45.7143 FPS)"

22:09:19 Error in expression <_inputAIUnits call DMS_fnc_GetAllUnits)+_buildings+_vehs+_mines);

 

{

_cleanupLis>

22:09:19   Error position: <_buildings+_vehs+_mines);

 

{

_cleanupLis>

22:09:19   Error Undefined variable in expression: _buildings

22:09:19 File \x\addons\dms\scripts\fn_MissionsMonitor_Static.sqf [DMS_fnc_MissionsMonitor_Static], line 208

Ich hab jetzt die Mission umgeschrieben. Als Objekte lass ich einfach einen leeren Fahnenmast spawnen (was nicht stört) und einen minimal befüllten Crate. AI Fahrzeug kann man Gott sei Dank problemlos weg lassen.

Jetzt funktioniert die Mission wie geplant. Ich hab sie noch erweitert indem ich die AI auf mehreren Positionen spawne.

Ach so, ja ....... hier noch das Missionfile:

Spoiler

/*
    DAK LAK UNDER ATTACK
    by SSG Anhor
*/


_num = DMS_MissionCount;


_side = "bandit";


_pos = [6882,4976,0];

if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};


_difficulty = "difficult";


_AISoldierSpawnLocations =
[
    _pos,
    [6882,4999,0],
    [6931.5,4956.5,0],
    [6900,4900.5,0],
    [6974.5,4916,0]
];


_AICount = 20 + (round (random 5));


_group =
[
    _AISoldierSpawnLocations,
    _AICount,
    _difficulty,
    "random",
    _side
] call DMS_fnc_SpawnAIGroup_MultiPos;


_staticGuns =
[
    [
        [6868.8,4978.7,0.1],
        [6938.8,4950.2,0.1]
    ],
    _group,
    "gunner",
    _difficulty,
    "bandit",
    "random"
] call DMS_fnc_SpawnAIStaticMG;


_crateClasses_and_Positions =
[
    [[6882,4999,0],"I_CargoNet_01_ammo_F"],
    [[6931.5,4956.5,0],"I_CargoNet_01_ammo_F"],
    [[6900,4900.5,0],"I_CargoNet_01_ammo_F"],
    [[6974.5,4916,0],"I_CargoNet_01_ammo_F"]
];

{
    deleteVehicle (nearestObject _x);
} forEach _crateClasses_and_Positions;


_crateClasses_and_Positions = _crateClasses_and_Positions call ExileClient_util_array_shuffle;


_crate0 = [_crateClasses_and_Positions select 0 select 1, _crateClasses_and_Positions select 0 select 0] call DMS_fnc_SpawnCrate;
_crate1 = [_crateClasses_and_Positions select 1 select 1, _crateClasses_and_Positions select 1 select 0] call DMS_fnc_SpawnCrate;


/*
{
    _x setVariable ["DMS_AllowSmoke", false];
} forEach [_crate0,_crate1];


_veh =
[
    [
        [_pos,100,random 360] call DMS_fnc_SelectOffsetPos,
        _pos
    ],
    _group,
    "assault",
    _difficulty,
    _side
] call DMS_fnc_SpawnAIVehicle;
*/


_missionAIUnits =
[
    _group
];


_groupReinforcementsInfo =
[
    [
        _group,
        [
            [
                -1,
                0
            ],
            [
                10,
                0
            ]
        ],
        [
            240,
            diag_tickTime
        ],
        _AISoldierSpawnLocations,
        "random",
        _difficulty,
        _side,
        "reinforce",
        [
            10,
            5
        ]
    ]
];


_missionObjs =
[
    _staticGuns,
    [],
    [[_crate0,[5,10,2]],[_crate1,[3,15,15]]]
];


_msgStart = ['#FFFF00', "A VC Platoon has occupied Dak Lak Village! Conquer the FSB!"];


_msgWIN = ['#0080ff',"US troops were able to free Dak Lak Village."];


_msgLOSE = ['#FF0000',"Under heavy casualties Dak Lak Village had to be abandoned."];


_missionName = "DAK LAK UNDER ATTACK";


_markers =
[
    _pos,
    _missionName,
    _difficulty
] call DMS_fnc_CreateMarker;

_circle = _markers select 1;
_circle setMarkerDir 20;
_circle setMarkerSize [150,50];


_time = diag_tickTime;


_added =
[
    _pos,
    [
        [
            "kill",
            _group
        ],
        [
            "playerNear",
            [_pos,100]
        ]
    ],
    _groupReinforcementsInfo,
    [
        _time,
        DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
    ],
    _missionAIUnits,
    _missionObjs,
    [_missionName,_msgWIN,_msgLOSE],
    _markers,
    _side,
    _difficulty,
    []
] call DMS_fnc_AddMissionToMonitor_Static;


if !(_added) exitWith
{
    diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_fnc_AddMissionToMonitor_Static! Deleting mission objects and resetting DMS_MissionCount.",_missionName];

    _cleanup = [];
    {
        _cleanup pushBack _x;
    } forEach _missionAIUnits;

    _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));

    {
        _cleanup pushBack (_x select 0);
    } foreach (_missionObjs select 2);

    _cleanup call DMS_fnc_CleanUp;


    // Delete the markers directly
    {deleteMarker _x;} forEach _markers;


    // Reset the mission count
    DMS_MissionCount = DMS_MissionCount - 1;
};


[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

 

if (DMS_DEBUG) then
{
    (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
};

Problem also gelöst.

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.