
Health regeneration question?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Health regeneration question?
I'm kind of new to DECORATE, and i'd like to know how to make the players health regenerate 1 hitpoint per 5 seconds. Thank you to anyone who can help. 

- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Health regeneration question?
Code: Select all
#include "zcommon.acs"
script 666 OPEN
{
HealThing(1)
delay(35*5)
restart;
)
Re: Health regeneration question?
It's not working for me. 

Re: Health regeneration question?
Probably because it requires more effort than looking at the code.
What are you doing? Why is it not working? If you can't give us any more information than "It's not working" how are any of us supposed to help diagnose the problem?
What are you doing? Why is it not working? If you can't give us any more information than "It's not working" how are any of us supposed to help diagnose the problem?
Re: Health regeneration question?
Well, I tried putting it in the decorate lump which was stupid, but I tried it anyway. Then I looked up ACS on the wiki, and it basically told me to put the code in a BEHAVIOR or SCRIPTS lump. So I tried that... still nothing. What should I name the lump file that i'm putting this code into?
Re: Health regeneration question?
Okay, you don't know ACS either, that makes this much harder.
I'm gonna assume you've got maps to go with your code; assuming your map is Doom In Hexen or UDMF and you're using Doom Builder 2, press f10 when you're mapping to bring up the script viewer. Here's what you want to do.
Then click the "compile" button and save your map. Now when you run the map, the player will automatically recover one unit of health every five seconds.
As an aside, you have just made your first script.
I'm gonna assume you've got maps to go with your code; assuming your map is Doom In Hexen or UDMF and you're using Doom Builder 2, press f10 when you're mapping to bring up the script viewer. Here's what you want to do.
Code: Select all
#include zcommon.acs
script 100 ENTER
{
healthing(1);
delay(35*5);
restart;
}
As an aside, you have just made your first script.
- Zhs2
- Posts: 1300
- Joined: Fri Nov 07, 2008 3:29 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Maryland, USA, but probably also in someone's mod somewhere
- Contact:
Re: Health regeneration question?
Of course it wasn't working. LOLOLOLOLOLOL OPEN SCRIPT It's supposed to be an ENTER script instead D=VenusBot wrote:It's not working for me.XutaWoo wrote:Well, it's actually ACS, but DECORATE isn't the best for regenerating health.Code: Select all
#include "zcommon.acs" script 666 OPEN { HealThing(1) delay(35*5) restart; )
Also, if you want to compile a script straight up, just drag n' drop your .acs file with your script in it (which should look much like Ceeb's) on your ACC, put it in between A_START and A_END markers in a new wad, create a new lump in the wad called LOADACS and put the name of your script file in it, and then save your wad and run. Voila!
Alternatively, if you like pk3s (like I do,) create a root folder, create an acs folder in that root folder, put the compiled script file into the acs folder, create a LOADACS.txt in the root folder and put the name of your script lump in there, save, zip the root folder, and run with ZDoom. Enjoy!
Re: Health regeneration question?
I attatched an image of the current test wad i'm working on. In LOADACS it simply says "myscript". It's still not working...Of course it wasn't working. LOLOLOLOLOLOL OPEN SCRIPT It's supposed to be an ENTER script instead D=
Also, if you want to compile a script straight up, just drag n' drop your .acs file with your script in it (which should look much like Ceeb's) on your ACC, put it in between A_START and A_END markers in a new wad, create a new lump in the wad called LOADACS and put the name of your script file in it, and then save your wad and run. Voila!
Alternatively, if you like pk3s (like I do,) create a root folder, create an acs folder in that root folder, put the compiled script file into the acs folder, create a LOADACS.txt in the root folder and put the name of your script lump in there, save, zip the root folder, and run with ZDoom. Enjoy!

- Attachments
-
- meh.png (12.35 KiB) Viewed 1843 times
- Zhs2
- Posts: 1300
- Joined: Fri Nov 07, 2008 3:29 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Maryland, USA, but probably also in someone's mod somewhere
- Contact:
Re: Health regeneration question?
That script is not compiled. You must compile it first with ACC! Move the script file out of your wad, drag and drop on ACC, and if it doesn't report any errors, a script file "MYSCRIPT.o" will be generated. This is what goes in between A_START and A_END.
Re: Health regeneration question?
Thank you guys!
I finally got it working. 


- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Health regeneration question?
Derp.Zhs2 wrote:Of course it wasn't working. LOLOLOLOLOLOL OPEN SCRIPT It's supposed to be an ENTER script instead D=

To be fair, I do that all the time when I think I put ENTER.

Re: Health regeneration question?
You don't ever need to create a root folder.Zhs2 wrote:Alternatively, if you like pk3s (like I do,) create a root folder

- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: Health regeneration question?
Just so you know, Slumped makes life easier because you can just right click the scripts file and hit compile and it'll do it instantly. I recommend it, not only because it wees all over XWE, but because editing scripts over and over is a pain if you do it like that.
http://remilia.zdoom.org/wiki/Slumped
http://remilia.zdoom.org/wiki/Slumped
Re: Health regeneration question?
XWE does have a few handy features that Slumped does not have, but I'd recommend using Slumped for most tasks and only using XWE when needed, because it's a pain to use. Both are prone to bouts of crashing, but XWE tends to corrupt your data when it crashes, while Slumped doesn't, so you only lose your session's work rather than everything.
- Zhs2
- Posts: 1300
- Joined: Fri Nov 07, 2008 3:29 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Maryland, USA, but probably also in someone's mod somewhere
- Contact:
Re: Health regeneration question?
I've never used SLumpEd to contribute to any of my modding projects. XWE I used for a few wad projects, but I am stuck on batch compiling scripts and using manual editors for life.
Hey, it's a simpler representation of your project as a whole! It's easier to drag places than some 50 odd text files and folders. I suppose accidentally throwing it into your zip would be a problem, though.Gez wrote:You don't ever need to create a root folder.Zhs2 wrote:Alternatively, if you like pk3s (like I do,) create a root folder