New features / debugging of editor plugin

This commit is contained in:
Chris Cardozo 2020-09-07 10:13:24 -04:00
parent 1203f03044
commit 6f9b41d5b5
19 changed files with 286 additions and 119 deletions

View File

@ -0,0 +1,14 @@
params["_object"];
private _marker = create3DENEntity ["object","Sign_Arrow_Large_Yellow_F",getPos _object];
private _markerPos = getPos _object;
private _bbr = boundingBoxReal _object;
_p1 = _bbr select 0;
_p2 = _bbr select 1;
_height = abs ((_p2 select 2) - (_p1 select 2));
_marker setPosATL [_markerPos select 0, _markerPos select 1, (_markerPos select 2) + _height];
_object setVariable ["marker",_marker];
diag_log format["_createGarrisonMarker: _object = %1 | _marker = %2 | _height = %3",_object,_marker,_height];
true

View File

@ -0,0 +1,15 @@
params["_object"];
private _marker = create3DENEntity ["object","Sign_Arrow_Large_Green_F",getPos _object];
private _markerPos = getPos _object;
private _bbr = boundingBoxReal _object;
_p1 = _bbr select 0;
_p2 = _bbr select 1;
_height = abs ((_p2 select 2) - (_p1 select 2));
_marker setPosATL [_markerPos select 0, _markerPos select 1, (_markerPos select 2) + _height];
_object setVariable ["marker",_marker];
true

View File

@ -0,0 +1,24 @@
params["_state"];
all3DENEntities params ["_objects"];
_objects = _objects select {_x getVariable["garrisoned",false]};
diag_log format["displayGarrisonMarkers: _state = %2 | _objects = %1",_objects,_state];
missionNameSpace setVariable["blck_displayGarrisonMarkerOn",_state];
{
if (_state) then // if the request was to show the markers then ....
{
private _marker = _x getVariable["marker",""];
diag_log format["_x = %1 | _marker = %2",_x,_marker];
if (_marker isEqualto "") then
{
[_x] call blck3DEN_fnc_createGarrisonMarker;
[_x] call blck3DEN_fnc_setEventHandlers;
};
} else {
blck_displayGarrisonMarkerOn = false;
if !(_x getVariable["marker",""] isEqualTo "") then
{
[_x] call blck3DEN_fnc_removeMarker;
};
};
} forEach _objects;

View File

@ -0,0 +1,22 @@
params["_state"];
all3DENEntities params ["_objects"];
_objects = _objects select {_x getVariable ["lootVehicle",false]};
diag_log format["displayLootMarkers: _state = %2 | _objects = %1",_objects,_state];
missionNamespace setVariable["blck_displayLootMarkerOn",_state];
{
if (_state) then // if the request was to show the markers then ....
{
if (_x getVariable["marker",""] isEqualto "") then
{
[_x] call blck3DEN_fnc_createLootMarker;
[_x] call blck3DEN_fnc_setEventHandlers;
};
} else {
if !(_x getVariable["marker",""] isEqualTo "") then
{
[_x] call blck3DEN_fnc_removeMarker;
};
};
} forEach _objects;

View File

@ -21,3 +21,4 @@ diag_log format["getGarrisonInfo: _object = %1",format["%1",_object]];
systemChat _message;
diag_log _message;
[_message,"Status"] call BIS_fnc_3DENShowMessage;

View File

@ -1,10 +1,13 @@
private _objects = get3DENSelected "object" select {(typeOf _x) isKindOf "Car"};
private _objects = get3DENSelected "object" select {(typeOf _x) isKindOf "Car" || (typeOf _x) isKindOf "Ship" || (typeOf _x) isKindOf "ThingX"};
private "_message";
if (_objects isEqualTo []) then
{
_message = "No Vehicles Selected";
_message = "No Cars/Ships/ThingX Selected";
} else {
if (count _objects == 1) then
{

View File

@ -13,5 +13,7 @@ missionNamespace setVariable["blck_endState",getText(configFile >> "CfgBlck3DEN"
missionNamespace setVariable["blck_startMessage","TODO: Add a start message"];
missionNamespace setVariable["blck_endMessage","TODO: Add an end message"];
missionNamespace setVariable["blck_missionLocations","random"];
missionNameSpace setVariable["blck_displayGarrisonMarkerOn",false];
missionNamespace setVariable["blck_displayLootMarkerOn",false];
diag_log format["Mission Attributes Initialized for blckeagls at time %1",diag_tickTime];

View File

@ -0,0 +1,7 @@
params["_object"];
if !(_object getVariable["marker",""] isEqualTo "") then
{
private _marker = _object getVariable["marker",""];
private _markerPos = getPosATL _object;
_marker setPosATL[_markerPos select 0, _markerPos select 1, (_markerPos select 2) + sizeOf _object];
};

View File

@ -0,0 +1,28 @@
/*
blckeagls 3EDEN Editor Plugin
by Ghostrider-GRG-
Copyright 2020
*/
params["_object"];
switch (true) do
{
case ((typeOf _object) isKindOf "ThingX" && blck_displayLootMarkerOn): {
if !(_object getVariable["lootVehicle",""] isEqualTo "") then
{
[_object] call blck3DEN_fnc_createLootMarker;
[_object] call blck3DEN_fnc_setEventHandlers;
};
};
case ((typeOf _object) isKindOf "House" && blck_displayGarrisonMarkerOn): {
if !(_object getVariable["garrisoned",""] isEqualTo "") then
{
[_object] call blck3DEN_fnc_createGarrisonMarker;
[_object] call blck3DEN_fnc_setEventHandlers;
};
};
};

View File

@ -0,0 +1,9 @@
params["_object"];
if !(_object getvariable["marker",""] isEqualTo "") then
{
[_object] call blck3DEN_fnc_removeMarker;
_object setVariable ["marker",nil];
//_object setVariable ["lootVehicle",nil];
//_object setVariable ["garrisoned",nil];
};

View File

@ -0,0 +1,18 @@
/*
blckeagls 3EDEN Editor Plugin
by Ghostrider-GRG-
Copyright 2020
*/
params["_object"];
private _marker = _object getVariable["marker",""];
if !(_marker isEqualTo "") then
{
private _id = get3DENEntityID _marker;
delete3DENEntities [_id];
_object setVariable["marker",nil];
};
true

View File

@ -0,0 +1,9 @@
params["_object"];
_object removeAllEventHandlers "UnregisteredFromWorld3DEN";
_object removeAllEventHandlers "RegisteredToWorld3DEN";
_object removeAllEventHandlers "Dragged3DEN";
_object addEventHandler ["Dragged3DEN",{_this call blck3DEN_fnc_onDrag;}];
_object addEventHandler ["UnregisteredFromWorld3DEN",{_this call blck3DEN_fnc_onUnregister;}];
_object addEventHandler ["RegisteredToWorld3DEN", {_this call blck3DEN_fnc_onRegistered;}];

View File

@ -7,6 +7,7 @@ if (_objects isEqualTo []) exitWith
{
_message = "Select one or more buildings to configure";
systemChat _message;
diag_log _message;
};
{
@ -16,6 +17,11 @@ if (_objects isEqualTo []) exitWith
_message = format["building of type %1 had garrison state set to %2",typeOf _x,_state];
systemChat _message;
diag_log _message;
if (blck_displayGarrisonMarkerOn) then
{
[_x] call blck3DEN_fnc_createGarrisonedMarker;
[_x] call blck3DEN_fnc_setEventHandlers;
};
} else {
_message = format["Object type %1 ignored: only enterable buildings can be garrisoned",typeOf _x];
systemChat _x;

View File

@ -1,16 +1,35 @@
/*
blckeagls 3EDEN Editor Plugin
by Ghostrider-GRG-
Copyright 2020
sets a flag stored through setVariable for each selected object that meets the filter criteria
only objects of type "Car"or "ThingX" are allowed.
*/
params["_state"];
private "_message";
private _objects = get3DENSelected "object" select {(typeOf _x) isKindOf "Car"};
private _objects = get3DENSelected "object" select {(typeOf _x) isKindOf "Car" || (typeOf _x) isKindOf "Ship"}; //
if (_objects isEqualTo []) exitWith
{
_message = "Select one or more vehicles to configure";
_message = "Select one or more vehicles or items of type ThingX to configure";
systemChat _message;
};
{
if ((typeOf _x) isKindOf "Car") then
if ((typeOf _x) isKindOf "Car" || (typeOf _x) isKindOf "Ship") then
{
_x setVariable["lootvehicle",_state];
_message = format["Vehicle type %1 set to Loot Vehilce = %1",typeOf _x,_state];
if (blck_displayLootMarkerOn && _state) then
{
[_x] call blck3DEN_fnc_createLootMarker;
[_x] call blck3DEN_fnc_setEventHandlers;
} else {
if !(_state) then
{
[_x] call blck3DEN_fnc_removeLootMarker;
};
};
_message = format["Vehicle type %1 set to Loot Vehicle = %1",typeOf _x,_state];
systemChat _message;
diag_log _message;
} else {
@ -19,5 +38,5 @@ if (_objects isEqualTo []) exitWith
systemChat _message;
};
} forEach _objects;
_message = format["Loot Vehicle State of %1 vehicles updated to %2",count _objects,_state];
_message = format["Loot Vehicle State of %1 objects updated to %2",count _objects,_state];
systemChat _m;

View File

@ -1,51 +1,16 @@
class CfgVehicles
private _objects = get3DENSelected "object" select {(typeOf _x) isKindOf "Car" || (typeOf _x) isKindOf "Ship"}; //
if (count _objects == 1) then
{
class Object
{
class AttributeCategories
{
class LandVehicle;
class blckLandVehicle: LandVehicle;
{
class Attributes
{
class blckLootVehicle
{
// https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Attributes#Scenario
displayName = "Loot Vehicle";
toolTip = "Enable/Disable Use as Loot Vehicle";
property = "blckLootVehicle";
control = "Edit";
expression = "_this setVariable['%s',_value];";
defaultValue = 'false';
unique = 0;
validate = "BOOL";
typeName = "BOOL";
};
};
};
class Static;
class blckHouse: Static
{
class Attributes
{
class blckGarison
{
// https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Attributes#Scenario
displayName = "Garison Building";
toolTip = "Enable/Disable ?Garisoned Building";
property = "blckGarison";
control = "Edit";
expression = "_this setVariable['%s',_value];";
defaultValue = 'false';
unique = 0;
validate = "BOOL";
typeName = "BOOL";
};
};
};
};
};
};
private _obj = _objects select 0;
private _marker = create3DENEntity ["object","Sign_Arrow_Blue_F",getPos _obj];
private _bbr = boundingBoxReal vehicle player;
_p1 = _bbr select 0;
_p2 = _bbr select 1;
_height = abs ((_p2 select 2) - (_p1 select 2));
_markerPos = getPos _marker;
_marker setPosATL [_markerPos select 0, _markerPos select 1, (_markerPos select 2) + _height];
} else {
systemChat "no vehicles selected";
};

View File

@ -163,8 +163,10 @@ private _garisonedUnits = [];
private _landscape = _objects select{
!(isSimpleObject _x) &&
((typeOf _x) isKindOf "Static") ||
( (typeOf _x) isKindOf "ThingX" && (!((typeOf _x) isKindOf "ReammoBox_F") && !(_x getVariable["isLootContainer",false])))
((typeOf _x) isKindOf "Static" || ( (typeOf _x) isKindOf "ThingX")) &&
!((typeOf _x) isKindOf "ReammoBox_F") &&
!(_x getVariable["isLootContainer",false]) &&
!((typeOf _x) isKindOf "Helper_Base_F")
};
private _garisonedPos = [];

View File

@ -52,8 +52,8 @@ class CfgBlck3DEN
class CfgVersion
{
version = 1.0;
build = 3;
date = "08/23/20";
build = 4;
date = "09/5/20";
};
};

View File

@ -44,27 +44,37 @@ class CfgFunctions
class Core
{
file = "3EDEN_plugin\Core";
class help {};
class about {};
class buildingContainer {};
class createLootMarker {};
class createGarrisonMarker {};
class display {};
class displayGarrisonMarkers {};
class displayLootMarkers {};
class getGarrisonInfo {};
class getLootVehicleInfo {};
class getMissionGarrisonInfo {};
class getMissionLootVehicleInfo {};
//class getMissionGarrisonInfo {};
//class getMissionLootVehicleInfo {};
class help {};
class initializeAttributes {};
class isInfantry {};
class isInside {};
class buildingContainer {};
class display {};
class loadCratesTiming {};
class onDrag {};
class onRegistered {};
class onUnregister {};
class removeMarker {};
class setDifficulty {};
class setCompletionMode {}
class setGarrison {};
class setLootVehicle {};
class setSpawnLocations {};
class spawnCratesTiming {};
class loadCratesTiming {};
class endMessage {};
class startMessage {};
class configureGarrisonATL {};
//class endMessage {};
//class startMessage {};
//class configureGarrisonATL {};
class versionInfo {};
};
};
@ -324,35 +334,6 @@ class display3DEN
action = "['atMissionCompletion'] call blck3DEN_fnc_loadCratesTiming";
};
/*
/////////////////////////////
class blckMissionMessages
{
text = "Set timing for loading crates";
items[] = {
"blckStartMessage",
"blckEndMessage"
};
};
// ["Title","Default","ctrlControlsGroupNoScrollbars","ctrlControlsGroup","ctrlDefault"]
class Edit;
class blckEdit: Edit
{
control = "Edit";
value = "";
};
class blckStartMessage: blckEdit
{
text = "Misstion Start Message";
action = "[_value] call blck3DEN_startMessage";
};
class blckEndMessage: blckEdit
{
text = "Mission End Message";
action = "[_value] call blck3DEN_endMessage";
};
*/
class blckMissionLocation
{
text = "Toggle Random or Fixed Location";
@ -374,16 +355,26 @@ class display3DEN
action = "['fixed'] call blck3DEN_fnc_setSpawnLocations";
};
///////////////////////////////////////////////////////
class blck_setGarrison
{
text = "Garrisoned Building Settings";
toolTip = "Set garrison status of selected buildings";
items[] = {
"blck_isGarrisoned",
"blck_clearGarrisoned",
"blck_getGarrisonInfo"
"blck_setGarrisonedState",
"blck_getGarrisonInfo",
"blck_garrisonMarkers"
};
};
class blck_setGarrisonedState
{
items[] = {
"blck_isGarrisoned",
"blck_clearGarrisoned"
};
text = "Garrison Settings";
};
class blck_isGarrisoned
{
text = "Garrison Building";
@ -402,47 +393,79 @@ class display3DEN
{
text = "Get Building Garrisoned Setting";
toolTip = "Get the selected buildings garrisoned flag";
value = 0;
action = "call blck3DEN_fnc_getGarrisonInfo";
};
class getMissionGarrisonInfo
class blck_garrisonMarkers
{
text = "Get garrison flag for the selected building";
toolTip = "The garrisoned flag state will be displayed for selected bulidings";
value = 0;
action = "call blck3DEN_fnc_getMissionGarrisonInfo";
items[] = {
"blck_GarrisonMarkersOn",
"blck_GarrisonMarkersOff"
};
text = "Toggle markers over garrisoned buildings";
};
class blck_GarrisonMarkersOn
{
text = "Display Markers over Garrisoned Buildings";
action = "[true] call blck3DEN_fnc_displayGarrisonMarkers";
};
class blck_GarrisonMarkersOff
{
text = "Hide Markers over Garrisoned Buildings";
action = "[false] call blck3DEN_fnc_displayGarrisonMarkers";
};
///////////////////////////////////////////////////////////////
class blck_markLootVehicle
{
text = "Loot Vehicle Settings";
value = false;
//action = "systemChat 'value toggled'";
conditionShow = "selectedObject";
items[] = {
"blck_designateLootVehicle",
"blck_clearLootVehicle",
"blck_getLootVehicleInfo"
"blck_designateLootVehicleState",
"blck_getLootVehicleInfo",
"blck_displayLootMarkers"
};
};
class blck_clearLootVehicle
class blck_designateLootVehicleState
{
items[] = {
"blck_setAsLootVehicle",
"blck_clearLootVehicleFlag"
};
text = "Loot Vehicle Settings";
};
class blck_clearLootVehicleFlag
{
text = "Clear Loot Vehicle Settings";
value = false;
action = "[false] call blck3DEN_fnc_setLootVehicle";
};
class blck_designateLootVehicle
class blck_setAsLootVehicle
{
text = "Desinate Loot Vehicle";
value = true;
action = "[true] call blck3DEN_fnc_setLootVehicle";
};
class blck_getLootVehicleInfo
{
text = "Get setting for selected vehicle";
value = 0;
action = "call blck3DEN_fnc_getLootVehicleInfo";
};
};
class blck_displayLootMarkers
{
items[] = {
"blck_lootMarkersOn",
"blck_lootMarkersOff"
};
text = "Toggle Loot Vehicle Markers";
};
class blck_lootMarkersOn
{
text = "Mark Loot Vehicles / Objects";
action = "[true] call blck3DEN_fnc_displayLootMarkers";
};
class blck_lootMarkersOff
{
text = "Hide Markers of Loot Vehicles / Objects";
action = "[false] call blck3DEN_fnc_displayLootMarkers";
};
/////////////////////////////
class blckSaveStaticMission
{