Health regeneration question?

Archive of the old editing forum
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.
User avatar
VenusBot
Posts: 9
Joined: Sun Jan 10, 2010 3:37 pm

Health regeneration question?

Post by VenusBot »

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. :)
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Health regeneration question?

Post by XutaWoo »

Code: Select all

#include "zcommon.acs"

script 666 OPEN
{
  HealThing(1)
  delay(35*5)
  restart;
)
Well, it's actually ACS, but DECORATE isn't the best for regenerating health.
User avatar
VenusBot
Posts: 9
Joined: Sun Jan 10, 2010 3:37 pm

Re: Health regeneration question?

Post by VenusBot »

It's not working for me. :(
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Health regeneration question?

Post by Ceeb »

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?
User avatar
VenusBot
Posts: 9
Joined: Sun Jan 10, 2010 3:37 pm

Re: Health regeneration question?

Post by VenusBot »

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?
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Health regeneration question?

Post by Ceeb »

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.

Code: Select all

#include zcommon.acs

script 100 ENTER
{
healthing(1);
delay(35*5);
restart;
}
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.
User avatar
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?

Post by Zhs2 »

VenusBot wrote:
XutaWoo wrote:

Code: Select all

#include "zcommon.acs"

script 666 OPEN
{
  HealThing(1)
  delay(35*5)
  restart;
)
Well, it's actually ACS, but DECORATE isn't the best for regenerating health.
It's not working for me. :(
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!
User avatar
VenusBot
Posts: 9
Joined: Sun Jan 10, 2010 3:37 pm

Re: Health regeneration question?

Post by VenusBot »

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!
I attatched an image of the current test wad i'm working on. In LOADACS it simply says "myscript". It's still not working... :(
Attachments
meh.png
meh.png (12.35 KiB) Viewed 1843 times
User avatar
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?

Post by Zhs2 »

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.
User avatar
VenusBot
Posts: 9
Joined: Sun Jan 10, 2010 3:37 pm

Re: Health regeneration question?

Post by VenusBot »

Thank you guys! :) I finally got it working. :D
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Health regeneration question?

Post by XutaWoo »

Zhs2 wrote:Of course it wasn't working. LOLOLOLOLOLOL OPEN SCRIPT It's supposed to be an ENTER script instead D=
Derp. :(

To be fair, I do that all the time when I think I put ENTER. :p
Gez
 
 
Posts: 17941
Joined: Fri Jul 06, 2007 3:22 pm

Re: Health regeneration question?

Post by Gez »

Zhs2 wrote:Alternatively, if you like pk3s (like I do,) create a root folder
You don't ever need to create a root folder. :P
User avatar
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?

Post by Cutmanmike »

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
Gez
 
 
Posts: 17941
Joined: Fri Jul 06, 2007 3:22 pm

Re: Health regeneration question?

Post by Gez »

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.
User avatar
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?

Post by Zhs2 »

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.
Gez wrote:
Zhs2 wrote:Alternatively, if you like pk3s (like I do,) create a root folder
You don't ever need to create a root folder. :P
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.
Locked

Return to “Editing (Archive)”