MirceaKitsune Posted August 27 Report Share Posted August 27 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: 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? 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? Quote Mods: Builder Blocks minigame | Keypad | Disguises Link to comment Share on other sites More sharing options...
datiswous Posted August 28 Report Share Posted August 28 (edited) There's also a skin visible and skin invisible spawnarg. But this doesn't disable the ai, I would think. https://wiki.thedarkmod.com/index.php?title=Creating_Multiple_Skins_For_A_Model#Wildcard_skins Edited August 28 by datiswous Quote Link to comment Share on other sites More sharing options...
MirceaKitsune Posted August 28 Report Share Posted August 28 (edited) 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 August 28 by MirceaKitsune Quote Mods: Builder Blocks minigame | Keypad | Disguises Link to comment Share on other sites More sharing options...
joebarnin Posted August 29 Report Share Posted August 29 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. Quote Link to comment Share on other sites More sharing options...
MirceaKitsune Posted August 29 Report Share Posted August 29 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. Quote Mods: Builder Blocks minigame | Keypad | Disguises Link to comment Share on other sites More sharing options...
MirceaKitsune Posted September 7 Report Share Posted September 7 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. Create a trigger_multiple entity. Give it a wait spawnarg of 0.05. Create a trigger_inactivity entity. Give it a delay of spawnarg of 0.5. Create a toggleable electric light that can be triggered on or off. 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. Quote Mods: Builder Blocks minigame | Keypad | Disguises Link to comment Share on other sites More sharing options...
grodenglaive Posted September 7 Report Share Posted September 7 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. Create a trigger_multiple entity. Give it a wait spawnarg of 0.05. Create a trigger_inactivity entity. Give it a delay of spawnarg of 0.5. Create a toggleable electric light that can be triggered on or off. 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. Quote Link to comment Share on other sites More sharing options...
grodenglaive Posted September 7 Report Share Posted September 7 also same result using a trigger_entityname instead of trigger_multiple Quote Link to comment Share on other sites More sharing options...
MirceaKitsune Posted September 7 Report Share Posted September 7 Thanks for confirming: I reported the bug and hopefully it can be fixed for the next dev snapshot. Will rework my setup as to not run into this bug in the meantime. https://bugs.thedarkmod.com/view.php?id=6563 Quote Mods: Builder Blocks minigame | Keypad | Disguises Link to comment Share on other sites More sharing options...
datiswous Posted September 9 Report Share Posted September 9 (edited) 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 September 9 by datiswous 1 Quote Link to comment Share on other sites More sharing options...
grodenglaive Posted September 9 Report Share Posted September 9 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? Quote Link to comment Share on other sites More sharing options...
datiswous Posted September 9 Report Share Posted September 9 (edited) 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 September 9 by datiswous 1 Quote Link to comment Share on other sites More sharing options...
grodenglaive Posted September 9 Report Share Posted September 9 OK, good to know. I'm thinking of using this as well. Quote Link to comment Share on other sites More sharing options...
MirceaKitsune Posted September 9 Report Share Posted September 9 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. Quote Mods: Builder Blocks minigame | Keypad | Disguises Link to comment Share on other sites More sharing options...
datiswous Posted September 9 Report Share Posted September 9 (edited) See here for more info on the feature: Edited September 9 by datiswous 1 Quote Link to comment Share on other sites More sharing options...
datiswous Posted September 9 Report Share Posted September 9 Btw. does anyone know how many missions use this script? I only know Tears of St. Lucia has it. Quote Link to comment Share on other sites More sharing options...
Geep Posted September 11 Report Share Posted September 11 Both New Job and Tears of St. Lucia use trigger_look and ai_trigger_look. Others I'm aware of that use trigger_look include my airpocket and Goldwell's The Accountant 2. Probably lots more. 1 1 Quote Link to comment Share on other sites More sharing options...
Uncertain Title Posted September 12 Report Share Posted September 12 I can't seem to prevent my inverted endcaps from looking like they melted. None of its faces can be selected via shift-ctrl-click...any ideas as to what could be the cause? Quote Link to comment Share on other sites More sharing options...
AluminumHaste Posted September 12 Report Share Posted September 12 @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. 1 Quote I always assumed I'd taste like boot leather. Link to comment Share on other sites More sharing options...
Uncertain Title Posted September 13 Report Share Posted September 13 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!!! Quote Link to comment Share on other sites More sharing options...
MirceaKitsune Posted September 13 Report Share Posted September 13 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. Quote Mods: Builder Blocks minigame | Keypad | Disguises Link to comment Share on other sites More sharing options...
AluminumHaste Posted September 13 Report Share Posted September 13 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 Quote I always assumed I'd taste like boot leather. Link to comment Share on other sites More sharing options...
MirceaKitsune Posted September 13 Report Share Posted September 13 (edited) 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 September 13 by MirceaKitsune Quote Mods: Builder Blocks minigame | Keypad | Disguises Link to comment Share on other sites More sharing options...
joebarnin Posted September 13 Report Share Posted September 13 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. 1 Quote Link to comment Share on other sites More sharing options...
ERH+ Posted September 18 Report Share Posted September 18 What this script error means?: "...EnterFunction: locals stack overflow" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.