Soc help: multi colored enemies

Status
Not open for further replies.

CoatRack

Official Community CoatRack
Sonic Team Junior
Ok, I am making some enemies that I want to vary in colors when they are placed in the level.

Example:
I place one of the enemies, it is red.
I place it again, this time it is blue.
I place it again, it is <insert>.
End Example:

I know that it has been done but I sorta don't know how but I think It has something to do with A_RandomState or something.

Any help?
 
For multiple-colored enemies, you can't use the same Thing. For example, you can't add in the same crawla in the same level, and expect them to have different colors. You would have to code that in yourself, as it is impossible to do so with SOC's.

The only option is to make a new Thing for every different color you want to add. You don't have to add loads of different sprites, just shade the original green. There's a command that can change the color of the sprite, so you can use that. I forgot the name of it, so look in the SRB2 Wiki for any A_Command that can change colors.



A way to explain how everything will be done is by having, for example, 3 new Things for Red, Blue, and Yellow. That will be on the SOC's Things window, where each Thing has different Frames. Red has S_FreeSlot1, Blue has S_Freeslot3, and Yellow has S_Freeslot5.

Now in the Frames window, Frame 1 will be the one with the A_Command, and will switch to Frame 2, where the enemy will act as you see fit. There is no need to go back to frame 1, since the sprite is already in a new color.

And finally, each frame should use a sprite that you either made or edited. That sprite needs to be in a green color, or else it won't work. If it's a brand new enemy, all three of them can use the same green sprite, and the SOC will change their colors to the one you chose.
 
Status
Not open for further replies.

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

Back
Top