I posted this topic about a year ago, and in light of all the new zdoom/acs features, I figured asking again was worth a shot.
Is there a way for a script to determine when the player hits the +USE key? I'm implementing a conversation system, and I think it'd be great if the player could simply face someone, press +USE, and a conversation dialog tree popped up.
One alternative is to keyconf a new puke bind, but I'd really prefer to have one general +USE key the player uses to talk/opendoors/bark/etc.
Currently, I am placing a "player use" SectorThing in every sector that contains a talking person. It works, but is far from ideal.
Any ideas?
activate script when player hits +USE key
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
The problem with the SectorThing solution is: I'd like for the player to be able to hit +USE to initiate and exit conversations.
Initiating the conversation is not a problem; it's just a simple check to see if the target character is in range & is currently visible. The player is frozen with APROP_FROZEN.
However, if the player had momentum while hitting the +USE key, they could easily "slide" into the neighboring sector (since aprop_frozen doesn't immediately lock the player in place), thus making the +USE key null again. The solution to this is to either make ridiculously large sectors, or, place the SectorThing into every neighboring sector, both fairly ugly solutions.
Initiating the conversation is not a problem; it's just a simple check to see if the target character is in range & is currently visible. The player is frozen with APROP_FROZEN.
However, if the player had momentum while hitting the +USE key, they could easily "slide" into the neighboring sector (since aprop_frozen doesn't immediately lock the player in place), thus making the +USE key null again. The solution to this is to either make ridiculously large sectors, or, place the SectorThing into every neighboring sector, both fairly ugly solutions.
You could spawn a camera at the player's location and move the player to a sector somewhere off the map with a sectorthing in it that will teleport him back. Since the player is frozen it doesn't matter that the camera can't turn. The weapon would vanish but since the player is talking to someone he would put away his gun anyway.