Custom Object tutorial/Sounds and sprites (2024)

Table of Contents
Sounds Sprites
Custom Object tutorial[view]

Chapter 1: Basic knowledgeChapter 2: File structureChapter 3: Syntax issues and conventionsChapter 4: Creating an enemyChapter 5: Sounds and spritesChapter 6: Advanced techniques

Of course you can implement custom sounds and sprites that your Objects make use of, too. This article only shows how to implement these into a SOC, not how to make them. Read the Sprite and Custom character tutorial/Sprites articles for learning how to put sprites inside a WAD or PK3 file, and the sound and music tutorial for custom sounds.

Sounds

Sounds must always have a lump name of DSXXXXXX, where XXXXXX can be chosen freely. The sound name as used in the SOC is then sfx_XXXXXX. Like with Objects and states, new sounds have to be declared in the freeslot block if you want to use them in your SOC, like this:

Freeslotsfx_exampl

Sounds also have their own parameter block, which can be used to set some playback options. This block is rarely necessary because the default settings are usually sufficient, but it looks like this:

Sound sfx_examplPriority = 0Singular = 0Flags = 0
  • Sound sfx_exampl: The first line is the header that indicates we are about to modify the settings of the sound sfx_exampl.
Note
An Object cannot play the same sound twice at the same time. For example, if an Object is playing sfx_alarm and then attempts to play the same sound again without letting the previous playback finish, the sound is interrupted and then restarted.
  • Priority: This decides which sounds to play when all sound channels are in use. Sounds with a higher priority value are favored over sounds with a lower priority value.
  • Singular: If this is set to 1, the sound can be played only once at a time on any sound channel, no matter which Object started the sound. If an attempt is made to play this sound while another instance of it is still playing, the one already playing will be interrupted and then restarted.
  • Flags: These flags are used for special playback settings. To set several flags at once, perform the bitwise OR operation (|) on them. For example, to set the flags SF_NOMULTIPLESOUND, SF_OUTSIDESOUND and SF_X4AWAYSOUND, write FLAGS = SF_NOMULTIPLESOUND|SF_OUTSIDESOUND|SF_X4AWAYSOUND in the sound's SOC block. The functions of the flags are as follows:
DecimalHexadecimalFlag nameDescription
10x01SF_TOTALLYSINGLE(unused)
20x02SF_NOMULTIPLESOUNDThe sound can only be played once at a time on any sound channel, no matter which Object started the sound. Attempting to play the sound more than once at the same time has no effect and the one already playing is not interrupted. This overrides the Singular parameter.
40x04SF_OUTSIDESOUNDThe volume of the sound depends on how close the player is to an "outside area" (any sector with F_SKY1 as its ceiling flat). The closer the player is, the louder the volume. This is used by the rain sound, for example.
80x08SF_X4AWAYSOUNDThe sound can be heard from four times the regular distance.*
160x10SF_X8AWAYSOUNDThe sound can be heard from eight times the regular distance.*
320x20SF_NOINTERRUPTThe sound does not interrupt other sounds; if it is attempted to be played in a situation where it would be interrupting another sound, it is not played. This does not work in combination with the Singular parameter, use the SF_NOMULTIPLESOUND flag instead.
640x40SF_X2AWAYSOUNDThe sound can be heard from two times the regular distance.*

* You can combine the flags SF_X2AWAYSOUND, SF_X4AWAYSOUND and SF_X8AWAYSOUND to further increase the hearing distance. For example, combining all three flags makes the distance increase equal to 2 × 4 × 8 = 64.

Sprites

Sprites must always have a lump name like XXXXYZ, where XXXX is the sprite set name, Y is the frame and Z is the rotation. The sprites themselves are created similarly to those of a custom character, and the same abridged system can be used for symmetrical sprites. Like with Objects and states, new sprites have to be declared in the freeslot block if you want to use them in your SOC, like this:

FreeslotSPR_EXMP

You can then reference the sprite set with SpriteName = EXMP in a state block. Additionally, certain flags can be added to the SpriteFrame parameter that control the sprite's translucency and brightness settings. As usual, combine these flags with the bitwise OR operator (|), e.g. FF_FULLBRIGHT|TR_TRANS10|A.

  • FF_FULLBRIGHT: full brightness, the sprite is not affected by lighting
  • TR_TRANS10: 10% translucent (90% opaque)
  • TR_TRANS20: 20% translucent (80% opaque)
  • TR_TRANS30: 30% translucent (70% opaque)
  • TR_TRANS40: 40% translucent (60% opaque)
  • TR_TRANS50: 50% translucent (50% opaque)
  • TR_TRANS60: 60% translucent (40% opaque)
  • TR_TRANS70: 70% translucent (30% opaque)
  • TR_TRANS80: 80% translucent (20% opaque)
  • TR_TRANS90: 90% translucent (10% opaque)

It is important that you keep in mind that the number of states you need does not only depend on the number of actions you want to use but also the number of frames you are going to use. Take the Crawlas for example. All they do is constantly execute A_Chase. According to this information you might think you could only use one state that keeps looping to represent their aggressive behavior. In fact, they are using six states. This is because their chains keep rolling so that they appear to be some kind of tank. This animation needs six frames and therefore six states.

The actions A_ChangeColorRelative and A_ChangeColorAbsolute are capable of shifting the colors of a sprite according to their number inside the SRB2 palette.

Custom Object tutorial[view]

Chapter 1: Basic knowledgeChapter 2: File structureChapter 3: Syntax issues and conventionsChapter 4: Creating an enemyChapter 5: Sounds and spritesChapter 6: Advanced techniques

Retrieved from ""

Custom Object tutorial/Sounds and sprites (2024)
Top Articles
Funeral for Johnny and Matthew Gaudreau scheduled for church Monday in suburban Philadelphia | CBC Sports
All Obituaries | Lynch-Green Funeral Home | St. Marys PA funeral home and cremation
Exclusive: Baby Alien Fan Bus Leaked - Get the Inside Scoop! - Nick Lachey
Pangphip Application
9192464227
Die Windows GDI+ (Teil 1)
My Boyfriend Has No Money And I Pay For Everything
Puretalkusa.com/Amac
Calamity Hallowed Ore
King Fields Mortuary
Carter Joseph Hopf
Where's The Nearest Wendy's
Rapv Springfield Ma
Robert Malone é o inventor da vacina mRNA e está certo sobre vacinação de crianças #boato
Identogo Brunswick Ga
Worcester On Craigslist
Los Angeles Craigs List
Gon Deer Forum
Uc Santa Cruz Events
Cinebarre Drink Menu
Roll Out Gutter Extensions Lowe's
VERHUURD: Barentszstraat 12 in 'S-Gravenhage 2518 XG: Woonhuis.
480-467-2273
Tinyzonehd
Tim Steele Taylorsville Nc
Shaman's Path Puzzle
Hypixel Skyblock Dyes
Plato's Closet Mansfield Ohio
Tamilrockers Movies 2023 Download
Daily Journal Obituary Kankakee
Help with your flower delivery - Don's Florist & Gift Inc.
Skyrim:Elder Knowledge - The Unofficial Elder Scrolls Pages (UESP)
Delaware judge sets Twitter, Elon Musk trial for October
Cox Outage in Bentonville, Arkansas
Devotion Showtimes Near The Grand 16 - Pier Park
2700 Yen To Usd
MSD Animal Health Hub: Nobivac® Rabies Q & A
The Angel Next Door Spoils Me Rotten Gogoanime
Trivago Sf
4k Movie, Streaming, Blu-Ray Disc, and Home Theater Product Reviews & News
Fatal Accident In Nashville Tn Today
Reli Stocktwits
Conan Exiles Colored Crystal
Race Deepwoken
Legs Gifs
CPM Homework Help
Jeep Forum Cj
A Snowy Day In Oakland Showtimes Near Maya Pittsburg Cinemas
Hsi Delphi Forum
Runelite Ground Markers
Access One Ummc
Law Students
Latest Posts
Article information

Author: Prof. Nancy Dach

Last Updated:

Views: 6176

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Prof. Nancy Dach

Birthday: 1993-08-23

Address: 569 Waelchi Ports, South Blainebury, LA 11589

Phone: +9958996486049

Job: Sales Manager

Hobby: Web surfing, Scuba diving, Mountaineering, Writing, Sailing, Dance, Blacksmithing

Introduction: My name is Prof. Nancy Dach, I am a lively, joyous, courageous, lovely, tender, charming, open person who loves writing and wants to share my knowledge and understanding with you.