Free Thing Types?

Status
Not open for further replies.

Prisima

Member
What are the free Thing Type numbers specifically? The wiki doesn't list it, and I try to use one ones that I think aren't taken up, and it turns out that they are, such as: the Thing Type number 126 somehow manages to conjure up a recycler, which the wiki lists as being the Thing Type number 416!
 
Last edited:
https://wiki.srb2.org/wiki/List_of_Object_types

I think this will help you.
Type a random number using your browser search & find option and see if it's already taken in the map thing nums.
Hope that helped.
I get it now; that helped a lot. I was thinking that Thing types and Object types were the same. Thanks!

EDIT: Wait... how then is it possible to use actions that use a set object number and not an object name (like A_NapalmScatter) on custom objects? Does that mean you'd have to have the object have a name consisting of digits and not letters because that upper and lower 16 bit stuff? You can't preform arithmetic on a string like MT_PLAYER...
 
Last edited:
I get it now; that helped a lot. I was thinking that Thing types and Object types were the same. Thanks!

EDIT: Wait... how then is it possible to use actions that use a set object number and not an object name (like A_NapalmScatter) on custom objects? Does that mean you'd have to have the object have a name consisting of digits and not letters because that upper and lower 16 bit stuff? You can't preform arithmetic on a string like MT_PLAYER...

When you use an object/state/sound/etc. name in a SOC, the game ignores the properties of the name string itself, instead reading it as the object/state/sound/etc. number that it corresponds to and treating it like that number in all situations. From SRB2's perspective, "MT_PLAYER" is nothing more than another way to say "3", and 3 can have arithmetic performed on it just fine.
 
I think I need to be more specific about my issue: I am trying to use A_NapalmScatter to scatter a custom object with no fixed object number, and NapalmScatter needs an object number to work. I don't think his is possible except to assign the custom object a fixed object number, but I don't know how to do that.
 
You should be able to use the custom object's name, e.g. MT_CUSTOMOBJECT as the scatter object, no?

Using object numbers are pretty much a thing of the past now.
 
I think I need to be more specific about my issue: I am trying to use A_NapalmScatter to scatter a custom object with no fixed object number, and NapalmScatter needs an object number to work. I don't think his is possible except to assign the custom object a fixed object number, but I don't know how to do that.

Remember that basic arithmetic can be performed in SOC scripts in 2.1. For example, if you wanted to call A_NapalmScatter in order to lob 10 objects with type 155 (MT_MINE), you could write "VAR1 = (10 * FRACUNIT) + MT_MINE" directly in the script instead of manually calculating the value with 65536 plugged in for FRACUNIT and 155 for MT_MINE. As I mentioned before, SRB2 will treat a constant (like FRACUNIT or MT_MINE) as if it were the number it corresponds to (like 65536 or 155) in all cases, so you can use the constant however you want without needing to write or even know its value.
 
Don't use FRACUNIT as an "upper 16 bits" multiplier, though. Upper/lower bit ranges should always be applied as (upper << 16)|lower. Not upper*FRACUNIT, not upper<<FRACBITS. upper << 16. Otherwise you'd be in for trouble if we ever decide to change FRACBITS.

And yes, for object types you should always use the actual MT_ constant. It's perfectly possible to set a state's var1, or an object's reactiontime/deathstate/etc to MT_CRAWLA or S_PLAY_RUN1 or (statenum_t)ANG15 if the action using said variable calls for that type of constant.
 
Thanks everyone for the help, it works! (Though the state needed to be declared in Lua in order for it to work)
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top