Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Dravencour

How to disable weapons for a map?

Question

Yep. It's me again. So a few years ago, I asked about how to make actors for dialogue sections essential so that the player couldn't kill them.

 

Then I realized that I was going about things the wrong way. Usually in games that have both dialogue sections and combat sections, the player's weapons get disabled for dialogue sections, and re-enabled for the combat sections. I plan to have a number of maps where the game disables your weapons for the purpose of talking with NPCs, buying items and getting missions, and other maps where the main combat goes down.

 

I want to know how one would be able to pull something like this off in GZDOOM.

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 0

You can give the player a new weapon (call it "NoWeapon" or something like that) and force player to switch to it using SetWeapon then make it so the deselect states lead back to "Ready"

 

For example:

 

ACTOR NoWeapon : Fist
{
  States
  {
  Deselect:
    PUNG A 1 A_WeaponReady
    Goto Ready
  }
}

 

Then you can take it away from them and switch back to Pistol or some other weapon on map change.

Share this post


Link to post
  • 0

I realize this is not quite the same as disabling a weapon, but you can "protect" the NPC from the player's attack in several ways:

 

1. Have the NPC behind, say, bullet-proof glass.

2. Have the NPC behind a "portal" through which attacks have no effect. Alternatively, have the NPC only appear via a mirror [these are essentially the same as Item 1, above.]

3. Use PROP_TOTALLYFROZEN to prevent the player from making any attacks while interacting with the NPC.

4. Use a non-shootable actor for the NPC (for GZDooM, you can use a model), so that even if the player attempts to attack the NPC there is no consequence to the gameplay. [Of course, this detracts from the realism of an interaction with an NPC.]

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×