Health item trouble

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Sergeant Hoppy
Posts: 42
Joined: Mon Jun 21, 2021 11:24 am

Health item trouble

Post by Sergeant Hoppy »

I've had a long break froom doom, and now it seems I have quite forgotten how to work with zscript it seems, I'm fiddling with a mod that simply replaces medikits with a bigmac burger, when I compile I get this message:
Line 1 in file "C:\Users\mukhtaar\AppData\Roaming\SLADE3\temp\DECORATE.acs" ...
C:\Users\mukhtaar\AppData\Roaming\SLADE3\temp\DECORATE.acs:1: Invalid declarator.
> class
> ^
DECORATE:

Code: Select all

class BigMac : BigMac replaces MediKit 2012
{
  Inventory.Amount 25
  Inventory.PickupMessage "$GOTBIGMAC" // "Yum, Big Mac."
  Health.LowMessage 25, "$GOTBIGMACNEED" // "Finaly, some food!"
  States
  {
  Spawn:
    BMAC A -1
    Stop
  }
}
Setup:
https://ibb.co/kXRn3V0
User avatar
Logan MTM
Posts: 678
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: Health item trouble

Post by Logan MTM »

Class?
Try Actor!
Good luck :wink:
Sergeant Hoppy
Posts: 42
Joined: Mon Jun 21, 2021 11:24 am

Re: Health item trouble

Post by Sergeant Hoppy »

Thank you, I'll need all the luck I can get!

Hm, I replaced class with actor and it complains about that.
User avatar
Enjay
 
 
Posts: 27290
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Health item trouble

Post by Enjay »

I've just noticed that it is a health item.
Try

Code: Select all

ACTOR BigMac : Health replaces MediKit 2012
You actor seems to be inheriting from itself.

[edit]Sorry, I had some spurious advice before the above that I accidentally deleted in an edit. I hope, however, that the above covers what you need. [/edit]
Sergeant Hoppy
Posts: 42
Joined: Mon Jun 21, 2021 11:24 am

Re: Health item trouble

Post by Sergeant Hoppy »

Oh yeah, thank you for reminding me! That fixed the issue!

Now, I just need to remember how to get the sprite to show correctly, as it is now it only shows as a missing image in the game.

I placed the sprite in a folder called sprites and named it BMACA.
Do you happen to be able to refresh my memory on how to get that going? =)
User avatar
Enjay
 
 
Posts: 27290
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Health item trouble

Post by Enjay »

It should be named BMACA0.

Remember to set its offsets using Slade or some other sprite-ofsetting tool (like BagheadSpidey's GrabPNG).
Sergeant Hoppy
Posts: 42
Joined: Mon Jun 21, 2021 11:24 am

Re: Health item trouble

Post by Sergeant Hoppy »

Ah yes! Thank you kindly for your patience, you are helping a lot and it's working as it should!
Post Reply

Return to “Scripting”