Nedding SOCcing tuturial

Status
Not open for further replies.
Well I was thinking on madeing a enemy SOC (basically substitute enemys sprites by characters sprites make them shot rings and use chars ablitys) but I dont know nothing about SOCcing or anything needed for it! With Wiki I got confused... You can call me N00b if you want but if you dont explain nothing dont post please! And please dont post saying things like ''Go read the Wiki!'' I need a tuturial like the one of how to make SRB2 maps in Doom Builder (wanna see it? google it). If you helped or tryed to help thanks!

PS: I used search function before create the topic to try find a tuturial.
PS2: Im portuguese so my english ins't perfect!
 
Actually, the Wiki's SOC tutorial was lost when SRB2.org asploded, it's a real pain in the ass, and I'm too lazy to rewrite it.

However, I was able to find a post in which I'd posted an incomplete version.

Draykon said:
I've been working on a SOC tutorial, but it kinda sucks because it's written by me. I'll go ahead an post what I have, but don't take it as the perfect resource.

SOC - Sonic Object Configuration, SRB2's basic scripting engine thingy. SOCs greatly extend SRB2's editing capabilities. While most WADs will mostly just replace graphics and levels, SOCs serve to create complex features. Everything from enhanced enemies to totally altered gameplay. Plus a ton of stuff in-between. If you're reading this, chances are you're interested in creating one of these bits of wonderous footwear. Well, I, Draykon Vokelda, random SOCcer dude have created a tutorial chock full of information, and bad puns.


From the Beginning
Before you understand SOC, you must understand the game itself. SOCs, while still fairly limited, deal with aspects of the game on a slightly lower level than other forms of editing. So, I can't think of any better way to explain the basics of SRB2's object structure than by defining various key terms.

Timer SOC -- When you first boot up SOCEdit, you're bound to see the "configure global game settings" button, and go all "WHEE THIS IS EEEEEZZZZZ!" editing various tiny unimportant variables, and calling it a final SOC. Unfortunately, it's not that easy. Simply changing the global games settings isn't enough to call something a final piece of work. These kinds of SOCs are generally called "Timer SOCs" and they are REALLY bad. Don't even bother making them, they won't help you learn AT ALL.

Thing -- The basic objects of SRB2. Ever notice how some stuff ingame looks different than others? Yeah, if you pick it apart you'll realise that a chunk of the game is actually 2D! All those little 2D bits are called "things." They're far more versitle than the 3D objects, despite being kinda funny looking. Things will grow to be your best friends, as very few SOCs exclude at least one edit to things.
- Things have various parameters, such as speed, health, painchance, reactiontime, etc. While many of these are obvious, they often serve purposes you wouldn't guess from their names. Exactly what each parameter does varies depending on our next definition, flags.

Flags -- A property applied to each thing. Every type of thing has a set of flags. Flags determine a few basic properties of objects. This is generally really important stuff, and can vary in it's scope. While MF_NOGRAVITY simply makes a thing fly, MF_BOSS completely changes the way the thing is handled. Most things have between 3 and 5 flags set.

States -- Another important term. At any given point, every thing is in one of many states. States determine several important factors about things. Including their current appearance, and what they're doing, as well as which state they're going to next, and how long before changing to that state. One interesting benefit of SRB2's funky Paper Mario sprite system is the ability to completely change appearance on-the-fly using states, as opposed to in like Soul Calibur where you have to wait like, 5 minutes before it loads a character model.

Actions/State Functions -- Actions are REAL important. Each state comes with an action, whatever the state's action is what the object in that state is doing at that time. All actions are preceeded with the A_ prefix (A_CapeChase, A_SkullAttack) and use a naming scheme that won't always make sense at first.
- Many actions have parameters, called Vars. There are two slots (creatively named var1 and var2) but using bit shifting, many actions have up to four. Bit shifting is headache inducing, so I'll explain that later. The vars dictate little things about the actions (Such as a reference to what object to launch, or a little flag to control minor behavioral tweaks)

Ok, there's all the really important terminology out of the way, so let's get to work on some REAL SOCcing.

Knowing what to SOC
Wait, wait, I'm going too fast. First step in SOCcing, is an idea. Many of mine come to me in my dreams... of course, only the really crazy multiplayer mods and giant dragon bosses. The stuff I can ACTUALLY SOC comes to me in the shower. But the thought of a naked Draykon may not be appealing to you, so just find some place in which you're serene and at peace, before coming up with an idea. For the purpose of this tutorial, let's pretend you took a walk in your local ruined Mayan city, and decided you wanted to SOC a new enemy. One that flies, and shoots stuff, or something. Yes that's horribly overdone, so make sure not to share it with anyone. Many SOCs serve only the purpose of self-acheivement, you won't find you want to release everything you make.

Just make sure all your ideas would work, and are reasonable.

SOCEdit
SOCEdit is a very handy tool. It provides a graphical interface to SOCcing (Which is otherwise text-based) saving time in it's organization, and sanity in it's way of killing the tediusness.
Setting up SOCEdit is simple. Start by double clicking SRB2Src109.exe (or just SRB2SRC109, depending on your system settings.) This will extract the source code, and make a few folders magically appear. Now you're set, run SOCEdit (Packaged in with SRB2) and select the src folder in the box in the upper left. SOCEdit should now function without crashing. When you start a new project, if you're lazy (Like me) you can simply click "create a new blank SOC" to... create a new blank SOC. Once you have the SOC in your SRB2 folder, you can simply click it in the box in the lower-right (After navigating to the folder where it is, the SOC Creation thingy dosen't update the list) and you're set to use SOCEdit.

SOC Weaving
Is a pun I just came up with. Let's try and get it popular. :P
So, in the beginning, you're gonna wanna get into thing editing. This is made easy in SOCEdit, by simply clicking "Thing Editor" and...

HOLY FAJOOTI WHAT'S ALL THAT CRAP?!

Lotsa random parameters, most of which have unobvious uses (Hell, I still don't even know what alot of stuff does)

Okay, okay, maintain focus. We're wanting to create a new enemy here. But let's drop our goals a bit. (You'll find you do that alot) Besides, completely new enemies only do good to mapmakers who are generally interested, of whom there are few. So let's just replace the Blue Crawla with our new enemies. Let's focus on thing editing first, so...

Editing a Thing
Whee. So, navigate yourself to the Blue Crawla thing...

OH MY GARGLEFRAX WHERE IS IT?!

Behold! SRB2's completely messed up naming scheme! Blue Crawla is one of the first things, named MT_POSS. (Red Crawla is MT_SPOS, presumably "special whatever the hell POSS means") It's gonna take some experimenting to figure out what everything is, but that's what SOCcing is all about.

So, MT_POSS looks to have a few fairly straightforward parameters. Speed controls the speed of A_Chase (The Blue Crawla's main movement function) SpawnState is the first state the thing enters on spawn (In the Blue Crawla's case, a state in which is uses A_Look to look for nearby players, the seestate determining what state to enter once the player is located) The Health dictates that it needs to be in collision with the player for 1 tic in order to be slain. Note my wording, creating a thing with more than one hitpoint is a bit more complex than just setting this to two.

So anyways, what we're after right now is flags. Take note two we're using here:
-MF_NOGRAVITY -- Thing is unnaffected by gravity
-MF_FLOAT -- Thing can move freely in the air, creates for more realism for a flying enemy.
Check the box next to them both. So long as we're in "Editing a thing" and not "Editing a thing's flags" Go ahead and increase the speed value. A_Chase uses "little" speed values. Meaning 2 is a snail's pace, and 65536 is insanely fast. By default the Blue Crawla is at 3, so let's up it to 6. So, save this thing, by clicking "Save" and boot up SRB2.

First Test Run
SOCs and WADs are completely different. SRB2 dosen't care. Anything you can add a WAD with, you can run a SOC with. So just type "Addfile whateverstupidnameyougavethissoc.soc" in the console, and it's in. Head to GFZ as your character of choice (preferably NOT SA-Shadow, he has some SOC compatibility issues. I usually test as Sonic or Knuckles) and get ready.

Now, let's see. The crawlas don't seem too different, maybe if I randomly fall in this river--

OH MY DRACONIC VODKA THEY'RE FLYING!

Floating is nice and all, but it's not really realistic for a flying enemy. To this, we move on to our next important bit.

Editing States
So, close out the thing editor, and boot up the state editor...

SWEET MOTHER OF KODELVA MORE HORRIBLY NAMED STUFF!

Fear not, state's follow the same naming "scheme" as their thing counterparts. So, navigate to S_POSS_STAND1.
I'd like to take this opportunity to describe the standard in custom enemy behavior.
Spawnstate -- Loop a few states, calling A_Look.
Seestate -- Usually when the player is spotted, ATTACK!
Meleestate -- If it's not 0, this is what the object does when it touches the player, in case you want something weird there.
A few other states are used by various thinkers, experiment around, alot of states only take effect if they're set to something other than 0.

So, let's make a simple modification here. The Blue Crawla uses about 17 states for a perfectly smooth animation. I hate that.
So for our first change, navigate to state 61 (S_POSS_RUN10), and change the "next" value to 52 (S_POSS_RUN1) This cuts the state loop earlier, meaning you have to deal with less states. (Make sure to hit the "save" button after every change)
Now, to make the flying slightly more usefull, go through the first 9 POSS running frames, changing A_Chase, to A_JetChase. But, to add a bit more fun, let's change the last state in the new loop to A_SkullAttack, you'll get what that does when we test. (Again, save after every little change)

Second Test Run
So, SOC should be saved, now let's boot it up.
So, they fly around a bit, then...
FLYING CRAWLA! USE SKULL BASH ATTACK!
Yeah, nice and all, but it's not very effective. SkullAttack when used by objects other than the first boss stop just in front of the player. The attack's great for freaking people out, but as an attack on it's own, is kinda useless. So head back, and change A_SkullAttack into A_JetChase. And head back into the game.
Wow, now they're just floating there. This is because for horizontal speed, A_JetChase uses "big" speed variables. Go back into the thing editor, and change the speed to 65535, the equivelant of 1. With the lack of friction in the air, this should be an average speed. So, head back in one more time, and it should work.

Projectiles 'n stuff
In the realm of Sonic, a crazed kamekazi enemy might not be so effective an enemy. So, let's give this little guy the power to launch missiles. Head back into state editor, and set the last accessed action to A_FireShot. A_FireShot takes var1 as a reference to the projectile it uses. Set it to 4, a simple slow-moving rocket projectile.
Now, if we boot up the game as is, it should work fine, but let's play around a bit. Head back into thing editor, and change the missilestate to 75.

Third Test Run
So, boot up the game, etc. So, what'd that missilestate thing do? Absolutely nothing. Far as I can tell, missilestate does nothing. Alot of stuff in SRB2 is like that.
But what's this? These enemies are horribly cheap! It's gonna be very tough for a skilled player to navigate himself through a maze of missiles like that. So how do we fix it without eleventy billion states? I dunno. There are many mysteries of SOCs that some may have found, and others may have had no clue about.
TOO BE CONTINUED!

If you have any actual questions, feel free to ask.
 
Urmm... You won't have to rewrite it, Draykon. The old server has been found, and all the missing edits will be back within a week.
 
It was on the wiki, astar. It's just that 2 months of edits were lost when the wiki was put back up after being down, but the old server has them.
 
Me either, except for the Enemy Creation tutorial.

Though in the end, I have had more success just simply experimenting than I have reading tutorials. Not that I've created anything most people would want to use anyway, mostly scenery and enemies that use preexisting sprites. And out of all that, the only thing I'm actually using in a map is a coconut.
 
Status
Not open for further replies.

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

Back
Top