Jump to content
The Dark Mod Forums

EntityClassAttributes


Recommended Posts

I've looked into this issue report http://bugs.angua.at/view.php?id=443 which deals with some editor_* properties not showing up.

 

The problem in this particular case (atdm:mover_door) is that the editor_bool trigger_on_open is encountered after the actual trigger_on_open.

 

...
"frob_action_script"		"frob_door"
"trigger_on_open"			"1"
"trigger_on_close"			"0"

"editor_bool trigger_on_open"		"If set to 1, blah."
"editor_bool trigger_on_close"		"If set to 1, blah."
...

 

DarkRadiant eclass manager parses this definition and inserts the first trigger_on_open, the second editor_bool trigger_on_open is ignored as it is already existing in the map.

 

I'd say we need to change the way the editor_* stuff is handled so that they are explicitly tagged as editor_* spawnargs. OrbWeaver, I think it was you who wrote that part - is there anything that needs to be considered, any problems you wanted to tackle with this approach? I don't want to rush in changing the current design without making sure that it's safe. :)

Link to comment
Share on other sites

After thinking about this a bit more and reading through the code, I believe the current EntityAttribute system doesn't need to be changed, rather the way it's used by the EntityInspector's AddProperty dialog.

 

The confusion as described in the issue report seems to arise from the fact that "trigger_on_open" actually is defined on the entity in the inherited properties, hence DarkRadiant thinks it doesn't need to be listed in the "Add Property" dialog.

 

I assume that users do want to add such a property to the entity, even though it is already inherited in the entityDef?

 

Independently of this, the parser needs to be adapted a bit to read in the attribute type from the "editor_*" spawnargs, even if a "proper" spawnarg is already set.

Link to comment
Share on other sites

It's a long time since I wrote that code so my memory is very hazy, but your assessment sounds pretty accurate to me. What I'm not sure about is whether there is currently a distinction between "inherited" actual properties from the entity def, and "inherited" properties from "editor_var blah" properties on the entity def.

Link to comment
Share on other sites

What I'm not sure about is whether there is currently a distinction between "inherited" actual properties from the entity def, and "inherited" properties from "editor_var blah" properties on the entity def.

We do have information about whether an EntityClassAttribute is inherited or not. However, we can't make use of this in this particular case, because we're adding properties to the Entity itself, and via Entity::getKeyValue we have no information about whether the returned value was inherited from an entityDef or coming directly from the entity itself.

 

If the spawnarg was inherited, it should be listed, but if there is already such a spawnarg on the entity itself, it should be omitted in the AddProperty treeview.

 

The quick and dirty solution would be to always list properties, regardless of whether they exist or not on the entity.

 

The safer code would be to find out about the inheritance status of the returned keyvalue. I'll have to investigate this.

Link to comment
Share on other sites

I can think of two quick ways to solve this problem:

 

Implement a method bool Entity::isInherited(const std::string& key) which checks the status on a case-by-case basis, or add an optional parameter to getKeyValue, which can prevent the Doom3Entity object from querying the eclass if the requested spawnarg wasn't found.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • The Black Arrow

      Hey @nbohr1morehow come the zombies in The Dark Mod don't have a "resurrection" mechanic to it, similar to how Thief has it?
      They're quite a weak creature as of right now, it's merely a walking corpse that slashes you, making attacking them to kill them an actual strategy.
      Would be better if they had some cool mechanism to it that truly makes them a danger, such as the resurrection idea itself.
      · 2 replies
    • Ansome

      Query: when was the last time a zombie in a video game was unnerving or scary to you? I'm chipping away at my anniversary submission and I've been trying to gather opinions on the subject. I'm perfectly capable of lighting them well, changing their sfx, and creating effective ambience, but I'm worried that zombies at their core are just too overdone to be an effective payoff to the tension I'm creating.
      · 4 replies
    • nbohr1more

      The Lieutenant 3 is out! Congrats Frost_Salamander! ( raising awareness )
      · 2 replies
    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
×
×
  • Create New...