Jump to content

Recommended Posts

Hi all,

I'm trying to detect some change on attributes of entities in 3den (position rotation or else, of a unit)

 

I tried

add3DENEventHandler ["AttributesChanged3DEN", {
 params ["_object"];
systemChat str _object
}];

in debug console. That doesn't work or I miss something.

 

For general purpose, anyone knows how to make add3denEventHandler work?  (console seems to fail whatever the 3denEH. It returns -1 and nothing occurs).

Thanks

 

Share this post


Link to post
Share on other sites

How did you define the object you attached the EH to?
Because naming the object and using the name in the console in Eden does not work. You need to for example select the unit and then use :
 

(get3DENSelected "object" select 0) add3DENEventHandler ["AttributesChanged3DEN", {
    params ["_object"];
    systemChat str _object
}]; 

The eh will fire after the rotation or whatever is done, not when it starts or during it.

EDIT:
And obviously eden ehs only work in eden

Share this post


Link to post
Share on other sites

I didn't name any object and didn't apply to any object. I tried to change attributes on several objects, waiting for some result, as I thought this EH was a "generic" EH like MissionEventHandler.

There is no object mentioned as param in documentation:

https://community.bistudio.com/wiki/add3DENEventHandler

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers:_Eden_Editor#AttributesChanged3DEN

 

Thanks

 

Share this post


Link to post
Share on other sites
2 hours ago, pierremgi said:

There is no object mentioned as param in documentation

attributesChanged3DEN is object EH not editor EH, and it says so right on the page you linked

Share this post


Link to post
Share on other sites
13 minutes ago, killzone_kid said:

Yes there is, attributesChanged3DEN is object EH not editor EH, and it says so right on the page you linked if you bothered to read it.

I did, indeed, and I disagree with your sarcasm. I persist the BIKI page example 1 (and unique) is not clear at all in regard of usual pages, for usual reader.

You should take some holidays. At least, do not answer anymore to my post. This one could be closed after H - answer.

Many thanks to @h - with constructive helpful answer.

Share this post


Link to post
Share on other sites
18 minutes ago, pierremgi said:

I disagree with your sarcasm

I wasn’t being sarcastic. This is quote from that page:

 

Object Event Handlers

Editor specific event handlers can be also added directly to objects, using addEventHandler command.

 

And the EH you were trying to add is listed right under. 

Share this post


Link to post
Share on other sites

@h -    Sorry, but I failed to make it work.

 @Lou Montana  Thanks for your change in BIKI. I'm sure that will help.

 

 

Now, I placed one player and 2 VR entities in 3den. Then, in debug console:

 

removeAll3DENEventHandlers "AttributesChanged3DEN";
systemChat "ready";
(get3DENSelected "object" select 0) add3DENEventHandler ["AttributesChanged3DEN", {
  params ["_object"];
  systemChat str _object;
}];

The console returns the entity and a msg error:

 7:50:56 Error in expression <y";
(get3DENSelected "object" select 0) add3DENEventHandler ["AttributesChanged3>
 7:50:56   Error position: <add3DENEventHandler ["AttributesChanged3>
 7:50:56   Error Missing ;

 

I tried also with :

((all3DENEntities select 0) select {_x isKindOf "B_Soldier_VR_F"} select 0). Of course, I verified this code returns a unit > I can find it in a watch line

 

So it's not a question of 3den unit selection/reference. That doesn't work.

Note: This page still doesn't help (as far as you can't see the word object or any other parameter). Beyond object, there is probably? some other limitation.

Thanks.

Share this post


Link to post
Share on other sites
Quote

So it's not a question of 3den unit selection/reference. That doesn't work.

Oops, omitted to correct you on another matter:
add3DENEventhandler does not work on those object eventhandlers, you add them with regular addEventHandler, so should be:

(get3DENSelected "object" select 0) addEventHandler ["AttributesChanged3DEN", {
  params ["_object"];
  systemChat str _object;
}];

3DENEventhandlers are handlers for Eden actions like selecting some widget, saving a mission, undoing, deleting and so forth.
The line removeAll3DENEventHandlers "AttributesChanged3DEN"; is also incorrect because no such 3den eh exists.

One thing worth noting when fiddling with the Eden commands is that some of them report no errors even if you make one, and some of them CTD the game if you pass erroneous data.. Can't remember the CTD causing commands but usually if a command takes an entity as an argument, which in eden can be both a number (eden id) and an object, and you pass a null-object = ACCESS VIOLATION BLAHBLAHBLAH

  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, pierremgi said:

 @Lou Montana  Thanks for your change in BIKI. I'm sure that will help.

 

The wrong info was an oversight on my behalf when filling examples some months ago; it is fixed now. Don't hesitate to mention Biki mistakes on the #community_wiki Arma 3 Discord channel!

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×