Page MenuHomeFeedback Tracker

Eden Collab - Wish List
Feedback, NormalPublic

Description

This a list of the things I've identified that are missing in order to enable a proper 3DEN multiplayer mod.

Need:

1.1 3DEN event handler that triggers when mission attributes are confirmed/saved or are set using script commands.

add3DENEventHandler ["OnMissionAttibutesChanged", {
	params ["_section"]; // attribute section (class name)
}];

1.2 3DEN event handler that triggers when an entity's attributes are confirmed/saved or are set using script commands.
Basically the already existing object AttributesChanged3DEN but then editor wide for all entities (object, group, trigger, system, waypoint, marker, layer, comment).

add3DENEventHandler ["OnEntityAttibutesChanged", {
	params ["_entity"]; // either Eden Entity or Eden ID
}];

1.3 3DEN event handler that triggers when an entity's layer changes.

add3DENEventHandler ["OnEntityLayerChanged", {
	params ["_entity", "_newLayerId", "_oldLayerId"];
}];

1.4 3DEN event handler that triggers when a context menu action is used/pressed (triggers before action happens):
This is the more future proof out of two solutions, the other being, that there are only 6 problematic context menu actions currently enabled which could be fixed by:
Adding a scripted event handler to BIS_fnc_3DENEntityMenu that includes _mode.
Move to formation, snap to surface, orient to terrain normal and orient to sea normal should all trigger an AttributesChanged event. (should be fixed either way :P)
Edit: seems I had a bit of a brain fart here, this is not required. These actions can edited in the config to be compatible.

1.5 Command to load or start a new 3DEN scenario, I imagine something like:
Syntax: load3DENScenario missionPath where missionPath is the relative path to the mission's folder from the current profile directory. Returns bool based on success.
When instead of a valid mission path a valid world name is specified it creates a new scenario:

Examples:
load3DENScenario "missions\test.VR" Loads the mission: "C:\Users\Username\Documents\Arma 3\missions\test.VR".
load3DENScenario "mpmissions\specialOps\test.VR" Loads the mission: "C:\Users\Username\Documents\Arma 3\mpmissions\specialOps\test.VR".
load3DENScenario "VR" Creates an new VR scenario.


Nice To Have: (ordered from most to least wanted)

These are more of a Hail Mary, any of these would be a nice bonus but don't in anyway impede the core functionality if not taken on board.

2.1 3DEN event handler that triggers when an entity is dragged, triggers for everything except layers.
Basically the already existing object Dragged3DEN but then editor wide for all entities except layers (object, group, trigger, system, waypoint, marker, comment).

add3DENEventHandler ["OnEntityDragged", {
	params ["_entity"];
}];

Why: this one I'm kinda iffy about since Dragged3DEN already works for objects and systems (can also add it to triggers tho it never triggers) and the rest would still properly update if 1.1 (OnEntityAttibutesChanged) is added. I think it'd be better to have around than to not have around.

2.2 3DEN event handler that triggers before mission preview is launched, and if it returns true prevents the mission preview from happening.

add3DENEventHandler ["PreMissionPreview", {
    params ["_isMp"]; // true if about to start MP preview
    true // Prevent mission preview from happening
}];

Instead passing an _isMp could add action state to MissionPreview, MissionPreviewBriefing and MissionPreviewMP.

Why: I'd use this to both prevent accidental mission previews and to have players automatically join the hosts server when they start an MP preview.

2.3 3DEN OnEntityCreated event; existing ticket: https://feedback.bistudio.com/T170168 (Maybe call it OnCreatedUnits to stay consistent with naming of OnDeleteUnits? )
2.4 Update 3DEN OnDeleteUnits event to include deleted entity and trigger just before the entity is deleted.

Why: right now I have to detect entity creation and deletion by using all3DENEntities and have their ID which is quite slow.

2.5 Show chat in Multiplayer 3DEN

Why: to allow systemChat debugging but also to later maybe add a chat system

2.6 Allow 1.5 (load3DENScenario) to be used from main menu

Why: I'd use it to smoothly transition players back to the 3DEN Collab session after an MP 3DEN preview ended.

2.7 Commands to get all entity/mission attributes in a given category, something like:
Syntax: entity get3DENAttributes category and section get3DENMissionAttributes category, return name value pairs: [[name1, value1], [name2, value2]] (or maybe hashMap?)
There are also class specific attributes, they should only be returned if category is "" and maybe allow to only get these by passing in "#specific#" as the category?

Examples:
player get3DENAttributes "" Gets all attributes (including class specific) from player unit
player get3DENAttributes "Init" Gets all attributes from Init category, e.g: [["Init", ""], ["Name", "CoolPlayer"]]
player get3DENAttributes "#specific#" Gets all attributes specific to the unit's class
"Multiplayer" get3DENMissionAttributes "" Gets all multiplayer mission attributes
"Multiplayer" get3DENMissionAttributes "Type" Gets all attributes from multiplayer Type category, e.g: [["GameType", "TDM"], ["MinPlayers", 1], ["MaxPlayers", 16]]

Why: would be nice QOL functionality

2.8 Command to tell entity type from Eden Entity or Eden ID, something like:
Syntax: get3DENEntityType entity where entity is either Eden Entity or Eden ID. Returns: "OBJECT", "GROUP", "TRIGGER", "LOGIC", "WAYPOINT", "MARKER", "LAYER", "COMMENT" or nil (Or maybe number? Prob faster but less descriptive).

Examples:
get3DENEntityType player returns "OBJECT"
get3DENEntityType group player returns "GROUP"
get3DENEntityType -1 returns nil

Why: would be nice QOL functionality

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Eden Editor

Event Timeline

SoulMasterOpus updated the task description. (Show Details)
Degman added a subscriber: Degman.Sep 30 2023, 11:06 PM

onEditorActive - triggered every time 3DEN editor is opened

Config call example

class Cfg3DEN
{
        class EventHandlers
    {
        class my3denEventHandlers
        {
            onEditorActive= "[] call my_fnc_thingIWantToExecute";
        };
    };
};

Params

add3DENEventHandler ["OnEditorActive", {
    params ["_display3DEN"]; // Display
}];

Triggers:

  • 3DEN editor is opened
  • Returned to 3DEN editor after play-testing mission

That event isn't required, you can achieve the same effect by combing the init and onMissionPreviewEnd events.
Note that while init does pass the display as param, onMissionPreviewEnd doesn't which is easily fixed by running findDisplay 313 (313 is 3DEN display).

Also you seem sorta lost/not to have read the ticket. This ticket is specifically a list of functionality that I'm requesting in the context of what I believe is missing in order to make a multiplayer 3DEN mod.

SoulMasterOpus added a comment.EditedOct 3 2023, 6:50 PM

Another nice to have would be:

2.9 A command similar too collect3DENHistory but instead of merging it would ignore all history entries and also wouldn't be reverted by an undo.
Example:

ignore3DENHistory {
	player set3DENAttributes ["position", [0,0,0]];
	player set3DENAttributes ["rotation", [0,0,0]];
};

Sets players position and rotation without adding an entry in history and can not be reverted.

dedmen claimed this task.Oct 23 2023, 6:56 PM
dedmen set Ref Ticket to AIII-56046.

OnBeforeMissionPreview

For multiplayer (Via Play->Preview in MP menu) there are two possibilities here.

  • If Eden is in SP mode, it first switches to MP mode and then starts Preview
  • If Eden is MP mode it starts preview immediately

Now, for the first case, we can trigger the eventhandler (and let you abort it) before we enter MP mode.
That is easier to implement. But that means if you block it, the player never starts up the server host and cannot switch to MP mode. But I think that's what you'd want anyway?

OnEntityAttributeChanged (notice the changed name from your proposal)
gets two arguments, entity and the classname of the attribute

12:13:47 [B Alpha 1-1:1,"Name"]
12:13:47 [B Alpha 1-1:1,"Init"]
12:13:47 [B Alpha 1-1:1,"Position"]
12:13:47 [B Alpha 1-1:1,"Description"]
12:13:50 [B Alpha 1-1:1,"unitName"]
12:13:50 [B Alpha 1-1:1,"speaker"]
12:13:50 [B Alpha 1-1:1,"pitch"]

Though, I didn't edit speaker/pitch values, it fires anyway 🤔

How do you want to handle "Undo" after attribute change?
Fire attribute change event again after the undo reverted the values?
I'm thinking fire the event again?

dedmen added a comment.EditedOct 24 2023, 1:14 PM

OnMissionAttibuteChanged gets two parameters.
The attribute type (Intel, Multiplayer, GarbageCollection, Scenario, Preferences) and the attribute classname

AtributeType internally, seems to be "Section" here https://community.bistudio.com/wiki/get3DENMissionAttribute

13:14:18 ["Scenario","IntelBriefingName"]
13:14:18 ["Scenario","Author"]
13:14:18 ["Scenario","OverviewText"]
13:14:18 ["Scenario","Briefing"]
13:14:18 ["Scenario","ShowWatch"]

Undo/Redo is same as entity attributes, the EH's just fire again after the value has been set

OnEntityDragged
For all Rotation/Move of entity. But again there is the question with undo history. It doesn't re-fire if a drag was undo/redo'd.
What do?

dedmen added a comment.EditedOct 24 2023, 1:55 PM

For the unit created.
Do you want duplicate fires then?
OnPasteUnitOrig
OnPaste

would fire for copy pasting units

I would say
OnEditableEntityAdded
OnEditableEntityRemoved
OnEntityParentChanged

The first two should catch all object creations of all types (and deletions). Including ones done so inside undo/redo.
The last one handles layer (unit is child of a layer)

Place Unit
Click "Create Layer" (Puts unit into layer)
Then undo twice

<Place Unit>
13:53:19 ["OnEditableEntityAdded",[B Alpha 1-1]]
<Click create layer>
13:53:20 ["OnEditableEntityAdded",[8]] // Layer just prints its ID as script value
13:53:20 ["OnEntityParentChanged",[B Alpha 1-1]] // Inserted into Layer
<Press Undo>
13:53:22 ["OnEntityParentChanged",[B Alpha 1-1]] // Removed from layer
13:53:22 ["OnEditableEntityRemoved",[8]] // Layer deleted
<Press Undo>
13:53:22 ["OnEditableEntityRemoved",[B Alpha 1-1]] // Unit deleted

That should do it, unless the undo behavior is a problem.
If undo is a problem we could add a "UndoStart" eventhandler. so you know that everything between start and undo event, is done by undo/redo processing?

The removed one should also solve your "Update 3DEN OnDeleteUnits event to include deleted entity"

dedmen added a comment.EditedOct 24 2023, 2:06 PM

Done by this point

OnMissionAttibuteChanged
OnEntityAttibuteChanged
OnEntityParentChanged (replaces OnEntityLayerChanged)
OnEntityDragged
OnBeforeMissionPreview
OnEditableEntityAdded (Replaces OnEntityCreated https://feedback.bistudio.com/T170168 )
OnEditableEntityRemoved (Replaces Update 3DEN OnDeleteUnits event to include deleted entity and trigger just before the entity is deleted. OnEditableObjectRemoved)

OnEditorActive is missing, I'll not do that for now. That should be all EH's done?

dedmen added a comment.EditedOct 24 2023, 4:51 PM

2.6 Allow 1.5 (load3DENScenario) to be used from main menu

Too complex for now. Opening eden is meh.

2.5 Show chat in Multiplayer 3DEN

Chat is controlled by script, showChat command. Eden script changes are too complex and hardcoding it in sounds meh.
I should probably hardcode it. Postponed to later maybe.

player get3DENAttributes "#specific#" Gets all attributes specific to the unit's class

Can you give me examples of a unit class with specific attributes?

get3DENMissionAttributes

Current state will be in tomorrows Profiling branch (and dev branch) updates. I just briefly tested stuff, there might be bugs in there.

SoulMasterOpus added a comment.EditedOct 24 2023, 7:10 PM
OnBeforeMissionPreview

Now, for the first case, we can trigger the eventhandler (and let you abort it) before we enter MP mode.
That is easier to implement. But that means if you block it, the player never starts up the server host and cannot switch to MP mode. But I think that's what you'd want anyway?

Yeah I don't particularly mind/care that it blocks switching to MP mode if not yet in it.
From a user perspective it would prob be nicer to not have to enter your hosting info again, but again I dont particularly care either way ¯\_(ツ)_/¯

OnEntityAttributeChanged

How do you want to handle "Undo" after attribute change?
Fire attribute change event again after the undo reverted the values?
I'm thinking fire the event again?

I agree that makes most sense to me.

Though, I didn't edit speaker/pitch values, it fires anyway 🤔

Indeed something I also observed, it seems to only happen when you save changes for the first time.
I had pitch 0.955396 turn to 0.96 and speaker male05eng to Male05ENG.

OnEntityDragged

For all Rotation/Move of entity. But again there is the question with undo history. It doesn't re-fire if a drag was undo/redo'd.
What do?

That's fine, and makes the most sense to me. This event should only trigger when the user is actively dragging an entity.
For making sure undo/redo can be synced as long as the position change of that entity triggers an OnEntityAttributeChanged its fine.
(That would be the exact same behavior that Dragged3DEN has)

For the unit created

For the unit created.
Do you want duplicate fires then?
OnPasteUnitOrig
OnPaste

would fire for copy pasting units

I'm fine with both OnEditableEntityAdded and an OnPaste EH firing, Ideally I dont see myself using any OnPaste EH.

I would say
OnEditableEntityAdded
OnEditableEntityRemoved
OnEntityParentChanged

The first two should catch all object creations of all types (and deletions). Including ones done so inside undo/redo.
The last one handles layer (unit is child of a layer)

Looks good.
Looking at your example, I'd be nice if OnEntityParentChanged got a second param for the new parent of the entity.
Oh and just to confirm would this also trigger when creating an layer while already having an layer selected? (Puts it as a child of the selected layer)
Same goes for pasted entity, they end up in the layer the copied entity is in, would it trigger for those too?

That should do it, unless the undo behavior is a problem.
If undo is a problem we could add a "UndoStart" eventhandler. so you know that everything between start and undo event, is done by undo/redo processing?

Undo/redo is already basically gonna be broken since there could/will be allot of sync actions in between the users actions.
So I'll prob end up trying to disable the behavior or seeing if I can somehow skip over the sync actions; to this end:

2.9 A command similar too collect3DENHistory but instead of merging it would ignore all history entries and also wouldn't be reverted by an undo.

Would be extremely useful with this I could preserve nice undo/redo behavior.
Aside from that I'm not planning on keeping track of if a change was an undo/redo action in general. I cant really think of why I'd want to, if something changes I just wanna make sure its the same for all clients, it don't matter if it was deleting an entity or undoing its creation.

SoulMasterOpus added a comment.EditedOct 24 2023, 7:34 PM

Chat is controlled by script, showChat command. Eden script changes are too complex and hardcoding it in sounds meh.
I should probably hardcode it. Postponed to later maybe.

Today I learned

Can you give me examples of a unit class with specific attributes?

This is mostly for modules, although there are some units also using it but the setup is the same.
For modules specifically they are more complicated as they also support specific attributes being setup in their Arguments class
ModuleHideTerrainObjects_F - only has Attributes class.
ModuleEffectsSmoke_F - only has Arguments class.
ModuleCuratorSetCosts_F - has both Attributes and Arguments classes.

For entities that only have Attributes its just straight up the attribute name.

For modules that only have an Arguments class in order to get the attribute value you have to prefix the argument name with the class name of the entity:
For example for ModuleEffectsSmoke_F to get the ColorBlue argument value you have to run: get3DENAttribute "ModuleEffectsSmoke_F_ColorBlue" // [0.5]

From my testing it seems that if a module has the Attributes class at all Arguments is completely ignored.
Even if you prefix the argument name with the entitys class name you still cant retrieve values from argument directly.

In all the modules that I could find that have both Attributes and Arguments classes it seems that Attributes also has ctrl classes that are inherited from somewhere, I'm not sure why but they dont seem to interfering.

Edit: as an example of an other entity with specific attributes: the loiter waypoint has specific attributes configFile >> "cfgWaypoints" >> "Default" >> "Loiter". AFAIK modules are the only ones that also have to take in to account an other class then Attributes, for all other entities if they have specific attributes they are always defined in their Attributes subclass.

SoulMasterOpus added a comment.EditedOct 25 2023, 7:34 PM

After doing some testing on the current profiling branch (2.14.151108) here are some things I found

Little fun fact sprinkled in, I had previously asked you what the -999 comment entity that is always present was. I've found out its the camera icon on the map, the more you know :)


OnMissionAttibuteChanged

Triggers on script command even if the section and/or attribute doesn't exists for example this triggers the EH:
"Multiplayer" set3DENMissionAttribute ["BogusAttribute", ""]

It also triggers when the attribute wasn't actually changed, for example:

"Multiplayer" set3DENMissionAttribute ["GameType", "TDM"]; // As expected it trigger ["OnMissionAttibuteChanged",["Multiplayer", "GameType"]]
"Multiplayer" set3DENMissionAttribute ["GameType", "TDM"]; // Unexpectedly triggers again ["OnMissionAttibuteChanged",["Multiplayer", "GameType"]]

(Note that OnEntityAttibuteChanged does not have this, i.e: it only triggers once when setting an attribute to the same value twice in a row)

Additionally it seems that the introduction of this EH added a crash as: "" set3DENMissionAttribute ["", ""] causes a CTD (both on DEV and PROF). Confirmed not to crash on stable.
For some reason it only crashes if there is no OnMissionAttibuteChanged EH present, if one OnMissionAttibuteChanged eh is present it no longer crashes.

OnEntityAttibuteChanged

Seems to work great, the only thing I'd like to see changed is that after finishing a move, rotate and/or resize (for triggers, modules and markers) it also triggers the EH.
Again would be the same behavior as the current AttributesChanged3DEN, which I think it quite nice.

As an example the behavior I'm looking for is:

  1. Place an trigger.
  2. Start moving/dragging the trigger, during this the event doesn't trigger but instead OnEntityDragged is triggered.
  3. Let go of left click or right click to complete/cancel the move/drag, this EH triggers for any "Position", "Rotation" and "Size2"/"Size3" changes that happened.

And ideally it would not trigger for "Position" on creation of an entity (only currently does this for comments but with the suggested changes above it will prob do it for all entities)

Note: just figured out that the existing AttributesChanged3DEN doesn't trigger after dragging is canceled by right clicking, this would be an issue for me. It'd be nice if OnEntityAttibuteChanged also triggers even if the drag was canceled.
Edit: this actually poses a problem since this EH shouldn't trigger for values that weren't changed and if you cancel the drag the value didn't change cus its reset. So this EH prob shouldn't trigger on drag cancel but I do need to know about this somehow, thoughts?

OnEntityParentChanged

Triggers twice when moving an entity between two custom layers.

Looking at your example, I'd be nice if OnEntityParentChanged got a second param for the new parent of the entity.

Currently there is no command to get an entitys layer, so instead of adding a param adding a command like:
get3DENLayer <entity> (return -1 on default layer?) would also be fine and prob just an nice addition to SQF

Oh and just to confirm would this also trigger when creating an layer while already having an layer selected? (Puts it as a child of the selected layer)
Same goes for pasted entity, they end up in the layer the copied entity is in, would it trigger for those too?

This seems to behave correctly

OnEntityDragged

Seems to be working fine, just the same note as on OnEntityAttibuteChanged about OnEntityAttibuteChanged not triggering when the drag is completed/canceled.

OnBeforeMissionPreview

Only thing to note here is that EH added later have priority over the ones before them.
For example: If the first 5 EHs return true but that 6th returns false, the preview is launched anyway

OnEditableEntityAdded

Doesnt trigger for waypoints and units. For units it only triggers for the creating the group of the unit. This is particularly an issue when creating an unit while having the automatic group setting enabled, these units don't trigger any event as they spawn as part of the group.
I'd say just fire for both the group and units, so when spawning an fireteam that'd be 5 triggers.

Edit: after some more testing I found an other issue: when loading a saved scenario, or switching phase, layers and comments are always passed in with the id -1.

OnEditableEntityRemoved

Same as OnEditableEntityAdded; doesnt trigger for waypoints and units.

Edit: after some more testing I found an other issue: when loading a saved scenario, creating a new one, or changing phase it doesn't trigger at all for the entities that get cleaned up from the previous scenario/phase.

get3DENMissionAttributes

From my testing, no notes, seems to be working fine

This comment was removed by LouMontana.

For making sure undo/redo can be synced as long as the position change of that entity triggers an OnEntityAttributeChanged its fine.

Ah I didn't think of that, ofc if attribute changed handles undo, you can handle everything. I have not tested if that works, please confirm if thats working.

Looking at your example, I'd be nice if OnEntityParentChanged got a second param for the new parent of the entity.

I thought there was a command that returns the parent, but seems not.
Done, second arg with parent. [object, newParent]

Oh and just to confirm would this also trigger when creating an layer while already having an layer selected? (Puts it as a child of the selected layer)
Same goes for pasted entity, they end up in the layer the copied entity is in, would it trigger for those too?

Layer inside layer yes. Triggers for the newly created layer.
Pasted Entity no. If the whole layer is created (with the paste) then the new layer triggers a parent changed event.
But only triggered once for the whole layer that was pasted.

entity get3DENAttributes is now implemented (dev-branch this week)

Ignore3DENHistory is implemented, but I didn't test it as I don't know how to verify it working.

Triggers on script command even if the section and/or attribute doesn't exists for example this triggers the EH:

Fixed.

It also triggers when the attribute wasn't actually changed, for example:

I won't fix that, I could run a isEqualTo in engine but I don't like that

Additionally it seems that the introduction of this EH added a crash

I can actually also reproduce it on stable, and I didn't touch that code. Thanks for finding that :D Fixed

after finishing a move, rotate and/or resize (for triggers, modules and markers) it also triggers the EH.

Oh wow that's.. not fun. AttributesChanged3DEN is easy because it doesn't say which attribute changed.
At the places where it triggers, we don't actually know if any attribute actually changed.

I can cheat it, and trigger the Position attribute update every time the object is moved, but that would combine rotation and position into just one thing, and also it spams alot while moving.
I can run it when the MoveEntity/RotateEntity operations are processed, which should work as you want. But I'm not sure if the position is applied before the EH triggers or after.
I did the second now, you'll see if its alright

Edit: this actually poses a problem since this EH shouldn't trigger for values that weren't changed

As I wrote above, I won't check for that. So the EH will trigger even if no change. And if that is the expected behavior then this problem isn't a problem anymore.

Mh actually looking at the code that's not easy to add, to make it trigger also on abort. It would trigger when the operation is deleted (but that would also be the case if the undo history is cleared, which will make it messy and trigger for example on preview start)
So its probably better to leave it out if you can live with that.

Triggers twice when moving an entity between two custom layers.

Yes, it is unparented, and then re-parented to something else. That will stay like that unless its a big problem.

get3DENLayer <entity>

Done, also returns -1 on failure (eg passing objNull or non-existent thing)
It just iterates through parents, and if it is a layer returns the ID.

get3DENParent <entity>

Returns the direct parent as script value. You could also use this. get parent, if layer then you got it, otherwise get its parent and walk up the tree.
Like https://community.bistudio.com/wiki/get3DENEntity returns -1 on failure (no parent or bad entity)

(get3DENSelected "object" select 0) -> B Alpha 1-1:1
get3denparent (get3DENSelected "object" select 0) -> B Alpha 1-1
get3denparent get3denparent (get3DENSelected "object" select 0) -> 1
get3denparent get3denparent get3denparent (get3DENSelected "object" select 0) -> 0
get3denparent get3denparent get3denparent get3denparent (get3DENSelected "object" select 0) -> -1

Layer1 -> Layer2 -> Group -> Unit

Only thing to note here is that EH added later have priority over the ones before them.

Yes, that's the same for all EH's that return a value.

Doesnt trigger for waypoints and units.

Ah crap. Yeah only the "Group" is added, not its children.

Should be fixed for add/remove for units/waypoints.
I hope that won't cause double Remove trigger.

Edit: after some more testing I found an other issue: when loading a saved scenario, or switching phase, layers and comments are always passed in with the id -1.

Is that a big issue? I assume after loading a save, you will manually iterate all entites anyway?

Edit: after some more testing I found an other issue: when loading a saved scenario, creating a new one, or changing phase it doesn't trigger at all for the entities that get cleaned up from the previous scenario/phase.

Is that a big issue? considering on load you're probably clearing all your data anyway?

SoulMasterOpus added a comment.EditedOct 30 2023, 3:41 PM

Ah I didn't think of that, ofc if attribute changed handles undo, you can handle everything. I have not tested if that works, please confirm if thats working.

Currently doesn't work but thats not surprising, I will check once the next dev version is released.

I won't fix that, I could run a isEqualTo in engine but I don't like that

Alright, I can work with it.

Mh actually looking at the code that's not easy to add, to make it trigger also on abort.
So its probably better to leave it out if you can live with that.

This will be an issue, but I can probably get around it using CBA's execNextFrame to check if the user is still dragging.
An other solution that would work fine for me is an EH for when dragging is done, this way I wouldn't need to add 1 to 2 frames of delay.

Yes, it is unparented, and then re-parented to something else. That will stay like that unless its a big problem.

Makes sense, its not an issue for me.

Yes, that's the same for all EH's that return a value.

Alright, just wanted to confirm its expected

Ignore3DENHistory is implemented, but I didn't test it as I don't know how to verify it working.

Something like this should suffice as an simple check, I can do the more in depth testing.

Ignore3DENHistory {
	create3DENEntity ["Object", "B_Soldier_F", screenToWorld [0.5,0.5]];
};

And then confirm that there isn't an new history entry and that undo doesn't remove the entity.

Is that a big issue? I assume after loading a save, you will manually iterate all entites anyway?

Your right, I initially was thinking of using these on load but I wont, so this wont be issue for me. Could be considered a bit weird but for me it will work fine.

Oh and lastly I just noticed that there's a typo currently in game its OnEntityAttibuteChanged while it should be OnEntityAttributeChanged (attibute vs attribute). Same goes for OnMissionAttibuteChanged.
These originate from my initial post, whoops, sorry.

Thanks for the changes. I will do some more testing once the next dev version is released.

An other solution that would work fine for me is an EH for when dragging is done, this way I wouldn't need to add 1 to 2 frames of delay.

There can only be one edit operation in progress.
The right-click starts a new one, which overwrites the old one which kills it.
The engine doesn't really have a "End" or "Cancel". And I think adding it isn't feasible right now.

Oh and lastly I just noticed that there's a typo currently in game its OnEntityAttibuteChanged while it should be OnEntityAttributeChanged (attibute vs attribute). Same goes for OnMissionAttibuteChanged.

Nice, thank you

Something like this should suffice as an simple check, I can do the more in depth testing.

Yep works! Thanks

dedmen added a comment.Nov 1 2023, 2:50 PM

get3DENLayer/get3DENParent

Thinking, is that naming bad? should it be get3DENEntityLayer/get3DENEntityParent ?
Though I wouldn't know of why we would have any non-Entity ones

SoulMasterOpus added a comment.EditedNov 1 2023, 9:56 PM

In general naming of script commands for 3DEN is already inconsistent, like these are all entity specific:

  • add3DENConnection/remove3DENConnection/get3DENConnections
  • clear3DENInventory/save3DENInventory

IMO get3DENLayer/get3DENParent are fine and they follow the already established naming of set3DENLayer, but at the same time I do agree specifying entity in the name of commands is a good thing

SoulMasterOpus added a comment.EditedNov 6 2023, 5:01 AM

OnMissionAttibuteChanged

No longer triggers on non-existent sections but still triggers for non-existent attributes. i.e:
"BogusSection" set3DENMissionAttribute ["BogusAttribute", ""] no EH trigger.
"Multiplayer" set3DENMissionAttribute ["BogusAttribute", ""] EH triggers.

OnEntityAttributeChanged

Triggers after dragging using mouse directly, but doesn't when using widgets.
When moving/rotation a group it also triggers for the group itself which it shouldn't (not valid attributes for group).
When moving multiple entities at once it triggers for the amount of dragged entities per entity. As in:

  • Create and drag 1 marker. This result in one EH trigger
  • Create and drag 2 markers. This result in 4 EH triggers, 2 per marker
  • Create and drag 3 markers. This result in 9 EH triggers, 3 per marker

Note: only happens for position and not rotation

Ah I didn't think of that, ofc if attribute changed handles undo, you can handle everything. I have not tested if that works, please confirm if thats working.

Can confirm it works for normal dragging but it has the issue I mentioned above that it doesn't trigger when the widgets where used.

OnEntityParentChanged

Doesn't trigger when grouping units together, which does cause a parent change but no EH. For me it doesn't matter, I can handle group changes but the name is misleading.

Nitpick: newParent param is objNull when moving to root, instead I think -1 makes more sense as if you want to move an entity to root by script command you'd run <entity> set3DENLayer -1.

OnEditableEntityAdded

Triggers twice when creating an empty object. (except when part of a composition for some reason)
Doesn't trigger when changing a waypoints, markers or units type. (works for the other entity types)
Doesn't trigger for when a unit or waypoint is created by undo/redo and waypoints created by shift + right-click.
Crewed vehicles are kinda weird, it triggers for both the empty vehicle and for the vehicle as a unit (eg [group:commander]) when manually creating but not when undo/redo then it only triggers for the vehicle as a unit.

OnEditableEntityRemoved

Doesn't trigger when changing a waypoints or markers type. (works for the other entity types)

get3DENAttributes

Specific attributes are always present even when getting a specific category.
Its case sensitive while I don't think it has to be, at least normal attribute names aren't case sensitive. (Didn't get around to making a custom category for more testing, will get back to this)

get3DENMissionAttributes

Section isn't case sensitive but category is and I don't think it has to be.

ignore3DENHistory

Thank you for adding this, this will improve the user experience allot. There are some weird cases that the introduction of this command adds tho but I should be able to handle them unless you want to fix them at the engine level.
I'm talking about that most of the 3DEN events seem based on history entries, so if you create a unit then change a bunch attributes and then run:

ignore3DENHistory {
	get3DENMouseOver params ["_type", "_entity"];
	delete3DENEntities [_entity]
}

Then undo the events for chancing the units attributes and also undo its creation these events all trigger event thought the entity no longer exists.
Actually there is one issue here that I cant handle that is:

  1. Create a unit
  2. Change the unit's type in its attributes: "Object: Type"
  3. Delete the unit inside of ignore3DENHistory
  4. Undo

Now there will be a unit again (of the type it was before changing) but its not editable in the editor.
I'm not sure how this should be handled, this command seems to be more trouble than I initially thought.

Note: doesn't matter for my use case but a ignore3DENHistory nested inside of a collect3DENHistory gets ignored, as in there will be history entries.

load3DENScenario

Tries to load non-existent missions, should return false instead.
i.e: load3DENScenario "missions\ImNotReal.VR" returns true and loads an empty VR map.

Dev-branch next week (in december)

OnMissionAttibuteChanged

Fixed

OnEntityAttributeChanged

Widget, some copy-pastes I missed. Fixed. (Did you check the Scale widget? It sets Scale as attribute so I'd expect it to be fine)
Duplicate triggers, Code was one line too high up :D Fixed.

When moving/rotation a group it also triggers for the group itself which it shouldn't (not valid attributes for group).

Checking if the attribute is valid there, would add alot more work. I would like to keep it this way if its acceptable?

OnEntityParentChanged

The group code bypasses the method that everything else uses to set parent, and instead does it manually :D Good old tech debt. Fixed.

OnEditableEntityAdded

Uhhhh... noooo. This is going to haunt me forever. The trigger twice is due to a workaround that I specifically added for a case where it didn't trigger.. I now don't remember what that was. I could remove the workaround, but chances are we'll loose something else again.

Probably done because this

Doesnt trigger for waypoints and units. For units it only triggers for the creating the group of the unit. This is particularly an issue when creating an unit while having the automatic group setting enabled, these units don't trigger any event as they spawn as part of the group.

Ah yes indeed. A unit triggers the handler twice, in the same places.
BUT the first handler is the group itself, and second is the unit.
Because normally, objects INSIDE a group are not registered separately (It only registers the group at first). But in this case it is not inside a group.
I disabled the second handler if the object was not put into a group. I hope that's gonna be fine.

Doesn't trigger when changing a waypoints, markers or units type. (works for the other entity types)

That's a Eden feature I've never used :D
I would've expected that to be a unit attribute change, but its not even that.
Fixed. Also needed to handle the undo/redo of that
I don't know if this is very robust.. seems to not explode atleast.

and waypoints created by shift + right-click.

Huh that is weird, the undo/redo of that works though, but not the initial place. Fixed.

Undo/Redo for waypoint creation works for me now. But thats probably because some of the other fixes.

OnEditableEntityRemoved

Fixed?

Section isn't case sensitive but category is and I don't think it has to be.

Section is enum internally which is why that works. Category is a classname, so it should not be case sensitive indeed. Fixed?

get3DENAttributes

Same thing with case sensitive category classname. Fixed.

Specific attributes are always present even when getting a specific category.

The category filter was missing for the specific-attributes. Fixed? Please confirm.

Actually there is one issue here that I cant handle that is

I ran into that too while trying to fix the EditableEntity* handlers for that type change. I ended up with yellow uneditable ghost units. That type change itself is a bit weird. I also don't know how to handle that :/

Note: doesn't matter for my use case but a ignore3DENHistory nested inside of a collect3DENHistory gets ignored, as in there will be history entries.

The history things are a "guard" around operations, and there can only be one active. multiple collect3DENHistory's would also behave like that where the inner one is ignored because there is already a guard active.

load3DENScenario

Not fixed.. The mission load is actually a async task. We send it away and it only executes after the command is done.
And without big code changes, I actually have to start the terrain load/world transition, before being able to check if the mission even exists.
Could potentially be fixed later with more time, but I won't invest that now

load3DENScenario

It now checks the path before attempting to load the scenario. Loading the scenario might still fail though (e.g. due to corrupted mission.sqm, missing addons, etc.).

dedmen changed the task status from New to Feedback.Feb 5 2024, 6:10 PM

All that was viable has been done for 2.18.
If there is new stuff then probably a new ticket for that (link it to this one tho)

SoulMasterOpus added a comment.EditedFeb 11 2024, 3:27 AM

If there is new stuff then probably a new ticket for that (link it to this one tho)

Just double checking, with "stuff" you also mean bugs, feedback and or answering questions you posted in your latest update?

Sorry I have had very little time to dedicate to this for a while. I'll be going over the changes you made this week.
Lastly I can not understate; I really appreciate all the work you guys put in.