Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


Recommended Posts

Three little questions. It's for prefabs I'm making and planning to offer to other mappers, might make some good stuff if I figure these out.

  1. How can I designate a button that will be pressed by an AI who becomes alert, so whenever someone catches you they run to and press that button? I think I have this one figured out but would like for someone to confirm: I create a path_flee_point, which targets a path_interact, which has the button meant to be pressed as its ent. Only problem is that the paths wiki page doesn't clarify if a path_flee_point can target another path entity like a path_corner, in order to tell the AI what to do after they fled to that spot... can it do that or is it only meant to indicate a location to flee to?
  2. How do I create a lock that triggers something other than a door? What I mean by this is: I want a lock just like the ones you find on chests, it can be frobbed and either unlocked with a key or lockpicked... however once you unlock and activate it, it's not a door that opens but something else getting triggered. I pretty much want a lock-button, like say a light you can only turn on / off with a lockpick or key used on a keyhole on the wall. I don't know how to do this one as locks are always a property of atdm:mover_door entities, I've never or rarely seen them used as secure buttons for something else.
  3. What's the best way to draw a laser beam that can be toggled, but only by using the existing assets? There are three ways I'm thinking of going about this: One is to simply use a cylinder patch textured with a light texture, the "hide" flag can be used to toggle it. Another is to use a particle emitter, however I'm not aware of a good particle definition that would do the trick. The last is to use a fog light with its box radius adjusted in the shape of a stick... kinda leaning toward this one as it would then cast shadows too, will prolly go ahead and attempt it then consider other methods if that fails.
Link to post
Share on other sites
  • Replies 10k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

So I have this gigantic scorpion, it is made out of pendulums bound together. I had an idea about dragging whole thing through a piled up crates (pretending to be stone blocks in a wall), but it looks

I'm just going to make the lute player an undead immortal skeleton called Ralph who is eternally bound to play his lute in the tavern, the residents are used to him now so they just happily co-exist a

Thanks for the advice about the tent, guys. Finally got around to (mostly) fixing it; shadows were indeed the problem.    

Posted Images

Confirming my concern for #1 above: Fleeing AI (not armed ones either which is also a problem) will run to the flee point, however they ignore any path the flee point targets. Any way to work around that, without using a custom script?

Also don't worry about #3: I found the available options and am playing with them now.

Edited by MirceaKitsune
Link to post
Share on other sites

Cheers! Regarding the lockbox: atdm:froblock works perfectly for what I want, I got it to turn off a lamp when being unlocked which is exactly what I wanted. There are just two problems with it at the moment:

  1. It will activate with a key, but not when being lockpicked; It allows me to use the lockpick on it, but once I'm done it doesn't unlock and I can't pick it any further. I tried both the setup in that post and the intended "lock_picktype t" + "lock_pins 10": I can successfully use the triangle lockpick on the box once, but once picked nothing will happen!
  2. Once unlocked with the key and having triggered its target, the lockbox can no longer be frobbed again. I wanted to have it so that after being picked it can be toggled like a button, plus locked again if using its key on it.

Screenshot_20201122_163722.png.61f749d0ceff9837dfbb4e3897e1a77d.png

Regarding the beam: I actually missed func_beam which is so much better than the path cylinder I was using! Got it to work very nicely... with just a little detail I'd like to change: Is there any way to make the beam cut off when any player or AI or object is standing in front of it? Or can it only render at a fixed length all the time?

Looking great otherwise... especially when used with a super thin light source to have the dot of light shine at its end too! Time for some DeusEx style traps and alarms, likely to be featured in my next FM as well :D

NuUIe0F.jpg

Link to post
Share on other sites

@MirceaKitsune

About the lock I don't know how to do that ...

For the func_beam, it is just a beem between the 2 func_beams, so if it has to stop where something is in between, you should have the receiving func_beam move to the position of the surface of what is in between somehow ...

Link to post
Share on other sites
1 hour ago, STRUNK said:

@MirceaKitsune

About the lock I don't know how to do that ...

For the func_beam, it is just a beem between the 2 func_beams, so if it has to stop where something is in between, you should have the receiving func_beam move to the position of the surface of what is in between somehow ...

Okay. I'll wait for answers on the lock and play with it some more in the meantime... there must be a spawnarg to fix that problem. Otherwise I'm not aware of a way to make the targeted func_beam move to the nearest surface in the direction of the targeting func_beam, that I'll probably have to leave as is.

Please also let me know if there's any way (no custom script though) to make an AI run to a button and press it when alert, ideally before attacking the target it saw that alerted it. Even path_flee_point won't do anything when the AI runs there no matter what I target it to :(

Update: Fixed the lock issue. The problem seems to be that I was setting lock_pins to 10, its value must only range between 0 and 5 apparently.

Edited by MirceaKitsune
Fixed the lock issue
Link to post
Share on other sites
4 hours ago, MirceaKitsune said:

with just a little detail I'd like to change: Is there any way to make the beam cut off when any player or AI or object is standing in front of it?

As per the TDM Script Reference wiki page, you can do a trace from the beam's origin to check whether there are solid bodies in that direction, then place the beam's end wherever that collision has taken place. Supplementary script functions even let you figure out which bone on an AI was hit, for example. The below function is the main one:

Quote

scriptEvent float trace(vector start, vector end, vector mins, vector maxs, float contents_mask, entity passEntity);

Returns the fraction of movement completed before the box from 'mins' to 'maxs' hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.

For making an AI run to a button to start an alarm when alerted, as far as I can tell there's currently no inbuilt support for this behaviour in TDM. The path_flee would only kick in if the AI is badly wounded or unarmed. It'd be worth opening a bugtracker entry for this.

  • Like 1
Link to post
Share on other sites

How do you hide a light entity based on distance, so that it doesn't render and eat up performance once the player is far enough? I tried "dist_check_period 1" with "hide_distance 100" but even from very far it still renders and is unaffected (even after dmap).

Also I only want the light source to turn off, not for the whole entity to be hidden meaning the light model itself would also disappear. It would be ideal if the light could fade between a min_dist and max_dist, only stop rendering once max_dist is reached... if the player can still see it relatively well they don't notice it snap on / off but rather gradually.

Link to post
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...