Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

I apparently have a shader in my map with the name "Default" (as opposed to the existing shader "_default"). (It is autogenerated when my map loads.) How do I find this shader?

I have tried right-clicking on it and choosing "Select elements using this shader" in the Media tab, without anything being selected, and the only search tool that I've found for textures, seem to be "Map -> Find and replace textures..." in the menu, and I don't want to replace it before I've found it and studied it.

Sometimes - only sometimes - I also get this DR console message: "Found a valid material name in the system clipboard: Default."

What's "the system clipboard"? My regular clipboard? In that case, why would DR search for shaders there?

Edited by Nort
Link to comment
Share on other sites

I've got a window that is breakable. I want the guard to notice if it is broken and get suspicious. I can probably experiment and figure out how to do it, but if anyone knows, or has ideas, let me know. Thanks!

EDIT: Nevermind, "chanceNoticeBrokenItem" can be set on AIs.

Edited by joebarnin
Link to comment
Share on other sites

3 hours ago, joebarnin said:

I've got a window that is breakable. I want the guard to notice if it is broken and get suspicious. I can probably experiment and figure out how to do it, but if anyone knows, or has ideas, let me know. Thanks!

EDIT: Nevermind, "chanceNoticeBrokenItem" can be set on AIs.

I still can't figure this out. Anyone out there with ideas? I tried setting AIUSE_BROKEN_ITEM on the window (a func_fracture), but that doesn't work.

Link to comment
Share on other sites

19 minutes ago, joebarnin said:

I still can't figure this out. Anyone out there with ideas? I tried setting AIUSE_BROKEN_ITEM on the window (a func_fracture), but that doesn't work.

The method I used for destroyed security cameras was:

  • create a visual stim on the security camera and disable it
  • give the security camera the above AIUse spawnarg to identify it as a suspicious broken item
  • when the security camera is destroyed, enable the visual stim

Func_fractures trigger their targets when they're broken, so you can use that to trigger i.e. a relay or itself with a trigger response to enable the visual stim.

  • Thanks 1
Link to comment
Share on other sites

7 hours ago, Dragofer said:

The method I used for destroyed security cameras was:

  • create a visual stim on the security camera and disable it
  • give the security camera the above AIUse spawnarg to identify it as a suspicious broken item
  • when the security camera is destroyed, enable the visual stim

Func_fractures trigger their targets when they're broken, so you can use that to trigger i.e. a relay or itself with a trigger response to enable the visual stim.

Thanks, this makes sense. But I still must be doing something wrong, because I can't get it to work. Maybe some detail in setting up the visual stim. Is there a mission that uses this technique that I can look at?

Edit: I think the visual stim doesn't work because the guard can't "see" the window (because it's clear glass). So I think the solution is to put AIUse spawnarg on the window frame, and then when the window breaks set the visual stim on the window frame. The guard can see the window frame (because it's not clear), so the stim will happen. I'll test this fully tomorrow.

Edited by joebarnin
  • Like 1
Link to comment
Share on other sites

The func_fracture is more a visual thing that was already part of Doom 3. The whole notice something is broken was setup later for TDM and relies on visual stims by the entity in question, which isn't provided by the func_fracture class.

5 hours ago, joebarnin said:

I think the visual stim doesn't work because the guard can't "see" the window (because it's clear glass).

I doubt that is the reason. Func_fracture were just never setup for what you are trying, probably because they are rarely used. Maybe something to be added for 2.11, though.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

5 hours ago, Obsttorte said:

The func_fracture is more a visual thing that was already part of Doom 3. The whole notice something is broken was setup later for TDM and relies on visual stims by the entity in question, which isn't provided by the func_fracture class.

The idea is to add a visual stim, disabled at map start, to the func_fracture that can be enabled when the glass is destroyed. For some reason the AI is not reacting to the stim if it comes from the func_fracture, or the stim is not being activated due to a mistake in the setup.

Link to comment
Share on other sites

I've done some more testing, and as far as I can tell the AI never sees a visual stim when it is on a func_fracture that's been shattered (in fact, AIs don't appear to see visual stims on unbroken windows either). In a certain way, that makes sense: the glass isn't there anymore (even the shards are gone after 5 seconds or so).

I've got a simple workaround. I made the window frame a func_static, and gave it the AIUse=AIUSE_BROKEN_ITEM spawn arg, and set up the disabled STIM_VISUAL on it. Then when the window shatters, it sets enables the STIM_VISUAL on the frame. When the guard walks in, he notices the broken window and goes on alert.

  • Like 1
Link to comment
Share on other sites

Just a short note on the func_fracture entities. The ai code will, if receiving a visual stim by an entity, check for the AIUse spawnarg and react accordingly. If, however, none such value is set upon the first stim, the ai will ignore the entity in the future.

The issue is, that for breakable items the approach was probably intented as that the unbroken entity gets replaced by a broken model that has the AIUSE_BROKEN_ITEM tag set. The new security cameras might be an example for this, as they are destroyable iirc.

Now we don't want to replace the func_fracture entity with something else, as it is capable of representing both the unbroaken and broken state. Therefore I would add a new AIUse tag to allow for that special case. This will take a bit, so if there are any possible drawbacks one can see here, please tell me.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

1 hour ago, Obsttorte said:

The issue is, that for breakable items the approach was probably intented as that the unbroken entity gets replaced by a broken model that has the AIUSE_BROKEN_ITEM tag set.

That's how it works for arrows, which get replaced by a different arrow entity upon impact that has the AIUse_SUSPICIOUS flag (exception is fire arrows, which are suspicious already in flight).

Weapons dropped when an AI is KOed probably work differently, since it looks to me like they're still the same entity. They have AIUse_WEAPON since the beginning - so maybe the code is able to flag a dropped weapon as having belonged to an AI.

In general, breakable entities specify a different model to show when broken, rather than getting replaced by a new entity. That's also the case with my security camera. It has an AIUse_BROKEN_ITEM flag and an inactive visual stim, and when the security camera is destroyed it starts emitting that visual stim.

1 hour ago, Obsttorte said:

Now we don't want to replace the func_fracture entity with something else, as it is capable of representing both the unbroaken and broken state. Therefore I would add a new AIUse tag to allow for that special case. This will take a bit, so if there are any possible drawbacks one can see here, please tell me.

The problem seems to be, based on joebarnin's report, that AIs never react to a visual stim if it comes from a func_fracture - and that's with the AIUse flag already set at map start.

If he transfers the stim + flag to the func_static windowframe it works as intended and can be enabled when the func_fracture is destroyed.

So I don't think it's a problem with the flag, but more with the func_fracture. I remember I explicitly had to add lines to the security camera code to allow it to have Stim/Response, so maybe func_fracture would need that too.

That said, I think an AIUse flag for entities that can be either in an intact or broken state would be useful, since the AI code could just check whether the entity has become broken rather than needing a trigger to enable the visual stim. Both the func_fracture and the security camera would benefit from that.

Link to comment
Share on other sites

Is this console message normal, or something I should be worried about?

Quote

############### entity 0 ###############
-- ( worldspawn:  )
  0.0 seconds for BuildLightShadows

I can't remember if it has always been there, or if it started appearing after I converted worldspawn (entity 0) into an entity (by connecting it to another entity).

How do I convert the worldspawn back to a non-entity? (I don't need it to target anything anymore.)

 I tried just deleting the target argument, but the "entity 0" message is still appearing.

I heard that DR version 3.0.0 has some sort of UI for this, but I'm worried that I might screw things up irrevocably if I upgrade before I fix this.

To summarize:

1. Should that message appear?

2. Does it have something to do with the console stating that 28 of my 29 visportals are invalid?

3. How can I make sure that my worldspawn isn't an entity anymore?

Link to comment
Share on other sites

1 hour ago, Dragofer said:

In general, breakable entities specify a different model to show when broken, rather than getting replaced by a new entity. That's also the case with my security camera. It has an AIUse_BROKEN_ITEM flag and an inactive visual stim, and when the security camera is destroyed it starts emitting that visual stim.

That's what I wrote, a bit shortened, though.

1 hour ago, Dragofer said:

The problem seems to be, based on joebarnin's report, that AIs never react to a visual stim if it comes from a func_fracture - and that's with the AIUse flag already set at map start.

That was another issue I have already resolved. The issue was that a flag was added to the entity baseclass to mark it as broken. However, the functions called by default entities versus the one func_fractures use are different and the flag has not been set in the latter. By doing so the ai does notice the func_fracture if the AIUse flag and the visual stim are set at map start. The only issue now is on how to make the ai aware of the glass once it's broken.

 

Now that I think about it, it might be already sufficient if the visual stim is off at map start and gets turned on once the glass breaks. I'll have to test that.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

17 minutes ago, Obsttorte said:

That's what I wrote, a bit shortened, though.

Hm, it's not clear to me how you meant that an AIUse flag would get added to the entity when it gets destroyed, since in my understanding "breaking" an entity usually just changes its appearance.

10 minutes ago, Nort said:

My other map also has a "ShaderLibrary: definition not found: Default" Dark Radiant console warning on editor load.

Is this appearing in your maps as well?

I suppose you have a surface with a missing material, which DarkRadiant names "Default".

Link to comment
Share on other sites

Just now, Dragofer said:

Hm, it's not clear to me how you meant that an AIUse flag would get added to the entity when it gets destroyed, since in my understanding "breaking" an entity usually just changes its appearance.

I suppose you have a surface with a missing material, which DarkRadiant names "Default".

Maybe. The first post on this page has more details about this. Check the DR console log for one of your maps. It's likely you have it too.

Link to comment
Share on other sites

42 minutes ago, AluminumHaste said:

To change an entity back to worldspawn, right click on entity,  revert to worldspawn

Actually, the
"############### entity 0 ###############
-- ( worldspawn:  )
  0.0 seconds for BuildLightShadows"
message does appear in the console logs of all my maps, including some very basic ones, so it's actually normal. It's only if the entity number is not 0, that I should worry.

Also, it's newbie answers like this, that makes me want to not post in the newbie thread. ...but just to be sure, I checked, and the "Revert to worldspawn" option is greyed out.

Now all that remains is the "Default" shader question. I think it's defined somewhere in Dark Radiant, but I don't know where. (No, it's not the "_default" shader that's defined in the internal shaders. That one gives a warning because it's missing a texture, but that one I fixed. This one is named "Default".)

 

Edited by Nort
Link to comment
Share on other sites

If you've grouped multiple entities together, you'll have to ungroup them then revert to worldspawn, or you're not explaining the problem well enough for me to understand.

And it's douche responses like yours that makes people not want to interact with you.

 

EDIT: If you converted the brush to an entity type/class, you can't change it back to worldspawn, just delete it.

 

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Just now, AluminumHaste said:

If you've grouped multiple entities together, you'll have to ungroup them then revert to worldspawn, or you're not explaining the problem well enough for me to understand.

No, I'm saying that there was no problem to begin with, and that I worried over nothing. All I did was to have worldspawn target an entity (via a "target0" property), and I thought that this in turn, had automatically turned worldspawn into an entity itself, which in turn had caused a massive leak that invalidated most of my portals. ...but now I don't think that worldspawn turned into an entity at all, and that something else is causing the portals to be invalidated (like them being in line of sight of eachother, perhaps).

The "Default" shader is another matter, though. That is an actual Dark Radiant console warning that I sometimes get, which is unrelated to the worldspawn message. That I need help with.

 

Link to comment
Share on other sites

10 hours ago, Dragofer said:

Hm, it's not clear to me how you meant that an AIUse flag would get added to the entity when it gets destroyed, since in my understanding "breaking" an entity usually just changes its appearance.

Because that is not what I have written, and you are right that basically the appearence change. Taking a look at the security cameras it appears that they are set to AIUSE_BROKEN_ITEM to begin with, which oddly causes issues with the glass, as it will alert the ai even if the glass is not broken yet, but doesn't seem to behave so with the camera. There is quiet a bunch of other spawnargs set, though, so maybe some of them can get the desired behaviour without the necessity of further code changes.

 

EDIT: I just looked at the code and could see that the security camera does what I intented for the func_fracture. It has an inactive visual stim that gets enabled upon destruction, at least if notice_destroyed is set to 1 (what is the default). I guess I can just mimic that for the func_fracture.

EDIT EDIT: Works like a charm.

😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃

😃😃😃😃😃😃😃😃    😃😃😃😃😃😃😃         😃😃                  😃😃

             😃😃                  😃                          😃    😃  😃              😃  😃

             😃😃                  😃                          😃    😃    😃          😃    😃

             😃😃                  😃                          😃    😃      😃      😃      😃

             😃😃                  😃                          😃    😃        😃  😃        😃

             😃😃                  😃😃😃😃😃😃 😃       😃           😃            😃

 😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

If you have an AI that is set to sit and sleep in a chair, when it wakes up it pivots to the right before it gets up.  This doesn't happen if it's just sitting instead of sitting and sleeping.  

Is there a way to stop the pivot from happening?  I don't have any sit_down_angle or any other spawnargs set, it seems to be the default behaviour.  I'm guessing it's a leftover from waking up on a bed where the AI has to pivot to get up from the bed. 

It's undesirable because the AI does dumb things like pivoting into a wall or some other place where they get stuck.

Things I've tried:

 

 

Link to comment
Share on other sites

34 minutes ago, Obsttorte said:

Because that is not what I have written, and you are right that basically the appearence change.

We might have been reading past each other quite a bit here / peculiarities of the English language (i.e. I also mentioned using the security camera method). Well the main thing is something comes out of it.

Btw joebarnin said he also tried the AIUse flag + inactive visual stim method but it didn't work for him on a func_fracture, only on a func_static.

Link to comment
Share on other sites

@Frost_Salamander I find it helps to give an AI a path_corner in front of the chair and make sure the path_sit/path_sleep have an "angle" spawnarg in such situations, even if they spawn in front of the chair. This helps AIs know which direction they've originally come from when getting back up.

  • Thanks 1
Link to comment
Share on other sites

42 minutes ago, Dragofer said:

@Frost_Salamander I find it helps to give an AI a path_corner in front of the chair and make sure the path_sit/path_sleep have an "angle" spawnarg in such situations, even if they spawn in front of the chair. This helps AIs know which direction they've originally come from when getting back up.

I forgot to mention I was just setting the 'sleeping' and 'sitting' spawnargs, not using path nodes.  I changed to using the path nodes, and yeah it works as expected.  Thanks!

  • Like 1
Link to comment
Share on other sites

@Nort

Entity 0 and worldspawn are the same thing. More exactly, in the .map file, all worldspawn brushes and patches are listed anonymously under entity 0.

Also, I don't know if this is relevant to your DR Default issue, but if you have your work organized by projects in <FM> folders, and you have created custom textures (or other custom assets), you have to make sure you tell DR which project to use currently. Otherwise, textures will appear missing in DR.

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 1 reply
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...