• Do not use Works in Progress as a way of avoiding the releases system! Works in Progress can be used for sharing early betas and for getting suggestions for improvement. Releases of finished content are not allowed in this forum! If you would like to submit a finished addon, click here for instructions on how to do so.

Toggle Super transformations with and without shields? (Super button discussion)

Status
Not open for further replies.

Revolution

Member
In reference to this mod (https://mb.srb2.org/showthread.php?t=43061), it makes it so you can transform with a seperate button, as opposed to standard double-jumping. (You had to jump and press spin without a shield.) Some speculated how to get other ways to transform.

Most users, including myself, have questioned why you can't transform into Super Sonic, Tails, & Knuckles using a separate button. Most users would answer that "Sapheros (the author) is permanently banned from the server". So that gave me a reason to edit the mod's script myself, and so far, I was pleased with the results...

I tried editing the script that controls the Super transformation and got to the point of an almost-Sonic 3 Complete style: You now jump, then hold spin, and double jump while spin is held, again, without a shield. I also made it so you don't transform during a spindash (specifically with this mod: https://mb.srb2.org/showthread.php?t=43070) or while rolling and a consecutive double-jump press, along with a few others. (And also, holding spin and then double-jump wouldn't work because of spindash issues, and vice versa would conflict with Super Sonic's flight). And also, it didn't feel right to me to rely on Custom buttons for it either; something about being easy to find...?

So the gist of what I'm saying is...
Can there be more?
I believe that it can be possible to modify the script so well, it becomes as functional as Sonic 3 Complete, albeit the permission of Super transformation with shields active and being able to toggle Super, both on and off.
Classic.wad - Sonic 3 Complete style (Hold jump + Custom 2)
Code:
addHook("JumpSpecial", function(player)
	if ((player.charflags & SF_SUPER and All7Emeralds(emeralds)) or player.powers[pw_emeralds] == 127) then
		if player.mo.health >= 51
		and player.health >= 51
		and not player.powers[pw_shield]
		and not player.powers[pw_super]
		and (player.pflags & PF_JUMPED)
		and (player.cmd.buttons & BT_CUSTOM2)
		and not (player.pflags & PF_CARRIED)
		and not (player.pflags & PF_GLIDING)
		and not (player.pflags & PF_MACESPIN)
		and not (player.pflags & PF_ROPEHANG)
		and not (player.pflags & PF_SPINNING)
		and not (player.pflags & PF_STARTDASH)
		and not (player.pflags & PF_THOKKED)
			P_DoSuperTransformation(player, false)
			player.pflags = $|PF_THOKKED
		end
	end
end)
Original game - New style (Jump +hold spin + jump)
Code:
addHook("JumpSpinSpecial", function(player)
	if ((player.charflags & SF_SUPER and All7Emeralds(emeralds)) or player.powers[pw_emeralds] == 127) then
		if player.mo.health >= 51
		and player.health >= 51
		and not player.powers[pw_shield]
		and not player.powers[pw_super]
		and (player.pflags & PF_JUMPED)
		and (player.pflags & PF_USEDOWN)
		and (player.cmd.buttons & BT_JUMP)
		and not (player.pflags & PF_CARRIED)
		and not (player.pflags & PF_GLIDING)
		and not (player.pflags & PF_JUMPDOWN)
		and not (player.pflags & PF_MACESPIN)
		and not (player.pflags & PF_ROPEHANG)
		and not (player.pflags & PF_SPINNING)
		and not (player.pflags & PF_STARTDASH)
		and not (player.pflags & PF_THOKKED)
			P_DoSuperTransformation(player, false)
			player.pflags = $|PF_THOKKED
		end
	end
end)
How do you edit this script so that you can transform with shields and turn Super on and off?

Super Transformation button mod is owned by Sapheros. Classic.wad is owned by Rumia1. I do not own their contents.
 
Last edited:
To remove the shield requirement, you'd remove the 'and not player.powers[pw_shield]' from each snippet. As for the toggle, I'm fairly sure you'd have to write new code altogether for it.
 
To remove the shield requirement, you'd remove the 'and not player.powers[pw_shield]' from each snippet. As for the toggle, I'm fairly sure you'd have to write new code altogether for it.

For the super code, wouldn't it involve if.player.powers[pw_super] because you would have to be super for the code to work. I know how to write the first part of the code. I just need something that (when the code is enacted) reverts the player to normal state, rings and all. In other words, I'd have to find a code that turns super off immediately.
 
I just need something that (when the code is enacted) reverts the player to normal state, rings and all. In other words, I'd have to find a code that turns super off immediately.

Setting "player.powers[pw_super] = 0" should work for that.
 
Setting "player.powers[pw_super] = 0" should work for that.
One more question: How do I assemble the code altogether? I got as far as removing the no-shield requirement using the original script, but cannot assemble the command altogether.
Original code with no-shield requirement and no Super cancel
Code:
addHook("SpinSpecial", function(player)
	if ((player.charflags & SF_SUPER and All7Emeralds(emeralds)) or player.powers[pw_emeralds] == 127) then
		if player.mo.health >= 51
		and player.health >= 51
		and not player.powers[pw_super]
		and (player.pflags & PF_JUMPED)
		and not (player.pflags & PF_USEDOWN)
		and not (player.pflags & PF_THOKKED)
			P_DoSuperTransformation(player, false)
			player.pflags = $|PF_THOKKED
		end
	end
end)

addHook("ThinkFrame", do
	for player in players.iterate
		if ((player.charflags & SF_SUPER and All7Emeralds(emeralds)) or player.powers[pw_emeralds] == 127) then
			player.pflags = $1 & ~PF_SUPERREADY
		end
		/*if player.mo
			if not All7Emeralds(emeralds)
				P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_EMERALD1)
				P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_EMERALD2)
				P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_EMERALD3)
				P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_EMERALD4)
				P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_EMERALD5)
				P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_EMERALD6)
				P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_EMERALD7)
			end
			player.powers[pw_emeralds] = 127
			player.health = 51
			player.mo.health = 51
		end*/
	end
end)

This is what I have so far (like the dummy I am):
Code:
addHook("SpinSpecial", function(player)
	if ((player.charflags & SF_SUPER and All7Emeralds(emeralds)) or player.powers[pw_emeralds] == 127) then
		if player.mo.health >= 1
		and player.health >= 1
		and player.powers[pw_super]
		and (player.pflags & PF_JUMPED)
		and not (player.pflags & PF_USEDOWN)
		and not (player.pflags & PF_THOKKED)
 
Last edited:
Also, if you are using the Shield-Usage mod, I suggest you find this "Activating shield abilities" header in the shield script and change "SpinSpecial" to "JumpSpinSpecial". What it does is that you can still use the shield abilities but not when holding jump because it conflicts with the super trans. command. Here is what it look like:
Code:
/Activating shield abilities

addHook("JumpSpinSpecial", function(player)
	if not player.mo
	or player.playerstate
	or not (player.pflags & PF_JUMPED)
	or player.pflags & (PF_THOKKED|PF_USEDOWN)
	or player.powers[pw_super]
		return
	end
 
Last edited:
How do you cancel Super Sonic's flying in SRB2? I don't really like the idea of Super Sonic being able to fly with the spin button.
 
How do you cancel Super Sonic's flying in SRB2? I don't really like the idea of Super Sonic being able to fly with the spin button.

The ability to fly with the Spin button while Super is tied to the SF_SUPER skin flag. You could try removing that flag (every tic, if necessary) with a Lua script, but that might just make Sonic drop out of Super mode.
 
What do you convert the life icons (.PNG) into to get them to show the correct/change palette (like when Super) in-game? I want to add in Shadow, Amy and Metal Sonic life icons.
__________________
 
Status
Not open for further replies.

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

Back
Top