Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

This seems like a sensible thing to raise on the bug tracker.

  • Thanks 1

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

Building on what @HMart said, here's a technique that extends the existing 'text' entity. In the "def" folder of your mission, create a <whatever>.def text file. E.g., mytext.def. It should contain this:

entityDef mytext {
    "inherit" "text"
    "editor_setKeyValue force" "0"
    "editor_setKeyValue playerOriented" "0"
    "editor_setKeyValue text" "Default text"
}
 

(you can name it something else besides "mytext"). Since it inherits from the default text entity, it will behave correctly.

In DM, create a "mytext" entity - it will have those three properties initialized to the values specified in the .def file.

  • Like 2
Link to comment
Share on other sites

On 10/3/2023 at 9:15 PM, thebigh said:

This seems like a sensible thing to raise on the bug tracker.

I will do this.  Just gotta dig up my tracker login info!

I have this feeling that there was another bug or maybe forum conversation about missing entity spawnargs in general.  I will try to make sure I am not creating a dupe entry before doing so.

Appreciated.

Clint

Link to comment
Share on other sites

If you look inside the definition of atdm:sconce_2candles_rigid you can see that no name_attach is specified. Looking at this guide, it should be specified as such.

Maybe you can manually set the name_attach1 for example to theflame1 and then do set light_radius on theflame1 . Just a guess.

Another idea is to copy the dev file and add a name_attach to it.

From testing this does seem to work, although I'm not sure if this is what did it.

Edited by datiswous
  • Thanks 2
Link to comment
Share on other sites

A really grubby hack for that is to make a live AI with the def_head you want and then use a script to kill it on map start.

  • Thanks 1

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

I have a scripting question I may use for a mod: What is the function to check if an AI is seeing the player, and the extent to which the player is visible in their awareness based on distance from the AI as well as lightgem and any other factors?

Till recently I thought this isn't possible, until I played through Iris which found a way: In the FM most AI are friendly unless they see you steal things or pick doors or enter restricted areas, they only become hostile if that AI is looking at the player while being close enough to make out what they're doing. Technically I could dig through its scripts but there's probably a lot bundled together, so if anyone knows I could use a simplified description of that part.

Link to comment
Share on other sites

I think you're looking for the visScan() function. I've never used it myself, but from the documentation it's supposed to check whether the player is in an AI's field of view, taking into account obstructions and light level. From there you'd just need to trigger some checks for whether the player is doing something forbidden like picking a lock or being in an area he's not supposed to be.

  • Thanks 1

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

14 minutes ago, thebigh said:

I think you're looking for the visScan() function. I've never used it myself, but from the documentation it's supposed to check whether the player is in an AI's field of view, taking into account obstructions and light level. From there you'd just need to trigger some checks for whether the player is doing something forbidden like picking a lock or being in an area he's not supposed to be.

Thanks. Seems it's either visScan() or findEnemy() I can't quite tell what the difference between them is supposed to be. Will give it a try... doing a little experiment that might have fun results!

Does anyone have an inventory icon for the Citywatch helmet, or know a FM I can get one from? Doesn't seem like there's one in "hud/inventory_icons" and I'd need it for my little idea.

Link to comment
Share on other sites

I'm guessing findEnemy() would require that the AI already thinks of you as hostile.

As for inventory icons, when I needed one that didn't already exist, I put one in my map and screenshotted it in TDM, then used GIMP to cut it out. Have a look at how I did it in deLisle for the white mushrooms if you want to see a very grotty and amateurish example.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

For taking a screenshot of an item to use as an HUD icon, sometimes it's easier to do that in DR (e.g., in the head model view), where you have better shot control than in TDM, even if the lighting is a bit unrealistic. Fakey lighting for an icon is often not a problem.

Edited by Geep
Link to comment
Share on other sites

Doing it in DarkRadiant sounds easiest: What's the best texture to put on a bush to screenshot the item behind, is there a fully white or black one by default? Main issue is cutting out the outline and getting the same consistent style across items, but I do lots of editing in Gimp so this shouldn't be a problem.

As for the AI vis check it turns out to be a bit more complicated: visScan() only notices the player if they're an enemy to the AI, while the AI is friendly it stops working. findFriendlyAI() does work instead, but the name makes it sound ambiguous to use it to check for the player although it seems to work, also the documentation says it's costly and not to call it each frame which I'd have to do in my case, lastly it only detects the nearest entity so if another ally is standing closer to the AI than the player this won't report them. Am I out of luck with this one and need to not implement the check? I'm not seeing any other way to trace the AI's FOV cone.

Edited by MirceaKitsune
Link to comment
Share on other sites

To get a pure black background, one way is to use the view pane in the "Choose Model" picker. In the controls under the view pane, select "Lighting Mode" instead of "Texture Mode". You'll want to turn off grid lines there too, and play around with the filter options.

I see there are helmets (without heads in them) under models/darkmod/wearables/headgear/

Link to comment
Share on other sites

Thanks everyone. If all goes well I might have a nice little mod ready by tonight I hope you'll enjoy :)

https://bugs.thedarkmod.com/view.php?id=6326

This bug is currently the last thing limiting me: Please let me know if anyone ever ran into that and knows a workaround or what I'm doing wrong, till whatever causes that can hopefully be fixed. I'm trying to change the player's head and use a custom one for seeing yourself in a mirror, it works but randomly introduces a crashes due to a negative model index.

Edited by MirceaKitsune
Link to comment
Share on other sites

7 hours ago, Geep said:

Is there some reason that the custom head can't be just given to the player at the outset (in some def file), and not swapped? Might be more stable, I'm guessing.

Yes, needs to be switched back and forth in realtime. I just posted my mod so you can check it out here for more info:

Edited by MirceaKitsune
Link to comment
Share on other sites

I had a curiosity: Is it possible to define an item that is picked up and used by nearby AI occasionally, without necessarily having to link a path node to it or target it from the AI? For example a wine bottle on a table: The AI picks it up drinks from it and puts it down, while patrolling next to it then resuming their patrol after using it (playing an animation).

Looking at the AI prefabs, an AI need to target things such as food items with the "pickup_bottle_pickup" or "eating_apple" spawnargs. Is there a way that's proximity based and doesn't require that?

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

      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 )
      · 2 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
       
      · 5 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...