Page MenuHomeFeedback Tracker

Add support for custom Eden Editor connections
Assigned, NormalPublic

Description

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.EditedApr 20 2022, 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.EditedApr 20 2022, 11:36 AM
class Cfg3DEN {	
	class Connections {
		class CustomTest
		{
			displayName="Custom Connection";
			data="TestConnection";
			color[]={0,0,1,1};
			cursor="3DENConnectSync";
			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.EditedApr 20 2022, 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.EditedApr 21 2022, 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.
but
expression = diag_log 'expression'; in PBO; becomes expression = "diag_log 'expression'"; in Config Viewer and mission.sqm.

and
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.

Today I created my first custom connections. So far so good. Unfortunately, the command remove3DENConnection crashes if I try to remove a custom connection. I can reproduce that. @dedmen could you have a look at this?

Steps to reproduce:

  1. create custom connection
  2. connect two objects
  3. select one object
  4. run this code in debug console in eden editor
_objects = get3DENSelected "object";

_connections = get3DENConnections (_objects select 0);

_connection1 = _connections select 0;

_connectionType = _connection1 select 0;
_connectionTo = _connection1 select 1;

_edenEntitiesArray = [_objects,[],[],[],[],[],[],[]];

remove3DENConnection [_connectionType, _edenEntitiesArray, _connectionTo];

With custom connection I get an instant crash. With a default "sync to" connection nothing happens.

remove3DENConnection works now for me. The Wiki page was misleading. Sorry. I used a wrong entites array.

Perhaps someone could update the wiki page: https://community.bistudio.com/wiki/Eden_Editor:_Custom_Connections
The data="TestConnection"; parameter is missing and the shown expression expression = "hint str [_this,_target];"; doesn't work. Instead dedmens expression = "diag_log [_type, _entity0, _entity1];" works. So the private variables are wrong in the wiki example.