Fabulous99
Aw yeah ! This is happening !
Hi, is there a way to script a ability, visual effects and sprite swap when selecting a specific Chaos Emerald, if it even exists ?
It's hard to explain, but for example : by obtaining a Chaos Emerald, you get a hud where there's the Chaos Emerald you just got, and you get special powers from it, like for the CD Sonic addon. Here: https://mb.srb2.org/threads/cd-sonic.25597/ . And the more Chaos Emeralds you get, the more the hud will add them in the selection, cuz I'm planning a super awesome mod, but I don't know anything in lua, plus I don't think the wiki will give all the answers I need, so I made this thread.
[...]
Given the two different systems of collecting Chaos Emeralds in-game detailed above, the internal storage methods for Chaos Emeralds also differ accordingly:
To store the collected emeralds in both of the above systems, the Chaos Emeralds themselves are represented by a series of toggles known as the Chaos Emerald flags. These are listed below:
- In Single Player/Coop, the Chaos Emeralds collected by all players are stored in the global variable emeralds, which can be accessed or modified with the use of Lua scripts.
- In Match/Capture the Flag, the Chaos Emeralds collected by each player are stored using the player power pw_emeralds. In Lua, this power can be accessed or modified for a particular player with the code player.powers[pw_emeralds].
[...]
Value Flag name Emerald Icon 1 EMERALD1 Green Emerald 2 EMERALD2 Purple Emerald 4 EMERALD3 Blue Emerald 8 EMERALD4 Light Blue Emerald 16 EMERALD5 Orange Emerald 32 EMERALD6 Red Emerald 64 EMERALD7 Gray Emerald
emeralds
or the player property pw_emeralds through player.powers[pw_emeralds]
(depending on the gamemode) to verify if the value in either of these variables match the desired emerald flag.if player.powers[pw_emeralds] & EMERALD1 & EMERALD2 & EMERALD3 -- & EMERALD4... so on and so forth
-- You don't need to have them in order so EMERALD1 & EMERALD5 would also work, I believe.
print("You have some emeralds!")
end
--[[
EMERALD1 has a value of 1 and EMERALD2 has a value of 2 so:
1 + 2 = 3 (duh)
]]
if player.powers[pw_emeralds] = 3 then
print("You have the Green and Purple Emeralds!")
--[[
EMERALD4's value is 8 and EMERALD7's value is 64 so:
64 + 8 = 72
]]
elseif player.powers[pw_emeralds] = 72 then
print("You have the Light Blue and Gray Emeralds!")
end
-- Assuming you want the player(s) to retain the old abilities even though they get more emeralds
if emeralds >= 1 then --You have 1 emerald
--do stuff
elseif emeralds >= 3 then --You have 2 emeralds
--do stuff
elseif emeralds >= 7 then --You have 3 emer— okay I think you got it by now.
--do stuff
-- Keep doing that until you've checked them all.
end
Well, the way to make it is by making a script select menu of it.Thank you so much ! Btw, is there a way to add more than 1 transformation and select it ?
Btw, Is there a way to add more than 1 transformation and select it ?
P_DoSuperTransformation
, P_SuperReady
, and maybe A_CustomPower
. I'm not sure if you can override P_*
functions (and if you can, I'm not sure it's even a good idea), but that should ease the workload.Are you asking to play the MP Special Stages in the single player, or to play them both in the same campaign?Hm. Rather interesting. Honestly, I'm kinda new to the whole Lua thing and because of school, I don't have enough time. And is there a way to play both Special Stages separately (Co-Op and 1P) ? Cuz the separate SP thing is something I feel will be useful.
How do I do that ?Well, the way to make it is by making a script select menu of it.
Just like how CD Sonic (as maded by Lat in Mar 24, 2018), or use a reusable menu that is on the mb. Which you can edit and it will work.The Super Emeralds are EXACTLY the idea I had. I was thinking Co-Op Special Stages for the Chaos Emeralds and Nights (1P) Special Stages for the Super Emeralds.
Post automatically merged:
How do I do that ?