Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Cyberdemon531

Is there a way to make it so you can't attack in a map?

Recommended Posts

You can use DeHackEd/BEX to modify specific weapons into invisible dummy weapons, or you can use ACS in ZDoom to remove the pistol and fists, or you can use DECORATE in ZDoom to redefine the Doom player class to not have any weapons (I think). And of course, other engines probably have their own way of adding/modifying the starting weapons.

Share this post


Link to post

Er, you mean in a hub? In that case you're better off going with the ACS approach. Declare some global variables to store what weapons the player has, and in the area where you don't want the player to have any guns, set the aforementioned variable to store the current weapons and remove them via TakeInventory(). Then when you return to an area where guns are "allowed", read the global variable storing your weapons, and use the GiveInventory() function to give the player their weapons back. You might have to adjust ammo values too, because giving weapons will also give a bit ammo. There might be other, simpler methods of doing this, but I don't know of any.

Share this post


Link to post

Not sure how OPEN scripts work in a hub environment. You should consult the ZDoom Wiki. I think OPEN scripts are only executed once upon initial map loading, so you might have to use an ENTER script, as returning to a previous level might not trigger the OPEN script again.

Share this post


Link to post

The way you would go about doing this is as follows:

1. Say you're starting on Map01, you would create an OPEN script.
2. In the OPEN script you would insert the Take Inventory instruction, which would tell the game to remove whichever weapons & ammo you wished to take away from the player.
3. In Map02 you would either place the weapons/ammo where you wanted the player to pick them up, or you can give the player some or all of the weapons back via a Give Inventory script.

There are various applications for this type of system, such as the following scenario:

1. The player is entering a high-security area that prohibits the carrying or weapons/ammo.
2. The player needs to surrender/deposit her/his weapons/ammo at the check-point, and proceed.
3. After completion of specified tasks, the player is given back her/his weapons/ammo.

Another example is when a player is captured, her/his weapons & ammo taken away, escapes, and recovers weapons/ammo.

Share this post


Link to post

I believe they are the same as any weapon, as far as ZDoom is concerned. TakeInventory("Fists", 1) should take them away like any other weapon, except having no weapons at all means none are drawn, and attacking does nothing (except the possibility of alerting monster?).

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
Sign in to follow this  
×