Transparency of Objects

Status
Not open for further replies.

TheDoctor

Member
I am making this one map pack, and I use the torch object alot (with new sprites ofc), and the transparency is sorta bothering me for this specific map pack. I know it can be done through SOCs, but the only way I know how to SOC is through the outdated 2.0 socedit tool :p. So, how could I change the transparency of an object?
 
SOC is basically still the same, you just use a text editor. In fact, you could ALWAYS use a text editor. The only need for an editor was back when everything was referred to as numbers, and no one can remember that. Now that everything is actually referred to by a name, you can use a text editor without losing your sanity.

See this article for more details. https://wiki.srb2.org/wiki/SOC

(btw the editor was for 1.09.4, so it's even more outdated than you said it is)
 
Yeah, don't bother with SOCEdit for 2.1, it's so badly out-of-date now it's not even worth using it anymore.

Also, I believe the correct term is "translucency", rather than "transparency". Too easy to get those mixed up though I guess.
 
I tried looking at the wiki pages earlier today and yesterday, but I always end up with some freaky outcome. While attempting to make the SOC, I somehow made the torch have the null sprite flash into a cannon and back to null, with console being flooded with the line: "R_ProjectSprite: Invalid sprite frame 3/1 for CBLL". Which is weird, since I put nothing in the SOC that relates to the cannonball. A similar experience happened when I tried to make Eggmobile shoot super turrets, but ended up blowing up, flying away while spawning those turtle enemies and the spring enemies...who shoot super turrets and are intangible. Basically, even with the wiki I have no idea what's going on, which is strange seeing as to how I can understand several 'languages', like pokemon scripts or Lua (though I can't create Lua).
 
Show us your SOC; we can't really help out this specific of a problem without looking at the code.
 
Very well.

FRAME S_FLAME1
SPRITENUMBER = 101
SPRITESUBNUMBER = 32768
DURATION = 3
NEXT = S_FLAME2
ACTION None
VAR1 = 0
VAR2 = 0

FRAME S_FLAME2
SPRITENUMBER = 101
SPRITESUBNUMBER = 32769
DURATION = 3
NEXT = S_FLAME3
ACTION None
VAR1 = 0
VAR2 = 0

FRAME S_FLAME3
SPRITENUMBER = 101
SPRITESUBNUMBER = 32770
DURATION = 3
NEXT = S_FLAME4
ACTION None
VAR1 = 0
VAR2 = 0

FRAME S_FLAME4
SPRITENUMBER = 101
SPRITESUBNUMBER = 32771
DURATION = 3
NEXT = S_FLAME1
ACTION None
VAR1 = 0
VAR2 = 0

As I said, I am 100% sure it is something I am doing wrong, especially with the numbers, but I just don't understand it well enough to know what to do. But the numbers do have some impact on the SOC, since for some reason it effects the Cannonball and an unknown sprite, overriding the flame sprites.
 
You're using the old 2.0/1.09.4 format. That's probably why you're confused.

FRAME is now called STATE. SPRITENUMBER is now SPRITENAME, and it goes by **** instead of numbers. SPRITESUBNUMBER is now SPRITEFRAME, and you specify the frame (ex: if you wanted PLAYA1 for the front, then put A there), and flags for translucency are added via bitwise OR symbol (|).

For example, say I wanted a state that is a transparent Sonic. I'd write this down...

Code:
State S_BLOOBLUH
SpriteName = PLAY
SpriteFrame = TR_TRANS40|A

If you need more info, look here: https://wiki.srb2.org/wiki/State
 
Deckard Cain said:
I thank you, friend, for coming to my aid.

Thanks, got it to work, and it helped me better understand socks. It turns out you wear them under your shoes, not on them.

Thanks again.
 
Might as well ask another SOC related question here. since my new knowledge of SOCing, I decided to work on some zombie enemies for my Diablo 2 map pack (...yeah, I know...) and so I managed to make a ccrawla that requires two hits to die, and when it does it leaves behind a corpse. So far, I had accomplished this. Hooray.

My question is; How can I make a sound be played upon the death of this crawla/zombie, or play a sound when it's corpse is spawn?

so far, this is the SOC that I've made:

OBJECT MT_BLUECRAWLA
MAPTHINGNUM = 100
SPAWNSTATE = S_POSS_STND
SPAWNHEALTH = 2
SEESTATE = S_POSS_STND
REACTIONTIME = 32
PAINSTATE = S_POSS_STND
PAINCHANCE = 200
PAINSOUND = six _ free 01
DEATHSTATE = S_SKIN
DEATHSOUND = sfx_fre001

The sound that I wish to be played, is the sound in the soc. Sfx_fre001/ DSFRE001.
 
(Not really required, but could you type your SOC's fields as proper nouns? As in, instead of "DEATHSOUND" put "DeathSound"? Again, not really a requirement, but it makes it easier to read.)

Just so you know, if you want to make a modification to an object, you can just put what you want to change and only the values you put in will modify.

To add a new sound you should add a Sound block. Here for more info: https://wiki.srb2.org/wiki/Sound

Once adding your sound block, the DeathSound is only played when A_Scream is called. Add a new state that calls this for your object.
 
(I thought SOCs needed uppercase stuff, but I just tried it and the result says otherwise, so, yeah. I thought that was necessary at the time.)

It worked, thanks again, you've been much help.

(Kinda funny giving a snowman a death sound, with an action of A_Scream. A screaming snowman. Screaming out of pain until it dies...)
 
Status
Not open for further replies.

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

Back
Top