[Open Assets] SRB2PlusC

This content may be freely modified and/or maintained by anyone.
Status
Not open for further replies.
Version 1.2.1 Released
----------------------------------
Added: Lua - add texture offset usage to sectors

Bugfix: Fix titlemap music change bug reported by Larztard
Bugfix: Prevent game crash if you go to a titlemap and it doesn't exist

Other: titlemap no longer prints "SPEEDING OFF TO [ZONE] [ACT 1]..." on screen when loaded
 
Version 1.3.2 Released
----------------------------------
Updated to support Version 2.1.18
 
Version 1.3.3 Released
----------------------------------
Added: Lua - Title screen HUD hook (eg. hud.add(hudFunction, "title"))

Bugfix: Support negative scroll speeds on title screen without game crash

Other: added reset for titlemap and other title attribute changes
 
Something that may be neat for a future addition, is a "Lua Options" menu for easy access to console variables added by Lua scripts.

Probably would only be able to work with booleans and raw numbers, unless you could have a way to indicate that it is text entry, or allow the script to define a range of selections to be switched through.

Might want to skip over cheat variables, since there is often good reason to not have those visible out in the open.
 
Something that may be neat for a future addition, is a "Lua Options" menu for easy access to console variables added by Lua scripts.

Probably would only be able to work with booleans and raw numbers, unless you could have a way to indicate that it is text entry, or allow the script to define a range of selections to be switched through.

Might want to skip over cheat variables, since there is often good reason to not have those visible out in the open.

I would make an attempt if I knew how the menu structure worked at all
 
In a Lua script, how can I check if SRB2PlusC is being used over vanilla, so I could, say, enable certain features on it that require PlusC?
 
In a Lua script, how can I check if SRB2PlusC is being used over vanilla, so I could, say, enable certain features on it that require PlusC?

RPGBlast does this:
Code:
VERSIONSTRING:find("PlusC")
 
Last edited:
Version 1.03.4 Released
----------------------------------
Updated to support Version 2.1.19
 
Version 1.04.4 Released
----------------------------------
Added: Lua - "small_center" "thin_center" made available in v.drawString(...) aligning
Added: Lua - S_ChangeMusicFadeIn(name,looping,int ms) :: fade in background music

Added: Lua - S_FadeOutMusic(int ms) :: fade out background music
Added: Lua - S_MusicVolume(int volume) :: change background music volume (does not affect digmusicvolume)

Other: Added official documentation and change-log for features and additions in the original post
 
The mod crashes on startup, and yes I have the latest version.

W_GetNumForName: TRANSA0 not found!

I think a change that was made somewhere broke this mod.
 
Last edited:
I don't see a player_t argument in S_ChangeMusicFadeIn, S_FadeOutMusic, and S_MusicVolume. Do they affect all players? (Or it's a local thing)
 
I don't see a player_t argument in S_ChangeMusicFadeIn, S_FadeOutMusic, and S_MusicVolume. Do they affect all players? (Or it's a local thing)

They all work the same as default functions where player is the last argument, and player is moved to argument 4 in ChangeMusic
 
Using S_FadeOutMusic in a MIDI makes the fade music volume stay, even after restarting SRB2
Test script:
Code:
local timer = 0
addHook("MapLoad",do
    timer = 0
    S_ChangeMusic("MAPAAM",true)
end)
addHook("ThinkFrame", do
    if timer == 1*TICRATE
        S_FadeOutMusic(7000,player)
    end
    if timer == 6*TICRATE
        S_ChangeMusic("MAP01M",true)
    end
    timer = $1+1
end)
 

Attachments

  • musicfadetest.lua
    256 bytes · Views: 669
Using S_FadeOutMusic in a MIDI makes the fade music volume stay, even after restarting SRB2
Test script:
Code:
...

Sorry! I couldn't find an option or a way to alter midi in the mixer code. You may just have to use other formats.
 
If it answers your questions as to why that might be the case, apparently MIDI volume adjustment is borked in Windows 7, and IIRC we disabled changing the MIDI volume in SRB2 itself for now anyway.
 
There's something wrong with io; creating subfolders doesn't work at all and results in an error when closing the file. This works fine with SRB2+IO, however.

Code:
local write = io.open("testfolder/testfile.txt", "w")
io.output(write)
io.write("text goes here", "\n")
io.close(write)

The following results in
Code:
/KCGC.wad|LUA_MAIN:57: bad argument #1 to 'close' (FILE* expected, got nil)
 
Since it's come up multiple times, this mod is no longer being maintained or updated for new patches, so please do not ask about it.
 
Status
Not open for further replies.

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

Back
Top