User:Digiku/2.2/New tutorial features

From SRB2 Wiki
Jump to navigation Jump to search

Monitor Pop - Run Linedef Exec

  1. Set MTF_EXTRA on the monitor thing
  2. Set thing Angle to Tag + 16384

Linedef Exec Effect 457: Track Object Angle

Track mobj/player's angle to a focal Thing. If the player faces away from the Thing by N degrees, it executes a linedef executor.

  1. Place focal Thing 758 MT_ANGLEMAN in a target sector
  2. Place line effect with Tag set to the target sector, so it can search for the focal Thing.
  • Front X Offset - Angle tolerance, i.e., mobj needs to face more than this many degrees away from tracer to fail
  • Front Y Offset - Tic tolerance, i.e., how many tics to allow lookaway before executing linedef?
  • Back X Offset - Tag to execute upon lookaway
  • ML_EFFECT2 - Continue checking after first lookaway (default: disable checking after the first lookaway)
  • Tag - Target sector to look for Thing 758 MT_ANGLEMAN

Linedef Exec Effect 458: Stop Tracking Object Angle

Stops all checking behavior set by Line Exec 457.

Linedef Exec Effect 459: Control Text Prompt

  • Front X Offset: Prompt number
  • Front Y Offset: Page number, 0 means to start from beginning
  • Block Monsters: Close the current prompt
  • Effect1: Trigger Linedef Exec specified by Back X Offset when prompt is closed
  • NoClimb: Display prompt for all players (default: only triggering player)
  • Effect2: Do not block controls (default: block controls)
  • Effect3: Don't freeze player's realtime level timer (default: freeze the timer)
  • Transfer Line: Search for prompt by named tag; ignore X/Y offsets
    • Front Texture: Tag name to search for, case-insensitive.
      • If tutorialmode, the following control modes will be appended to this name automatically: FPS, Platform, Custom

SOC Spec

Prompt

  • NumPages - Number of pages specified. This must be set for the game to recognize the pages.

Page

Page Metadata

  • Name - Narrator name. Takes up one line of the text prompt. For spaces, use underscore, e.g., Sonic_Team_Junior.
  • Icon - Lump name of narrator icon. Scaled and centered appropriately.
  • IconAlign - Display narrator icon on Left or Right
  • IconFlip - Flip icon horizontally, True or False
  • Lines - Number of lines to display, default 4.
  • TextSpeed - Tic delay between letters, default TICRATE/5.
  • BackColor - Background color, from below. Default Gray. If -1 or INT32_MAX, set to console bgcolor.
    • White, Gray, Brown, Red, Orange, Yellow, Green, Blue, Purple, Magenta, Aqua
  • HideHud - Hide HUD elements, 0 = Show all, 1 = Hide HUD elements that would be covered by prompt, 2 = Hide all. Default 1.

Page Pics

Supports up to 8 pics (doomstat.h #define MAX_PROMPT_PICS). Similar to Cutscenes.

  • PicsMetaPage - Special value to copy the specified page's pics. Any subsequent config line overwrites the copied value for the current page.
  • NumberOfPics - Number of pics specified. This must be set.
  • PicMode - Sequence mode after reaching the last pic, 0 = Persist last pic, 1 = Loop to an earlier pic, 2 = Hide all pics. Default 0
  • PicToStart - Pic to start the sequence when entering the page
  • PicToLoop - Pic to loop back to, if PicMode = 1. Default 1 (one-based).
  • Pic#Name
  • Pic#Hires
  • Pic#Duration
  • Pic#XCoord
  • Pic#YCoord

Page-specific

  • MetaPage - Special value to copy the specified page's metadata (above parameters). Any subsequent config line overwrites the copied value for the current page. Does not copy pics and does not copy any of the below parameters.
  • Tag - Named tag for reference. Used by Line 459 to search for prompts by named tag.
  • NextPrompt - Jump to the specified prompt. If ommitted, stays on the current prompt.
  • NextPage - Jump to the specified page. If ommitted, goes to the next page ID up to NumPages.
  • TimeToNext - Number of tics before jumping to the next page. If ommitted, user toggles the next page by button press.
  • PageText - Text to display. Word-wrapped on runtime. Line breaks are displayed as written.
    • MUST TERMINATE WITH A # ON NEWLINE, LIKE IN CUTSCENES!
    • MUST BE LAST PARAMETER IN THE PAGE SOC!

Unimplemented

  • Align - Horizontal alignment of text: Left, Right, Center
  • VerticalAlign - Vertical alignment of text: Top, Bottom, Middle
  • TextSfx - SFX to play on each letter print, e.g., sfx_menu1. Default none.

Sample SOC

# Area 1 pre-text
PROMPT 1
NumPages 3
PAGE 1
Name = Narrator_One
Icon = ONENARRA
IconAlign = Left
Lines = 4
PageText = Welcome to the SRB2 Tutorial!\ba To access the menu,\b4 hit the \82escape key\80.\baTo continue,\b4 press \82\c(Jump)\80.
        #
PAGE 2
Name = Narrator_Two
Icon = TWONARRA
IconAlign = Right
Lines = 4
PageText = To move around, press the movement keys:\ba \82\c(Move)\80
        #
PAGE 3
MetaPage = 1
PageText = Use the movement keys to reach the exit.
        #

# Area 1 HUD prompt
PROMPT 2
NumPages 3
PAGE 1
Name = Movement
Icon = STARORB
Lines = 3
TextSpeed = TICRATE/5
TimeToNext = TICRATE*3
PageText = Use \82\c(Move)\80 to move.
        #
PAGE 2
MetaPage = 1
TimeToNext = TICRATE*4
PageText = Automatic braking is on by default,\b4 which causes you to slow down quickly
        #
PAGE 3
MetaPage = 1
NextPage = 1
TimeToNext = TICRATE*3
PageText = when you release the controls.
        #

Caveats

  • PageText hash string terminating is @<math>#&^</math>%^& broken because of dehacked.c myhashfgets, which is used by cutscenes (SceneText). The function originally returned a string that included the terminating # char plus one extra char after that. I fixed this issue; the fix shouldn't break cutscenes. However, malformed files (like if you forget to terminate with #) still cause errors and unparsed lines, so check log.txt and make sure every line is being processed.
    • Make sure there is no whitespace after terminating # char
    • Make sure there is no whitespace (leading tabs) in the line after the terminating #
  • Text prompts are not yet net-safe, as of 2.2!!!