Questions About Boss Battle & Credits Scripting

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!)
User avatar
NiTROACTiVE
Posts: 48
Joined: Sun Jan 13, 2019 12:02 am
Location: United States

Questions About Boss Battle & Credits Scripting

Post by NiTROACTiVE »

2/6/2019 Edit: I have now made this a thread where I will ask questions about scripting, as these are my first questions I asked about boss battle scripting:

I have some questions about scripting for a boss battle.

1. When it comes to activating a certain portion of a script when a boss reaches a certain amount of health, let's say some Imps spawn as the boss disappears for some time. This would happen after the boss' health hits around 5000 HP. How could I do that?

2. How could I spawn custom monsters into the map that have no spawn number that I got from somewhere like Realm667? I tried something like that before by typing the name of the monster into the type value of this script action, but it didn't work.

3. How could I make a boss invincible for a certain amount of time? I know something like this happened before in another Doom WAD I played.
Last edited by NiTROACTiVE on Thu Feb 07, 2019 7:52 pm, edited 2 times in total.
User avatar
Cherno
Posts: 1339
Joined: Tue Dec 06, 2016 11:25 am

Re: Questions About Boss Battle Scripting

Post by Cherno »

1. Add an ACS script to the map that is started at map start (ENTER) and then continually checks the boss' health. If it hits the threshold, make the boss disappear, spawn the imps and start a timer that runs until hitting a time threshold, and when it is reached, the boss reappears.

2. The wiki page tells you at the top if the page: Use SpawnSpot or Spawn.

3. Set his INVULNERABLE flag to true, use a timer in an ACS script. If you are able to zScript, you can also give him an item that does the same for any amount of time.
User avatar
NiTROACTiVE
Posts: 48
Joined: Sun Jan 13, 2019 12:02 am
Location: United States

Re: NiTROACTiVE's Scripting Questions

Post by NiTROACTiVE »

Thanks for the help there, Cherno.

Anyways, any tips and advice on making an HudMessage scroll from the bottom to the top of the screen like a credits screen? What example code could I use to make credits?
User avatar
TDRR
Posts: 836
Joined: Sun Mar 11, 2018 4:15 pm
Location: Venezuela

Re: NiTROACTiVE's Scripting Questions

Post by TDRR »

NiTROACTiVE wrote:Thanks for the help there, Cherno.

Anyways, any tips and advice on making an HudMessage scroll from the bottom to the top of the screen like a credits screen? What example code could I use to make credits?
Nothing short of adjusting the offsets via a FOR loop.

Code: Select all

for ( int ypos = 1; ypos < X; ypos++ )
{
HudMessage(insert all code here and use ypos as the y offset);
delay(1);
}
Read this page if you don't know much about these loops.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: NiTROACTiVE's Scripting Questions

Post by Blue Shadow »

NiTROACTiVE wrote:2/6/2019 Edit: I have now made this a thread where I will ask questions about scripting, [...]
If this is going to turn into a generic scripting questions topic, then no. It's best you create a new topic for each question or group of related questions.
User avatar
NiTROACTiVE
Posts: 48
Joined: Sun Jan 13, 2019 12:02 am
Location: United States

Re: NiTROACTiVE's Scripting Questions

Post by NiTROACTiVE »

TDRR wrote:
Nothing short of adjusting the offsets via a FOR loop.

...

Read this page if you don't know much about these loops.
I tried this code similar to what you gave me, but I got an identifier error for X saying it's not declared:

Code: Select all

script 7 open
{
	for (int ypos = 1; ypos < X; ypos++)
	{
		HudMessage(s:"Doom is awesome!"; HUDMSG_PLAIN, 0, 7, ypos, 1.0, 10.0);
		delay(1);
	}
}
What should I do to fix that issue?
Blue Shadow wrote:
NiTROACTiVE wrote:2/6/2019 Edit: I have now made this a thread where I will ask questions about scripting, [...]
If this is going to turn into a generic scripting questions topic, then no. It's best you create a new topic for each question or group of related questions.
To be honest, I decided to do something like that since I didn't want to clutter the forums with multiple topics asking different scripting questions. But I'll keep this in mind for next time since you suggested this to me. ;)

Return to “Scripting”