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

How do I take weapons away

Recommended Posts

Hey I'm new to Doom modding. I was wondering how do i take away the characters weaponry. I'm using zdoom ACS. so i've tried;
#include "zcommon.acs"
Script 1 enter
{
clearinventory ();
healthing (100);
takeinventory ("pistol", 1);
}

Share this post


Link to post

You can use a Death Exit to start the player fresh in the next level by teleporting him into some barrels and a John Romero head. That's the easiest way at least.

Share this post


Link to post

In ZDoom, the easiest and cleanest way is to use "ResetHealth" and "ResetInventory" in the map's definition in MAPINFO. This will just enforce a classic "pistol start".

If you want to take away the player's Pistol (and maybe the Fist) too, either make a custom player class who doesn't have the Pistol (and Fist) as a start item (and give them to him via a script later), or use TakeInventory in an ENTER script as you already do.

If you do NOT want to enforce a classic "pistol start" with complete inventory reset to defaults and health reset to 100%, but you want to merely take the player's weapons away, then just take them one by one via TakeInventory.

Share this post


Link to post

Script 1 (void)
{
ClearActorInventory(0);
}


0 is by default the player's TID, unless you changed it in a script or map. You can call that script with ACS_Execute to use at will, or replace "void" with "enter" for each level start to activate it. You'll have no weapons, no fist, nothin'.

Share this post


Link to post

I think valtiel was trying to remove player's weapons, but keep his pistol, and his ClearInventory actually worked, the main problem was that he used TakeInventory instead of GiveInventory for the pistol.

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
×