Turning medkit and stimpack into inventory items.

Discuss all aspects related to modding Zandronum here.
Post Reply
Michael_M88
New User
Posts: 6
Joined: Fri May 31, 2013 9:32 pm
Location: Canada, British Columbia

Turning medkit and stimpack into inventory items.

#1

Post by Michael_M88 » Fri May 31, 2013 9:40 pm

So, I want to do a simple item edit. I want to change the medkits and stimpacks so that instead of instantly using them, you can hold them and stack them in the inventory and use them when needed. I think it's possible, I just can't figure it out. I use SLumpEd, XWE, and Zandronum if that helps. Sorry if this a stupid question, thanks in advance.

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Turning medkit and stimpack into inventory items.

#2

Post by Ænima » Fri May 31, 2013 10:22 pm

Armed Recruit does this.


Open it up and see how it's done.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Michael_M88
New User
Posts: 6
Joined: Fri May 31, 2013 9:32 pm
Location: Canada, British Columbia

RE: Turning medkit and stimpack into inventory items.

#3

Post by Michael_M88 » Fri May 31, 2013 11:15 pm

Still having a little trouble. Here's what I've got in my wad:

ACTOR Medikit2 : CustomInventory Replaces Medikit
{
Inventory.PickupMessage "Picked up a medikit."
States
{
Spawn:
STIM A 10
STIM A 1 bright
Loop
Pickup:
TNT1 A 0 A_GiveInventory ("Medikit2")
Stop
}
}

Zandronum crashes once I pick it up. I'm not that great with scripting, any one know of any solution?

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Turning medkit and stimpack into inventory items.

#4

Post by Ænima » Fri May 31, 2013 11:27 pm

Yeah it's crashing because you created an infinite loop there. Picking up Medikit2 gives you a Medikit2, which gives you a Medikit2, which gives you a Medikit2, etc etc etc.

Try this instead:

Code: Select all

ACTOR Medikit2 : CustomInventory Replaces Medikit
{
Inventory.PickupMessage "Picked up a medikit."
States
{
Spawn:
STIM A 10
STIM A 1 bright
Loop
Use:
TNT1 A 0 A_GiveInventory ("Health", 25)
Stop
}
}
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Michael_M88
New User
Posts: 6
Joined: Fri May 31, 2013 9:32 pm
Location: Canada, British Columbia

RE: Turning medkit and stimpack into inventory items.

#5

Post by Michael_M88 » Fri May 31, 2013 11:37 pm

Ok thank you for the help there, but when I pick up the medikit, I can't use it or find it in my inventory, if that makes any sense. Also, I can only pick up one.


And yea, I have set the controls in my game to use items and switch to them.
Last edited by Michael_M88 on Fri May 31, 2013 11:39 pm, edited 1 time in total.

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Turning medkit and stimpack into inventory items.

#6

Post by Ijon Tichy » Sat Jun 01, 2013 12:24 am

you need INVBAR, Inventory.Icon, and Inventory.MaxAmount

Code: Select all

ACTOR Medikit2 : CustomInventory Replaces Medikit
{
    Inventory.PickupMessage "Picked up a medikit."
    Inventory.MaxAmount 10
    Inventory.Icon "MEDIA0"
    +INVBAR

    States
    {
      Spawn:
        STIM A 10
        STIM A 1 bright
        loop

      Use:
        TNT1 A 0 A_GiveInventory ("Health", 25)
        stop
     }
}

Michael_M88
New User
Posts: 6
Joined: Fri May 31, 2013 9:32 pm
Location: Canada, British Columbia

RE: Turning medkit and stimpack into inventory items.

#7

Post by Michael_M88 » Sat Jun 01, 2013 12:33 am

Ha! It worked! Thank you guys so much for your help :)

Post Reply