Turning Models into Things

Status
Not open for further replies.

Sparkz

Advanced FOFing Concepts
O.k. lets say ya have a 3D model (not sure what the file extension is on them yet, MD2 perhaps?) Please correct me if I'm wrong. How would one go about importing the model into the game, converting it or what-have-you and making available as a scenery thing? I'm in the dark on this one and I don't even know if the questions came out right. I think the Robotnik statues are examples of this. (I could be wrong)
 
Well, first, you'll need an accompanying sprite for it to replace. If you're too lazy to make an actual sprite and just want to test it out quickly, you can make a completely transparent one as a placeholder (all cyan). You'll be replacing the freeslot entries; I forget if those already have cyan placeholders, but they very well may.

From there, you'll need to SOC a new state that uses that sprite frame, and then a new object that uses that state.

Next, you need to do whatever it was that was necessary to replace a sprite in the game with the MD2 in question (I'm fuzziest on this step, having never done it).

Finally, you place the new object into a test map and verify that it worked.

I'm guessing it's something like that. I've made a few decorative objects via SOC this way, but they used sprites, not models, so I couldn't help you with that part.
 
Last edited:
I'm surprised at how much of that I actually understand:D Since a lot of this is applicable to standard scenery things let me get a few more details about that. I'm cool makin' sprites but what would this new state SOC look like? I'm not well versed in SOC editing. I got through the first tutorial and turned a Crawla in an angry little jumping ball but that's about it.
 
You'd be editing the freeslots in pretty much all cases. It doesn't have to do much, really; probably model it after the GFZ bush object, unless you need it to have collision, in which case something like the gargoyles (sans MF_PUSHABLE) would be better. The SOC editor has the functionality to copy an existing state into another, so just copy whichever object you're basing it on into the first available freeslot.
 
NEAT!

O.K. This might be tad off topic but not much, and I din't want to make a new thread SO... Lets say I have sprites or animation cells... (the individual images that define everything something appears to do) In this case, an enemy. (my first custom enemy so forgive my ignorance) I'm currently learning to write the SOC to control it and I have a few prototype pictures for it. I have these pictures loaded into my wad Between S_START and S_END. (which I'm sure is right but I could be wrong) How do I make use of the free slots? I've looked through the Wiki. The Wiki shows how to move pre- existing images into free slots. (but mine are new and not part of the game yet) I've torn apart other mods and configs but I'm missing the part where a series of "animation cells" are assigned to slots and made available for the engine to use:/
 
Last edited:
If I understood you correctly, you want to move sprites into a freeslot, right?

The name of the lump defines the slot that the sprite is in. To put a sprite in the first freeslot, give it the prefix "F001". So the front view of the first animation set of your custom enemy would be called "F001A1". The back view of the first animation set would be called "F001A5". The front view of the second animation set would be called "F001B1" etc. For the second freeslot, you use "F002" instead of "F001" etc.
 
Yes, you understand me. But I'm not totally clear on this. Now when you say "lump" are you referring to an individual image or a collection of them between markers? Furthermore, I renamed my images as you suggested and even gave the whole thing a free mapthingnumber, but there's another identifier if I'm not mistaking; a thingnumber? I don't have a clue as to what this is or how to use it. When I tested my map I was greeted by a green Sonic that just stood there. He killed me when I walked into him. Needless to a motionless green Sonic was not what I had in mind. I feel as though I'm getting closer. However, I don't know if these bugs are in the SOC I wrote or if I didn't label something properly. The Wiki could use some Finer detail on custom enemies.
 
Now when you say "lump" are you referring to an individual image or a collection of them between markers?
A lump is an entry in a WAD file. Each image is its own separate lump with its own lump name.

Furthermore, I renamed my images as you suggested and even gave the whole thing a free mapthingnumber, but there's another identifier if I'm not mistaking; a thingnumber? I don't have a clue as to what this is or how to use it.
There is no attribute called "thingnumber". Let's start from scratch:

The enemy you're making is an Object (SOCEdit labels it a "Thing", but SOCEdit is wrong). The first and foremost attribute of an Object is its Object number (or ID or whathaveyou), which is the Object slot you're putting it in. For example, slot #1 contains MT_BLUECRAWLA, the Object for the blue Crawla. Slot #318 is the first freeslot. Presumably you're putting your custom enemy there, or in a different freeslot. The MapThingNum is the number that is used when you put your Object on your map as a Thing. A Thing is any Object that is placed directly on a map. It's a different number from the Object number. Some Objects don't even have a MapThingNum because they're not supposed to be placed directly on maps. Your enemy obviously needs one, so give it any Thing number that isn't in use, e.g. 122.

The sprites are the images that your enemy display. The terminology on this isn't really clear, but let's call the whole set of images that you made for your enemy a "sprite". This sprite is divided into frames, which are "still images" of sorts. The enemy cycles through these frames to create an animation. Each frame consists of up to eight "rotation" images, so that the sprite can be displayed from eight different angles. Now the lump names are as follows: "Fxxxyz". "xxx" is the number of the freeslot that the sprite should be in. For the first freeslot, choose "001". "y" is the frame, the first being "A", the second "B" and so forth. "z" is the rotation number. 1 is front, 3 is facing left, 5 is back, 7 is facing right and everything else is diagonal in-between. More on this can be found in the Character WAD Tutorial, where you probably didn't look (and one can hardly blame you).

To set which part of the sprite is displayed at what point, you need to reference them in the Object's states. States are essentially the "animation frames" of the Object. They define what the Object does and what frame it uses in a given moment of its animation cycle. (This is a bit tricky because I'm using the word "frame" both in relation to sprites and to states. It's not the same, I hope you understand what I mean.) For starters, it will suffice to make the enemy spawn and stand still the whole time. To do that, make a new state (use the next available freeslot for states). Set the sprite to "243 - SPR_F001 (Free slot)", the frame to 0 (this makes it display "F001Az"), tics to whatever you want except "0" and "-1" (for now the duration of the state is irrelevant because it loops back to itself), and make "next state" loop back to itself. Leave everything else empty. In the Object menu ("Edit Things" in SOCEdit), set the "SpawnState" to the new state you just created. Now your enemy should spawn and display its sprite properly. Of course it isn't animated yet.

The Wiki could use some Finer detail on custom enemies.
The wiki's documentation on all SOC stuff is very incomplete and incoherent. This topic is much more complex than mapping due to all the terminology involved and because SOC is simply a godawful mess to begin with.
 
Well this is definitely helpful! I'm almost there.

This is what my SOC looks like;

FRAME 1792
SPRITENUMBER = 243
SPRITESUBNUMBER = 0
DURATION = -1

Thing 318
MAPTHINGNUM = 122
SPAWNSTATE = 1792
FLAGS = 0

... and this is what shows up on the map.
IBxzy.png


It's taken on the right shape but my enemy is invisible and it would seem (judging from where I placed the thing) that the shadow is either cast in the wrong direction or my enemy is upside-down. I've tried to stabilize it but every time I tweak something either my enemy disappears entirely or it turns into an invisible, shadow- casting, pushable object.
 
Set the sprite to "243 - SPR_F001 (Free slot)", the frame to 0 (this makes it display "F001Az"), tics to whatever you want except "0" and "-1" (for now the duration of the state is irrelevant because it loops back to itself), and make "next state" loop back to itself.

FRAME 1792
SPRITENUMBER = 243
SPRITESUBNUMBER = 0
DURATION = -1

"Tics" = "DURATION". Don't set it to "-1". Also, you forgot to make it loop back to itself, so add "NEXT = 1792". Your enemy also needs flags. Look at the flags that the blue Crawla has and use the same ones.
 
Status
Not open for further replies.

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

Back
Top