Unknown type # with ZScript custom monster

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
necros
Posts: 28
Joined: Mon Dec 30, 2019 10:26 pm
Contact:

Unknown type # with ZScript custom monster

Post by necros »

I have this custom monster in zscript yet I am unable to get it to show up in ultimate doom builder (minor annoyance) nor get it to spawn in zdoom.
I have a zscript.txt file in my mod folder that imports my monster script:

Code: Select all

#include "zscript/necros/cacodemonExt.zs"
I have my monster script in the exact folder as above:

Code: Select all

//===========================================================================
//
// Cacodemon
//
//===========================================================================
class CacodemonExt : Cacodemon
{
	Default
	{
	  //$Category CustomMonsters
	  //$Title "CacodemonExt"
		Health 400;
		Radius 31;
		Height 56;
		Mass 400;
		Speed 8;
		PainChance 128;
		Monster;
		+FLOAT +NOGRAVITY
		SeeSound "caco/sight";
		PainSound "caco/pain";
		DeathSound "caco/death";
		ActiveSound "caco/active";
		Obituary "$OB_CACO";
		HitObituary "$OB_CACOHIT";
		Tag "$FN_CACO";
	}
	States
	{
	Spawn:
		HEAD A 10 A_Look;
		Loop;
	See:
		HEAD A 3 CacodemonExtMove;
		Loop;
	Missile:
		HEAD B 5 A_FaceTarget;
		HEAD C 5 A_FaceTarget;
		HEAD D 5 BRIGHT A_HeadAttack;
		Goto See;
	Pain:
		HEAD E 3;
		HEAD E 3 A_Pain;
		HEAD F 6;
		Goto See;
	Death:
		HEAD G 8;
		HEAD H 8 A_Scream;
		HEAD I 8;
		HEAD J 8;
		HEAD K 8 A_NoBlocking;
		HEAD L -1 A_SetFloorClip;
		Stop;
	Raise:
		HEAD L 8 A_UnSetFloorClip;
		HEAD KJIHG 8;
		Goto See;
	}
}

//===========================================================================
//
// Code (must be attached to Actor)
//
//===========================================================================

extend class CacodemonExt
{
	void CacodemonExtMove()
	{
		//attenuate monster velocity over time when walking to remove momentum
		A_ScaleVelocity(0.95);
		A_Chase();
	}
}
I have this in my mapinfo:

Code: Select all

spawnnums
{
	32011 = cacodemonExt
}
This seems to work, since if I give an invalid classname, zdoom will stop with an error when loading

Yet in my map, I see this: "Unknown type 32011 at (x, y)"

What part am I missing?
User avatar
Enjay
 
 
Posts: 27639
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Unknown type # with ZScript custom monster

Post by Enjay »

Spawn numbers are for spawning items with certain (mostly old fashioned) ACS functions.

You want DoomEdNums instead.
necros
Posts: 28
Joined: Mon Dec 30, 2019 10:26 pm
Contact:

Re: Unknown type # with ZScript custom monster

Post by necros »

Enjay wrote:Spawn numbers are for spawning items with certain (mostly old fashioned) ACS functions.

You want DoomEdNums instead.
Oh man, how did I not notice the difference! Thank you!
Post Reply

Return to “Scripting”