Jump to content
The Dark Mod Forums

editor_setKeyValue support


Recommended Posts

I added support for a new kind of editor_ spawarg to DarkRadiant, which allows an entityDef to specifiy a ste of keyvalues which are set on the actual entity after creation. This was a response to this request http://bugs.angua.at/view.php?id=1306, to make func_emitters easier to use.

 

This is the section on the entityDef:

"editor_setKeyValue model"  "-" // the key value to be set when this entity is created

 

The entity will carry a "model" spawnarg right after it will have been created. It's possible to define multiple editor_setKeyValue spawnargs, just add an index to them like this "editor_setKeyValue1".

 

This will be active with the next DarkRadiant release.

 

This also makes me think, whether we should have a wiki article describing these editor_* spawnargs? Anybody up to that?

Link to comment
Share on other sites

I added support for a new kind of editor_ spawarg to DarkRadiant, which allows an entityDef to specifiy a ste of keyvalues which are set on the actual entity after creation. This was a response to this request http://bugs.angua.at/view.php?id=1306, to make func_emitters easier to use.

 

This is the section on the entityDef:

"editor_setKeyValue model"  "-" // the key value to be set when this entity is created

 

The entity will carry a "model" spawnarg right after it will have been created. It's possible to define multiple editor_setKeyValue spawnargs, just add an index to them like this "editor_setKeyValue1".

 

I am not sure in which circumstances this is used. Is this sort of a "default value" for spawnargs for entities that are created in uh the editor? In the game?

 

Also, how does this differ from spawnargs with default values?

 

And last but not least :) how does this tie in with my planned support for def files specifying spawnargs to be set on entities that are def_attached at runtime?

 

This will be active with the next DarkRadiant release.

 

This also makes me think, whether we should have a wiki article describing these editor_* spawnargs? Anybody up to that?

 

The wiki is good for adding images to descriptions and so on, but it absolutely sucks for creating spawnarg articles because the titles get uppercased, underscores get to spaces (so "foo_blah" ends up as "Foo blah") and you can't crosslink and list them unless you do it manually. Which is quite a lot of effort and would double the amount of work to do (document in the def file and wiki).

 

So my plan was to improve the documentation of spawnargs in the def file and improve the doc-generator script we already have and then only have wiki articles for selected groups of spawnars (like the one we have for clipmodels).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I don't really understand this. You mean if I create a func_emitter in DR it will have a default spawnarg 'model' already? I would ask why not just add the spawnarg 'model' to the func_emitter def? Ah! I see that's what Tels is also asking. So do you mean it adds the spawnarg and value to whatever is emitted?

Link to comment
Share on other sites

I don't really understand this. You mean if I create a func_emitter in DR it will have a default spawnarg 'model' already? I would ask why not just add the spawnarg 'model' to the func_emitter def?

No, this is not the point here. If we want a default value, then we can of course set the "model" key on the entityDef and call it done of course.

 

The issue is more one of usability - the inherited "model" spawnarg would not be displayed in DarkRadiant's EntityInspector unless you specifically say so, and even then it's some kind of buried in the grey list of inherited spawnargs.

 

The method above allows for auto-adding a "model" spawnarg to the actual entity (not the def, the map entity), such that the process of selecting the particle is facilitated:

 

- RMB > Create Entity

- Choose func_emitter (this auto-adds the "model" spawnarg)

- Select the "model" spawnarg and hit "Choose Particle".

 

What is saved is that the user doesn't need to browse through the list of inherited values (or the one in the "Add Property" dialog) to select the "model" key. It's right there after creation.

 

Just try it out in the next release, you'll see it then.

Link to comment
Share on other sites

Just try it out in the next release, you'll see it then.

 

Ah okay, this makes sense. Basically it solves a problem I wasn't aware we had :P

 

Edit: Good work! :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

  • 1 month later...

I'm getting lots of Dark Radiant console errors like this...

 

[eclassmgr] AttributeSuffixComparator: cannot compare 'editor_setKeyValue density' with 'editor_setKeyValue bouncyness' at position 18: invalid integer.

 

Not sure why it's comparing density with bouncyness but maybe they have to be in the exact order of their counterparts? Or maybe each one individually must immediately follow its equivalent?

 

I'll document these editors vars eventually - on my todo.

Link to comment
Share on other sites

I'm getting lots of Dark Radiant console errors like this...

 

[eclassmgr] AttributeSuffixComparator: cannot compare 'editor_setKeyValue density' with 'editor_setKeyValue bouncyness' at position 18: invalid integer.

This error is harmless. This is issued by the getAttributeList() method when trying to sort a list of spawnargs matching a given prefix. It tries to do this by converting the suffix to integers, but actually it shouldn't emit an error when this fails. If you report that on the tracker, it will be gone in the next release.

Link to comment
Share on other sites

One potential way to improve usability further would be to pop up a subsidiary dialog when an entity with editor_setKeyValue spawnargs is created, with a list of the "recommended" spawnargs and a PropertyEditor panel where each one could be set. This would make it very clear to the user that they need to set certain values to make the entity behave correctly, as well as highlighting functionality that they might not have been aware of.

Link to comment
Share on other sites

I'm not sure there is any additional required information, is there?

 

You have

 

"editor_setKeyValue model" "blah"

 

so DR can display "model" in its list of "Recommended keyvalues", look it up in its already-existing list of known keys, and choose the ModelPropertyEditor to edit the value.

Link to comment
Share on other sites

I figured there would be a dialog with multiple keyvalues to fill in (as you suggested) - but I guess you're still right anyway, as the editor_setKeyValue spawnargs are there in the first place - DarkRadiant just needs to find all of them.

Link to comment
Share on other sites

I figured there would be a dialog with multiple keyvalues to fill in (as you suggested) - but I guess you're still right anyway, as the editor_setKeyValue spawnargs are there in the first place - DarkRadiant just needs to find all of them.

 

A new dialog/GUI for setting "set ... " spawnargs would also be nice. DR could figure out which attachement points exist and what their names are and what the spawnclass of that entity is, so the user can simple choose the spawnarg/attachement point name. I can do mockups and pseudo-code and put it on the tracker if you wish.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...