Armor "swap"

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Armor "swap"

Postby camaxide » Fri Oct 20, 2017 5:21 pm

So I have an armor that grants 100% damage reduction, and gives 150 armor points (BasicArmorPickup)
the problem is that I want the item to get picked up and overwrite a blue-armor. (or any time where the player has 150 or more armor.
The armor will in these cases not get picked up, since the current armorpoints are higher than the new one.
I can force it with a alwayspickup flag, but then it's picked up, but still not applied..

How can I do this? Is the only way to add a script that is ran when the player picks it up that first removes a players armor, then adds the item? hopefully it's possible within the actor-code to make it work :)
User avatar
camaxide
 
Joined: 11 Jun 2015

Re: Armor "swap"

Postby Blue Shadow » Fri Oct 20, 2017 11:27 pm

camaxide wrote:How can I do this? Is the only way to add a script that is ran when the player picks it up that first removes a players armor, then adds the item? hopefully it's possible within the actor-code to make it work :)

That's what I would do. And, no, you don't need ACS. You can achieve it all in DECORATE, by using CustomInventory.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests