Its in your inventory bar and ready to be used, is it possible that when you use it you will see it be used in the hud like this for example?
Spoiler:
Spoiler:
Code: Select all
ACTOR healBluePotion : Health
{
Inventory.Amount 15
}
ACTOR blueHealingPotion : CustomInventory 13006
{
//$Category "INVitems"
//$Title Blue "Healing Potion"
+InvBar //this is important for items, that has to be in inventory bar
+Inventory.AlwaysPickup //this allows you to pickupup item, even you have one in your inventory
-Solid
+Shootable
+NoDamage
+NoBlood
+CanPass
+NoGravity
Tag "Blue Healing Potion"
height 24
radius 8
scale 0.5
Inventory.Amount 1
Inventory.MaxAmount 30
Inventory.InterHubAmount 30 //this allows you to carry the healing potions between maps
Inventory.PickupMessage "Found Blue Healing Potion!"
Inventory.Icon "I_MHP1"
Inventory.useSound "MWsounds/drink"
States
{
Spawn:
MHP1 ABC 4
Loop
Use:
TNT1 A 0 A_GiveInventory("healBluePotion", 1)
Stop
}
}
Code: Select all
//string array holding the texture names; array is better, because it allows to hold multiple options
str statsGenDispAnim[22] = { "MNANM01",
"MNANM02",
"MNANM03",
"MNANM04",
"MNANM05",
"MNANM06",
"MNANM07",
"MNANM08",
"MNANM09",
"MNANM10",
"MNANM11",
"MNANM12",
"MNANM13",
"MNANM14",
"MNANM15",
"MNANM16",
"MNANM17",
"MNANM18",
"MNANM19",
"MNANM20",
"MNANM21",
"MNANM22", };
script "statsGeneratorAnimation" (void)
{
for(int count; count < 22; count++) //'for' loop automatically counts up to defined value; it's useful for purposes, where you need to automatically reach some value
{
SetLineTexture(297, SIDE_FRONT, TEXTURE_BOTTOM, statsGenDispAnim[count]); //every loop assigns new texture name from the string, based on the 'count' variable; you can put here almost everything
Delay(8); //delay is neccesary; without delay, you won't see any animation, because the script counts up to defined value and then stops. So you need to put some delay here, to see the animation. Delay is in ticks, so it's pretty simple to definig animation length in animdefs.
}
}
Code: Select all
function void printSprite(str msgSprite, int msgID, int msgX, int msgY, int delayX)
{
SetFont(msgSprite);
HudMessage(s:"A"; HUDMSG_PLAIN, msgID, CR_UNTRANSLATED, msgX, msgY, delayX);
}
Code: Select all
function void eraseHudmsg(int msgID)
{
HudMessage(s:""; HUDMSG_PLAIN, msgID, CR_UNTRANSLATED, 0, 0, 0);
}
Code: Select all
str animationSprites[] = {"<spriteName>", "<spriteName>", "<spriteName>", ...};
script "animtedItem" (void)
{
for(int counter, counter < 5, counter++)
{
printSprite(animationSprites[counter], counter, <correct X offset>, <correct Y offset>, 4);
Delay(4);
}
}
Yes, I think A_GiveInventory("Heal") in Use-state of healing item should work. "Heal" being a weapon class with actual healing animation that starts in Ready-state and goes straight to Deselect. I think it should have A_TakeInventory in the last state, so the dummy weapon won't stay in player inventory. In case the user has disabled "Switch on pickup" option, you can use https://zdoom.org/wiki/A_SelectWeapon to make sure dummy weapon is selected. No need for ACS at all.Wilcocliw wrote:cant you make it like a fake or hidden weapon that is called by using it from your Inv Bar?