Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
milo

Scripting question

Recommended Posts

Ok, I've muddled my way through working with DB and have become decently proficient with it. Not to say I can produce superb detail, but I can make the map do what I want (for the most part).

I'm working on my second level, and it was almost done before I found out about ACS and the possibilities it presents. So now I'm going back through it and spicing things up a bit.

I make use of custom monsters. My question: how can I spawn a custom monster? From my (admittedly limited) understanding of the Thing_Spawn command, it only lets me spawn items by spawn number. Since I'm using custom monsters, they don't have a spawn number (do they?). Is there a way I can spawn a thing by type number instead of by its spawn number?

Any help is appreciated. Thanks.


---


Also, DB won't compile a script I was experimenting with using the Thing_Raise command. It says that the function was "used but not defined". I included zcommon.acs... doesn't that contain all the script definitions?

Share this post


Link to post

To spawn custom monsters there are 2 options:

1. Use the Spawnspot command which uses names instead of IDs.
2. Give your custom monsters a spawn ID with the command 'SpawnID number'.

To compile your script you have to update ACC. The version that comes with Doombuilder is a little old and not up to date. It is missing a few functions and updates. Get latest version from ZDoom.org and overwrite the old files in your Doombuilder directory.

Share this post


Link to post

Thanks for your help. I got the latest version of ACC and experimented with the custom spawn ID. Both work like charm.

While I no longer get a complier error with Thing_Raise, it still doesn't work. The implementation is simply Thing_Raise(tid), isn't it? That's what I'm doing, and the corpse just sits there.

Share this post


Link to post

Was your corpse a living monster that was killed? If not, it can't be resurrected. Corpses that are placed on the map lack the necessary code to act as a monster.

Share this post


Link to post

Actually, I fixed the problem. It was in another area of the script. I have a little script testing map that I currently have set up to spawn random monsters, and I was changing the Thing's TID at the wrong time (before the Thing_Raise command). Thanks for your help though!

Share this post


Link to post

Hmm, ok, I've got another question now. I want to use the HudMessage command to print the name and health of a given monster. It displays the correct health value, but prints the player name instead of the monster name. Here's the bit of script in question (at this point I've got a baron tagged 10 running around):


while ((GetActorProperty (10, APROP_Health)) > 0)
	{
		int health11 = GetActorProperty (10, APROP_Health);
		HudMessage(s:"the ", n:10, s:" has ", d:health11, s:" health remaining"; 
			HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.9, 1.0);
		delay(1);		
	}


It prints "the milo has 1000 health remaining", and properly subtracts health when I shoot the baron. What am I doing wrong?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×