Page MenuHomeFeedback Tracker

Add support for custom Eden Editor connections
Assigned, NormalPublic


Currently it doesn't seem like Eden Editor supports connections between two objects which execute a custom expression. Currently all available connections are handled inside the engine.

class Group
	displayName = "Group to";
	data = "Group";
	color[] = {0,1,1,1};
	cursor = "3DENConnectGroup";

So what we need is something like this:

class Attach
	displayName = "Attach";
	expression = "_this # 0 attachTo _this  #1"; //_this <array> with two objects ([fromObject, toObject]). Expression should then 
                                                                              be executed on the server
	color[] = {0,1,1,1};
	cursor = "3DENConnectGroup";
        condition = "hoverObject"; //Same simple conditions used for all other context related entries

Event Timeline

R3vo created this task.Nov 19 2020, 10:32 AM
dedmen added a subscriber: dedmen.EditedDec 16 2020, 12:40 PM

How would you set attributes onto the connection?
Would aka attach offset and stuff?
or should it just keep the transform it had before and just stay relative to the object its attached to?

Do we just want to add a new data="AttachTo" type then?

RandomStart is a good example to work off of.
It does a setPos at mission start, can just build off of that and do a attachTo instead.

that wouldn't be support for custom connections, but rather AttachTo connection only.

custom script thing could... Ah now I see. define custom expressions in config.

There will need to be a second expression for when the connection is removed, as you will need to detach.
and it will need to correctly work with editor undo

dedmen claimed this task.Jan 29 2021, 12:28 PM
dedmen changed the task status from New to Assigned.
dedmen set Ref Ticket to AIII-53661.

As someone who is currently trying to script custom connections, this would be a great feature.

I don't know if this is the right place, but the custom connections should also be saved by the editor. Right now it will allow you to add the connection but they will be removed on reloading the mission in the editor.

You said you needed "expression" and "condition"
but both these things already exist.
expression specifies SQF script that runs at mission start.
condition0/condition1 (I don't understand why there are two) are simpleExpression with variables Object,ObjectBrain,ObjectVehicle,ObjectAgent,Group,Trigger,Waypoint,Logic,Marker which are all boolean 0 or 1.
so you don't have the hoverObject condition in your example, do you actually need that?

dedmen added a comment.EditedWed, Apr 20, 11:21 AM

Ah there is a bug, custom connections are restored when you load a mission in editor. but it was forgotten to do the restoring on mission start.
So at mission start the expression doesn't run, but except that one line of code, everything was already set up for custom connections.

dedmen added a comment.EditedWed, Apr 20, 11:36 AM
class Cfg3DEN {	
	class Connections {
		class CustomTest
			displayName="Custom Connection";
			expression = "systemChat str [_type, _entity0, _entity1]; diag_log [_type, _entity0, _entity1];"
			condition0 = "Object";

11:35:34 ["TestConnection",B Alpha 1-1:1 (dedmen),B Alpha 1-2:1]

is that all you need?

This will land on profiling branch tomorrow, but, only clients that run profiling branch will execute that. So you cannot rely on it till 2.10

Walthzer added a comment.EditedWed, Apr 20, 2:52 PM

If the fix with resolving them on mission start also fixes the copy/paste and composition related limitations, then yes that should be all.

Currently you can't:

  • Copy or paste custom connections
  • Have them in a composition

Maybe condition0 and condition1 is so you can force a connection between two entities that satisfy different conditions? e.g. Player/AI to an Object?
And expression is run on clients? Not just the server like all other expression from Eden?

And expression is run on clients? Not just the server like all other expression from Eden?

I expect it to be global, if you can please test on profiling branch coming out today (needs to run on server and client then)

Walthzer added a comment.EditedThu, Apr 21, 3:42 PM

expression runs on the server only (just like all other Eden expression) and after other Entity Attributes.
Arma seems to foricbly add quotes around the expression if it has no quotes:

expression = "diag_log 'expression'"; in PBO; stays expression = "diag_log 'expression'"; in Config Viewer and mission.sqm.
expression = diag_log 'expression'; in PBO; becomes expression = "diag_log 'expression'"; in Config Viewer and mission.sqm.

expression = QUOTE(diag_log 'expression)'; in PBO; also becomes expression = "QUOTE(diag_log 'expression)'"; in Config Viewer and mission.sqm.
Breaking any macros. This same behaviour is not seen with other Eden expressions.

Condition1/Condition2 seems to be correct instead of 0/1:
This does not allow a connection

condition0 = "1";
condition1 = "1";
condition2 = "0";

This does allow a connection:

condition0 = "0";
condition1 = "1";
condition2 = "1";

The conditions also can not use the Eden context menu or Eden Attribute Conditions.
marker from the internal docs you posted does work, but neither objectAI or objectEmpty did, so the connections use a different list of possible conditions?

Just as a note: Copy/pasting connections remains broken. I assume that also goes for compositions.