The extra life monitor turns into 1000 points monitor, even though I checked the "special"/"ambush" flag. (SOLVED)

Aquavine

📀🌻Frutiger Aero enjoyer :3🌻📀
PSA: If you have the same problem as I do, then remember that for some reason the flags say / 10K score on the outside even though on the inside these flags actually change the extra life monitor into a 1K one instead. So in other words:

The extra life monitor turns into a 10K variant by default if no flags are applied.
And the flags force the monitor to turn into a 1K variant instead. So the flags should actually be named:

[Random (strong) / 1K points] and [Random (weak) / 1K points]




And here is the message that I sent before the problem got solved. And if someone reading this has an account on SRB2 wiki, then could you edit the pages for the monitors so the info above will be addressed. :C

I wanted a specific extra life monitor in my stage to turn into 10K score while in a record attack run. But no matter which flag I set, the monitor turns into a 1K point one instead of the 10K one. Which is extremely weird (and annoying) to me because the Srb2 wiki states in extra life, 1K and 10K monitor tabs that if the ["special"/"ambush" a.k.a Random (Weak) / 10K points/Random (Strong) / 10K points] flags are checked, then the extra life monitor is forced to turn into a 10K one every single time. But it doesn't work for me no matter which flags I check and in what combination.

Here's how the monitor options tab looks like:
1728571365921.png

And this is how it looks like in-game:
srb20110.gif

It's always the smallest problmes that can make me go absolutely insane. :sadthumbsup:
(If this doesn't get solved I won't be able to sleep at night...)

Here are the sources for the 10K flag info.
 
Last edited:
I wanted a specific extra life monitor in my stage to turn into 10K score while in a record attack run. But no matter which flag I set, the monitor turns into a 1K point one instead of the 10K one. Which is extremely weird (and annoying) to me because the Srb2 wiki states in extra life, 1K and 10K monitor tabs that if the ["special"/"ambush" a.k.a Random (Weak) / 10K points/Random (Strong) / 10K points] flags are checked, then the extra life monitor is forced to turn into a 10K one every single time. But it doesn't work for me no matter which flags I check and in what combination.

Here's how the monitor options tab looks like:
View attachment 144546
And this is how it looks like in-game:
View attachment 144547
It's always the smallest problmes that can make me go absolutely insane. :sadthumbsup:
(If this doesn't get solved I won't be able to sleep at night...)

Here are the sources for the 10K flag info.

Bad English upcoming :worry: (maybe)

The same happens to me, all I can do is to share with you a little script.

1UP to 10K in Record Attack:
// Little script to transform 1UP monitors to 10K score monitors cuz I
// don't trust SRB2 anymore.
// -----
// To make this work, add a header named "Lua.LifeToScore" to your map's info,
// then give that header the value "true", and done!
// -----
// After following the instructions above, any 1UP monitors placed will convert
// to 10,000 score monitors.
// -----
// If there is any problem with this, then tell me.



addHook("MobjThinker", function(mobj) // Run this hook if we found an object
    if mobj and mobj.valid // Check it exists
        if mapheaderinfo[gamemap].lifetoscore // If the custom header is true...
        and modeattacking == true // ...and we are playing Record Attack:
            mobj.type = MT_SCORE10K_BOX // Change object type
            mobj.state = mobjinfo[MT_SCORE10K_BOX].spawnstate // Change object state
        end
    end
end, MT_1UP_BOX) // Run this hook if we found a 1UP monitor

Hope it fixes the problem, and make sure to read the comments, they're marked with "//".
 

Attachments

  • 1UPto10K.lua
    350 bytes · Views: 20
Bad English upcoming :worry: (maybe)

The same happens to me, all I can do is to share with you a little script.

1UP to 10K in Record Attack:
// Little script to transform 1UP monitors to 10K score monitors cuz I
// don't trust SRB2 anymore.
// -----
// To make this work, add a header named "Lua.LifeToScore" to your map's info,
// then give that header the value "true", and done!
// -----
// After following the instructions above, any 1UP monitors placed will convert
// to 10,000 score monitors.
// -----
// If there is any problem with this, then tell me.



addHook("MobjThinker", function(mobj) // Run this hook if we found an object
    if mobj and mobj.valid // Check it exists
        if mapheaderinfo[gamemap].lifetoscore // If the custom header is true...
        and modeattacking == true // ...and we are playing Record Attack:
            mobj.type = MT_SCORE10K_BOX // Change object type
            mobj.state = mobjinfo[MT_SCORE10K_BOX].spawnstate // Change object state
        end
    end
end, MT_1UP_BOX) // Run this hook if we found a 1UP monitor

Hope it fixes the problem, and make sure to read the comments, they're marked with "//".
It would be great if you could actually set the variant with flags though. I don’t want the 10K monitors everywhere because they’re a really valueable in score emblems and I don’t want to make the reqiurements like 200000 points. :C Because I also want player to explore the stage, collect rings, fight enemies. And the 10K monitors would probably make these ways of gaining score obselete and would make finding these required to gaining the emblem instead of just being a small help if you lose your 300 rings you collected.

But still thanks for help. Even though I’ll probably continue to let the rng gods randomly choose between 1K and 10K monitors in record attack. :C
 
It would be great if you could actually set the variant with flags though. I don’t want the 10K monitors everywhere because they’re a really valueable in score emblems and I don’t want to make the reqiurements like 200000 points. :C Because I also want player to explore the stage, collect rings, fight enemies. And the 10K monitors would probably make these ways of gaining score obselete and would make finding these required to gaining the emblem instead of just being a small help if you lose your 300 rings you collected.

But still thanks for help. Even though I’ll probably continue to let the rng gods randomly choose between 1K and 10K monitors in record attack. :C
..
I didn't notice you said "a specific extra life monitor" sorry for that mistake. I'm trying to fix it but for some reason it's crashing the game :(.
 
..
I didn't notice you said "a specific extra life monitor" sorry for that mistake. I'm trying to fix it but for some reason it's crashing the game :(.
Okay then, take your time. (Because from my experience with actual programing that I started to have in 9th grade, it’s bad... But maybe it’s because the teacher is a bit older and grumpier.)

I never thought I would randomly receive a whole lua code like that by the way.
 
Okay then, take your time. (Because from my experience with actual programing that I started to have in 9th grade, it’s bad... But maybe it’s because the teacher is a bit older and grumpier.)

I never thought I would randomly receive a whole lua code like that by the way.
Done! This new version adds a new object instead of a map header. Btw you'll notice this one is a .pk3 instead of a .lua, that's because I added a sprite so you can actually see the object in Zone Builder!

How it works?
Just add the new object 1UP or 10K monitor (yes, that's the name) to your map and done!
Object's thingnum is 7025 and can be found in category Custom Monitors

Download the attached file, not this standalone script.


1UP or 10K s. monitor (download the attached file, not this standalone script.):
// Custom monitor that converts into a 10K Score monitor or a 1UP monitor if you're in
// R.A. or not cuz I don't trust SRB2 anymore.
// -----
// Just add the new object "1UP or 10K monitor" (yes, that's the name) to your map
// and done! Object's thingnum is 7025 and can be found in category "Custom Monitors"
// -----
// After following the instructions above, any 1UP monitors placed will convert
// to 10,000 score monitors.
// -----
// There are comments along with the code to make it "readable" to any user
// -----
// If there is any problem with this, then tell me.

// Add the object and the state
freeslot("MT_1UPTO10K_BOX", "S_1UPTO10K_BOX")

// State properties
states[S_1UPTO10K_BOX] = {
    tics = -1, // Duration in tics (35 tics = 1 second) (-1 tic = In this case Infinite)
    nextstate = S_1UPTO10K_BOX // Next state
}

// Object properties
mobjinfo[MT_1UPTO10K_BOX] = {
    // These 3 comments are used only for Zone Builder
    //$Name 1UP or 10K monitor
    //$Category Custom Monitors
    //$Sprite 1UP10KTV

    doomednum = 7025, // Thingnum (Every object should have the different thingnums or else bad things happen!)
    radius = 18*FRACUNIT, // Radius (SRB2 multiplies this by 2 to create the width)
    height = 40*FRACUNIT, // Height
    spawnstate = S_1UPTO10K_BOX, // The spawn state
    flags = MF_NOGRAVITY // Object flags
}

addHook("MobjThinker", function(mobj) // Run this hook if we found an object
    if mobj and mobj.valid // It NEEDS to exist
    and mobj.type == MT_1UPTO10K_BOX // Check if it is the desired object
        if modeattacking == true // If we are playing Record Attack...
            P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_SCORE10K_BOX) // Spawn 10K score
        else // Oh... We're not in R.A. so...
            P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_1UP_BOX) // Spawn 1UP
        end
        P_RemoveMobj(mobj) // Buh-bye!!
    end
end)
 

Attachments

  • 1UP or 10K s. monitor.pk3
    2.1 KB · Views: 19
Done! This new version adds a new object instead of a map header. Btw you'll notice this one is a .pk3 instead of a .lua, that's because I added a sprite so you can actually see the object in Zone Builder!

How it works?
Just add the new object 1UP or 10K monitor (yes, that's the name) to your map and done!
Object's thingnum is 7025 and can be found in category Custom Monitors

Download the attached file, not this standalone script.


1UP or 10K s. monitor (download the attached file, not this standalone script.):
// Custom monitor that converts into a 10K Score monitor or a 1UP monitor if you're in
// R.A. or not cuz I don't trust SRB2 anymore.
// -----
// Just add the new object "1UP or 10K monitor" (yes, that's the name) to your map
// and done! Object's thingnum is 7025 and can be found in category "Custom Monitors"
// -----
// After following the instructions above, any 1UP monitors placed will convert
// to 10,000 score monitors.
// -----
// There are comments along with the code to make it "readable" to any user
// -----
// If there is any problem with this, then tell me.

// Add the object and the state
freeslot("MT_1UPTO10K_BOX", "S_1UPTO10K_BOX")

// State properties
states[S_1UPTO10K_BOX] = {
    tics = -1, // Duration in tics (35 tics = 1 second) (-1 tic = In this case Infinite)
    nextstate = S_1UPTO10K_BOX // Next state
}

// Object properties
mobjinfo[MT_1UPTO10K_BOX] = {
    // These 3 comments are used only for Zone Builder
    //$Name 1UP or 10K monitor
    //$Category Custom Monitors
    //$Sprite 1UP10KTV

    doomednum = 7025, // Thingnum (Every object should have the different thingnums or else bad things happen!)
    radius = 18*FRACUNIT, // Radius (SRB2 multiplies this by 2 to create the width)
    height = 40*FRACUNIT, // Height
    spawnstate = S_1UPTO10K_BOX, // The spawn state
    flags = MF_NOGRAVITY // Object flags
}

addHook("MobjThinker", function(mobj) // Run this hook if we found an object
    if mobj and mobj.valid // It NEEDS to exist
    and mobj.type == MT_1UPTO10K_BOX // Check if it is the desired object
        if modeattacking == true // If we are playing Record Attack...
            P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_SCORE10K_BOX) // Spawn 10K score
        else // Oh... We're not in R.A. so...
            P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_1UP_BOX) // Spawn 1UP
        end
        P_RemoveMobj(mobj) // Buh-bye!!
    end
end)
So a thing happened that kinda makes me feel bad now. So apparently I got bamboozled by STJ because when you DON'T add any flags to a 1 up monitor ONLY THEN it turns into a 10K one. That doesn't make any sense really. So in that case, the 1 up flags should say 1K points instead of a 10K points.

So I'm sorry if I wasted your time by having to write all this code that I don't really even need at this point. :C

Someone should edit the wiki page for these monitors to evade any more problems like this one from happening again. :|


PSA: If you have the same problem as I do, then remember that for some reason the flags say / 10K score on the outside even though on the inside these flags actually change the extra life monitor into a 1K one instead. So in other words:

The extra life monitor turns into a 10K variant by default if no flags are applied.
And the flags force the monitor to turn into a 1K variant instead. So the flags should actually be named:

[Random (strong) / 1K points] and [Random (weak) / 1K points]
 
So a thing happened that kinda makes me feel bad now. So apparently I got bamboozled by STJ because when you DON'T add any flags to a 1 up monitor ONLY THEN it turns into a 10K one. That doesn't make any sense really. So in that case, the 1 up flags should say 1K points instead of a 10K points.
STJr. did it again... :dramahog:
By the way, don't feel bad about having me create the code, it was actually such a fun ride.
If you ever need a dialogue library, a custom enemy, or anything else, you can count on me!
 
Last edited:

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

Back
Top