Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Getting ready to head back home and did a quick search on the wiki page from my laptop. The commands I need are hide() and show() for visibility, setModel() for changing the model, setSkin() for changing the skin. The key questions are:

  1. What happens if I use show() and hide() on an AI or ragdoll? Does TDM know to hide all entities attached to that AI and suspend AI processing then resume when showing again? Or would it only make the body entity invisible and break stuff?
  2. What happens if I use getHead() to get an AI's head then use setModel() on that? In my disguises mod I used to get a crash when changing the player's head model but this has since been fixed, I take it doing it on AI should be safe too then?
Link to comment
Share on other sites

Thanks. Sounds like what I want isn't easy to achieve at this moment. It's not a huge issue: I'll just stick to doing it to static AI only, as long as they don't patrol teleporting to and from an invisible room won't be an issue.

There's another question I was eager to ask; Looking at the script wiki this doesn't seem to be implemented sadly, but it feels like something logical to open a bug for if not. Is there a script function to detect if an info_location is open, so the script can know if the player is looking into a particular room through any open portals? Or can you check if a particular portal is open? Can you at least define a brush or entity that triggers something once it's seen or no longer being seen?

The ability would greatly help my idea of making rooms that change in strange ways when the player isn't looking: The way I'm planning to do it is using trigger_multiple brushes that change stuff when the player reaches a position from which they can't see the room changing. However this doesn't support changing by turning around to look away from an open door, then seeing the changes once turning around again and looking through the opening: That could be used to do some really tripping things, like hallways (dis)appearing as the player sits in one spot and turns around without seeing the walls pop in or out of existence :)

Edited by MirceaKitsune
Link to comment
Share on other sites

4 hours ago, MirceaKitsune said:

The ability would greatly help my idea of making rooms that change in strange ways when the player isn't looking: The way I'm planning to do it is using trigger_multiple brushes that change stuff when the player reaches a position from which they can't see the room changing. However this doesn't support changing by turning around to look away from an open door, then seeing the changes once turning around again and looking through the opening: That could be used to do some really tripping things, like hallways (dis)appearing as the player sits in one spot and turns around without seeing the walls pop in or out of existence :)

I've been prototyping something very similar. The idea is, if an object is in your FOV, you don't see it. If your "back is turned", it's there (and you can see it in a mirror). I've got it working, except for some edge cases. I'll be happy to share what I've done, once I clean it up.

Link to comment
Share on other sites

12 hours ago, joebarnin said:

I've been prototyping something very similar. The idea is, if an object is in your FOV, you don't see it. If your "back is turned", it's there (and you can see it in a mirror). I've got it working, except for some edge cases. I'll be happy to share what I've done, once I clean it up.

Thanks. Was thinking that even if open room / portal detection isn't a function in the scripting system yet, I could at least compute if an area is within the player's view cone. But even that's a bit complex since you must account for camera position + rotation + fov to tell if any point of a brush entity (filling the room) is being intersected.

Link to comment
Share on other sites

  • 2 weeks later...

I suspect I found a bug with the trigger_inactivity entity but would like to ask for confirmation before reporting. Please try the following setup: Let me know the result you get and if this is normal.

  1. Create a trigger_multiple entity. Give it a wait spawnarg of 0.05.
  2. Create a trigger_inactivity entity. Give it a delay of spawnarg of 0.5.
  3. Create a toggleable electric light that can be triggered on or off.
  4. Link the trigger_multiple brush to the trigger_inactivity entity and the trigger_inactivity to the light.

Expected result: Since the trigger_multiple executes every 0.05 seconds and the trigger_inactivity executes every 0.5 seconds, the player sitting inside the brush for several seconds should not cause the light to turn on or off, this should instead happen 0.5 seconds after the player has left the boundaries of the trigger_multiple brush.

Observed result: As the player sits inside the trigger_multiple brush, the light constantly blinks between on and off every 1 second. I get the correct behavior if I set the delay of the trigger_inactivity above 1, but this doesn't give me the short amount of time I need. Linking the trigger_multiple directly to the light makes it flicker and  confirms that it executes at the desired interval, the issue seems to be with inactivity detection when set to 1 second or below.

Link to comment
Share on other sites

10 hours ago, MirceaKitsune said:

I suspect I found a bug with the trigger_inactivity entity but would like to ask for confirmation before reporting. Please try the following setup: Let me know the result you get and if this is normal.

  1. Create a trigger_multiple entity. Give it a wait spawnarg of 0.05.
  2. Create a trigger_inactivity entity. Give it a delay of spawnarg of 0.5.
  3. Create a toggleable electric light that can be triggered on or off.
  4. Link the trigger_multiple brush to the trigger_inactivity entity and the trigger_inactivity to the light.

Expected result: Since the trigger_multiple executes every 0.05 seconds and the trigger_inactivity executes every 0.5 seconds, the player sitting inside the brush for several seconds should not cause the light to turn on or off, this should instead happen 0.5 seconds after the player has left the boundaries of the trigger_multiple brush.

Observed result: As the player sits inside the trigger_multiple brush, the light constantly blinks between on and off every 1 second. I get the correct behavior if I set the delay of the trigger_inactivity above 1, but this doesn't give me the short amount of time I need. Linking the trigger_multiple directly to the light makes it flicker and  confirms that it executes at the desired interval, the issue seems to be with inactivity detection when set to 1 second or below.

I get the same result. I also tried it with just a regular light, in case the electric light flicker somehow interfered. No difference.  It seems like a bug to me too.

Link to comment
Share on other sites

On 8/28/2024 at 9:35 PM, MirceaKitsune said:

Can you at least define a brush or entity that triggers something once it's seen or no longer being seen?

Well there's:

https://wiki.thedarkmod.com/index.php?title=Triggering_events_when_looking_at_something

Btw. I played with it and found the distance spawnarg unreliable (at least at close range), but I think it should work well when only active in a set region, for example when you enter a zone with a specific info_location the script trigger_look could activate and deactivate when you leave.

It's part of core scripts.

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

36 minutes ago, datiswous said:

for example when you enter a zone with a specific info_location the script trigger_look will activate and deactivate when you leave.

Is that a default behaviour for zones or does the info_location need a spawnarg or something to enable the trigger_look?

Link to comment
Share on other sites

No I just think the script doesn't work correctly if it is active in the whole map, like is the case for example in Tears of St. Lucia and there it's bugged.

The info location system is just an example way to activate it in a region (although I've never tried it, but I think it should work), there might be better ways.

See https://wiki.thedarkmod.com/index.php?title=Location_Settings#Script_calls

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

Thanks! Does it account for the player's FOV to ensure the object is truly being seen, or is it only take a fixed angle and you need to set a good limit yourself? Was also wondering if it only works for point entities or also brushes, so to check if a room is being seen you can have a trigger_look brush covering it.

Link to comment
Share on other sites

@Uncertain Title

Copy the texture projection from a donor brush and paste it onto the inverted bevel.

Middle mouse click and CTRL+Middle mouse click.

Also, brushes have faces, patches do not. You don't select "a single face" of a patch as a patch is like all one face. You can select the patch like normal and use the texture inspector to adjust it's projection, or just do the easy thing and copy a projection from a brush and paste it onto the patch.

  • Like 1

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

16 hours ago, AluminumHaste said:

@Uncertain Title

Copy the texture projection from a donor brush and paste it onto the inverted bevel.

Middle mouse click and CTRL+Middle mouse click.

Also, brushes have faces, patches do not. You don't select "a single face" of a patch as a patch is like all one face. You can select the patch like normal and use the texture inspector to adjust it's projection, or just do the easy thing and copy a projection from a brush and paste it onto the patch.

Ah, that fixed it! Thank you so much!!!

Link to comment
Share on other sites

How do I keep AI from becoming alerted by seeing a ragdoll that spawns at the start and they're supposed to be used to? Also how to mark a door as inoperable by AI so only the player can open that particular door, apparently AI can operate even doors set as non-frobable.

Link to comment
Share on other sites

39 minutes ago, MirceaKitsune said:

How do I keep AI from becoming alerted by seeing a ragdoll that spawns at the start and they're supposed to be used to? Also how to mark a door as inoperable by AI so only the player can open that particular door, apparently AI can operate even doors set as non-frobable.

https://wiki.thedarkmod.com/index.php?title=AI_Relations_(Editing)

 

Definition of Relationship Types

The three types of relationships are Friends, enemies, and neutrals. When assigning relations they take the values 1, -1, and 0.

  • 1: Friends will
    • come to the aid of another friend who is alerted.
    • commence searching or attacking in that friend's vicinity or flee depending on AI type.
    • Be alerted if finding a body of a friend.
  • -1: Enemies will
    • Attack other enemies they become aware of.
    • Ignore other enemy and neutral bodies
  • 0: Neutrals will
    • ignore calls of distress from those they are neutral to.
    • Ignore all bodies they are neutral to.

Set the ragdoll AI to Neutral on a different team

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Oh, I just wasn't sure if that would work and ragdolls use teams like living AI. Very easy to solve then. Thanks.

Edit: Doesn't work. I set the ragdoll team to 5 and AI team to 2, the wiki page indicates they are neutral. The ragdoll still makes AI alert when the map starts.

Edited by MirceaKitsune
Link to comment
Share on other sites

2 hours ago, MirceaKitsune said:

Also how to mark a door as inoperable by AI so only the player can open that particular door, apparently AI can operate even doors set as non-frobable.

See https://wiki.thedarkmod.com/index.php?title=Doors#AI_Door_management. Looks like ai_should_not_handle is the spawnarg you want.

  • Thanks 1
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.


×
×
  • Create New...