Custom Enemy Guide

[Open Assets] Custom Enemy Guide

What permissions do you give others to modify and/or maintain your submission?
Modify: YES - Maintain: YES - I give permission for my entire submission to be modified by others or used in their own work. I give permission for my entire submission to be maintained by others as well.
So, You wanna make a custom enemy like the cool srb2 mappers?
well youre in luck because this guide will help you (you will be shocked by how simple making a custom enemy is)

-- SOC --

well since this is an object there are 2 ways of going about it but for the sake of this tutorial we will be using soc, which is short for Sonic Object Configuration start by making a freeslot for the object like this:
Sonic Object Configuration (SOC):
Freeslot
MT_CUSTOMENEMY #MT_CUSTOMENEMY tells the game that you want to use one of the freeslots for an object!
Now for the main enemy Definition:
Enemy definition:
Object MT_CUSTOMENEMY
MapThingNum = 948 #if you want a custom object to work in a map editor you must make sure its not using a thing number used by a vannilia srb2 object
SpawnState = S_POSS_STND #this is a state more about them later for now think of this as the idle animation except for enemies
SpawnHealth = 1 #use this to set how much hits an enemy takes till it dies
SeeState = S_POSS_RUN2 #this is the State the object uses when it sees the player
SeeSound = sfx_None # not needed by most objects
ReactionTime = 32
AttackSound = sfx_None #also not needed
PainState = S_NULL
PainChance = 200
PainSound = sfx_None
MeleeState = S_NULL
MissileState = S_NULL
DeathState = S_XPLD1
XDeathState = S_NULL
DeathSound = sfx_pop
Speed = 3 # the speed of which the enemy moves
Radius = 4*FRACUNIT #the area of the hitbox the enemy has
Height = 8*FRACUNIT #the height of the hitbox
DispOffset = 0
Mass = 100
Damage = 0
ActiveSound = sfx_None
Flags = MF_ENEMY|MF_SPECIAL|MF_SHOOTABLE # if you are making a custom enemy make SURE these EXACT flags are used you can use other ones just make sure these ones are also in this varable
RaiseState = S_NULL

you know how i was talking about states well here they are:
STATE DEFINTION:
State S_POSS_STND
SpriteName = PNTY #the name of the sprite The way this is formated is that the sprite would be PNTYA1 - PNTYA8
SpriteFrame = A #the frame put at the end of a sprite name
Duration = 5 # how many tics the state last for
Next = S_POSS_STND #the next state after this one
Action = A_Look #the action the object does in this state
Var1 = 0 #these varablies are used for some actions to learn about actions check out https://wiki.srb2.org/wiki/Category:Actions
Var2 = 0
Dont forget to freeslot the states you make like this
Freesloting States:
Freeslot
MT_CUSTOMENEMY
S_POSS_STND

-- Sprites now in order for your object to look like something that isnt a excalimation mark in a diamond you will need to make sprites i wont get too into detail but what you want to do is make your sprites use the name of the spritename combined with the SpriteFrame from the states you defined in order for them to pop up

and with that said that's all for the tutorial, no seriously its that simple! have fun using some more fun objects :D
Author
thesrb2fan12
Views
578
First release
Last update
Rating
4.00 star(s) 1 ratings

More resources from thesrb2fan12

Share this resource

Latest reviews

It’s a helpful guide, explains the basics of not just enemy making, but objects as well. I can’t wait for all of the new crawla types I am going to make!
Upvote 0
Back
Top