spawnid above 255?

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
Enjay
 
 
Posts: 27015
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

spawnid above 255?

Post by Enjay »

I've been looking in some mods and, as far as I can tell, everyone tries to give spwnids no greater than 255 to things defined in DECORATE. Now, I know, or rather assume, that the 255 limit makes sense for any spawning that needs to be done via line types or by giving things a special, but would numbers > 255 be acceptable when I know that certain items are only ever going to be manipulated via spawnid using scripts or is this a limit?
User avatar
The Unmaker
Posts: 139
Joined: Sun Mar 30, 2008 3:15 am
Location: Pete's World :D

Re: spawnid above 255?

Post by The Unmaker »

You probably caN, AND IF YOU WANTED TO ACTIVATE VIA LINES YOU CAN have a script with two arguments the tag, and the hibyte.

sry bout the caps :(
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Re: spawnid above 255?

Post by TheDarkArchon »

Enjay wrote:I've been looking in some mods and, as far as I can tell, everyone tries to give spwnids no greater than 255 to things defined in DECORATE. Now, I know, or rather assume, that the 255 limit makes sense for any spawning that needs to be done via line types or by giving things a special, but would numbers > 255 be acceptable when I know that certain items are only ever going to be manipulated via spawnid using scripts or is this a limit?
[wiki=Spawn numbers]The wiki says[/wiki] that 255 is the limit
Gez
 
 
Posts: 17945
Joined: Fri Jul 06, 2007 3:22 pm

Re: spawnid above 255?

Post by Gez »

And the wiki is correct. Even internally, the spawnid is represented by a byte.

Code: Select all

struct FActorInfo
{

<snip>
	PClass *Class;
	FState *OwnedStates;
	FActorInfo *Replacement;
	FActorInfo *Replacee;
	int NumOwnedStates;
	BYTE GameFilter;
	BYTE SpawnID;
	SWORD DoomEdNum;
	...<snip>
}
And of course the parser makes sure that it's a byte whose value is between 1 and 255.

Code: Select all

static void ActorSpawnID (FScanner &sc, AActor *defaults, Baggage &bag)
{
	sc.MustGetNumber();
	if (sc.Number<0 || sc.Number>255)
	{
		sc.ScriptError ("SpawnID must be in the range [0,255]");
	}
	else bag.Info->SpawnID=(BYTE)sc.Number;
}
While this could be changed in UDMF, the SpawnID is a bit a deprecated way of doing things, ACS and DECORATE offering more possibilities.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: spawnid above 255?

Post by Graf Zahl »

... and that's the reason why it hasn't been changed yet. Since there are functions that take actor names directly there's little point beyond keeping them for compatibility.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: spawnid above 255?

Post by Zippy »

So, short version: Stop using spawn IDs and use the [wiki=SpawnSpot]other[/wiki] [wiki=SpawnSpotFacing]functions[/wiki] [wiki=SpawnProjectile]instead[/wiki].
User avatar
Slasher
Posts: 1160
Joined: Sun Mar 16, 2008 11:17 pm
Location: California

Re: spawnid above 255?

Post by Slasher »

So SpawnIDs are deprecated, basically?
Gez
 
 
Posts: 17945
Joined: Fri Jul 06, 2007 3:22 pm

Re: spawnid above 255?

Post by Gez »

Slasher wrote:So SpawnIDs are deprecated, basically?
Yeah. The only place where they're useful is for things like the Hexen breakable objects, so you don't have to make a script or a custom decorate object that can create various stuff when broken. It's a quite limited field.

Outside of their possible use in DiH mapthings args, what can you do with them that you can't do in a simpler and better way?

Plus, they're confusing. There's the ThingNum and the SpawnID, and of course they're not the same. And they're crossover incompatible (you can't spawn a Hexen thing in a Doom map using them).

So, they're impractical, limited, and confusing; and kept only for compatibility purpose. Seems to fit the description of a deprecated thing...
User avatar
Enjay
 
 
Posts: 27015
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: spawnid above 255?

Post by Enjay »

I was only using them because the Stronghold scripts depend on them for their various spawning routines. I was trying to figure my way through the Stronghold scripts and the best way for me to try and learn how they were working was to add some stuff of my own. I thought it would be nice and neat to add my own series of spawnids with numbers clearly outwith the range being used elsewhere.
User avatar
Slasher
Posts: 1160
Joined: Sun Mar 16, 2008 11:17 pm
Location: California

Re: spawnid above 255?

Post by Slasher »

Gez wrote:stuff about spawnids...
Fine with me, I've never used them anyway. I only mentioned it because it seems like a perfect candidate to be marked deprecated on the wiki.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: spawnid above 255?

Post by HotWax »

Slasher wrote:I only mentioned it because it seems like a perfect candidate to be marked deprecated on the wiki.
My only concern is this... If we deprecate spawnid, doesn't that mean we also have to deprecate every function that makes use of them as well? ([wiki]Thing_Spawn[/wiki], [wiki]ThingCount[/wiki], etc.)
User avatar
Enjay
 
 
Posts: 27015
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: spawnid above 255?

Post by Enjay »

And those functions are still in very common use.

Thing_Count is an unusual one because it uses spawnids, but doesn't have to (ie it can use tids instead).

Is there any other function that does the spawnid-based job of Thing_Count without having to set tids etc? ie can anything else count all the items on a level by type? Or, indeed, by tid for that matter?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: spawnid above 255?

Post by HotWax »

Well there's [wiki]ThingCountName[/wiki], which can count by TID and/or type name...
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: spawnid above 255?

Post by Zippy »

All SpawnID based functions have a classname equivalent. Gez is really correct in saying that the only place SpawnIDs have a real use left with is Hexen style breakable objects. The fact people are still using the almost completely deprecated SpawnID functions is a testament to the fact that we haven't been spreading the information on the classname functions and promoting proper usage thereof as well as we should be. In my mind it is even more of an incentive to mark SpawnIDs and functions as deprecated to encourage people to use the new ones. They shouldn't be using the old ones anymore.
User avatar
Slasher
Posts: 1160
Joined: Sun Mar 16, 2008 11:17 pm
Location: California

Re: spawnid above 255?

Post by Slasher »

I agree with Zippy. Because we have functions that use classnames and such, the ones that use spawnids aren't necessary, and could be marked deprecated.
Locked

Return to “Editing (Archive)”