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

Anyone knows how to prevent weapon pick-ups in ZDoom?

Recommended Posts

Not sure but perhaps place a sprite at a spot (weapon pickup sprite, but don't mark it as a pickup in DECORATE) and when the player steps on the weapon (i.e. triggers a script by tripping on of the ACS_Execute lines sorrounding the sprite) and when the playa triggers the line and the "if" is set to 0 (event blocked)-don't pickup weapon, but once the specific if was set to 1 (by another script) pickup the weapon-remove sprite from map and give the weapon, display hudmessage like "Picked up Automag..."-I know it's lame but that may be a way around..

Share this post


Link to post

Hello, NMN.
The question of weapon pick-ups is solved af for now. But I'm loosing temper on trying to run this Weapon limitation script properly!!!!

FUCK FUCK FUCK!
Even LilWhiteMo cannot help me this easily. I tried his solution, but I simply cannot increase the variable... and blah, blah, blah.

Visit ZDoom forums to learn more.

Share this post


Link to post
ellmo said:

FUCK FUCK FUCK!
Even LilWhiteMo cannot help me this easily. I tried his solution, but I simply cannot increase the variable... and blah, blah, blah.


Set all the weapon pickups to have a special of 80. Then have a script that raises a variable for how many weapons you have. You need a check function to make sure the number of weapons you have now is not above the weapon limit (which will be another variable declared outside of the script). When you spawn the weapon drops, you will have to spawn them with a TID and use setthingspecial to give it a ACS_execute special.

str weaponnames[7] = { weapon names here };
int weapons_held, weaponmax;
str currentweapon;
script 100 (void) {
      weapons_held++;
      if(weapons_held > weaponmax){
             dropweapon(); 
      }
}

function void dropweapon(void) {
      if(checkweapon("Fist"){ terminate; }
      weapon_held --;
      checkweapon();
      // spawn currentweapon in some way
      removeinventory(currentweapon);
}

function void checkweapon(void) {
     for(int i = 0, i <= 8, i++){
         if(checkweapon(weaponname[i]){
              currentweapon = weaponname[i];
              terminate;
          }
      }
}


Something like that maybe. I didn't plan on writing it, but I did. It is just from my head and could be very wrong as it was done very quickly.

ah, I see. If you pick up a new weapon and go over the limit, it would drop your current weapon, unless auto weapon switching was on.

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  
×