Page 1 of 1
1 small request, and a semi bigger one.
Posted: Thu Oct 29, 2020 5:09 pm
by RaccAttacc
I'll start with the small request first, since that seems way more doable.
I want a script that basically just disables the players jump.
I'm planning to use that for a extra level in my episode. (Kinda like star road in SMW, but with more stuff going on.)
And now the semi bigger one, that might not get done. Wouldn't be surprised.
It's basically make Wario bounce back a little once he hits something with his slam(?) Like, you'll destory a block, and you'll be put in a bounce back state, kinda like Wario Land 4 if that makes any sense.
I honestly don't expect anyone to do the second one, but I would love help learning how to do it myself if it isn't done anytime soon.
Re: 1 small request, and a semi bigger one.
Posted: Thu Oct 29, 2020 5:48 pm
by Emral
To disable jumping you can force the jump key to false in the level's luna.lua file:
Code: Select all
function onTick() -- every frame of gameplay
player.keys.jump = false
player.keys.altJump = false -- spinjump
end
The latter is a matter of overriding the wario playable with a custom script in your episode, which is a bit more involved.
This needs to go into luna.lua for the level or episode:
Code: Select all
local playerManager = require("playerManager")
playerManager.overrideCharacterLib(CHARACTER_WARIO, require("myWario"))
And then you make a myWario.lua in the same folder as that file, which is a copy of basegame's wario. You'll need to edit the file a little bit though.
The lines 368-370 need to be copied below line 365, so that the if-statement section looks like this:
Code: Select all
if block.isHidden == false and block:mem(0x5a, FIELD_WORD) == 0 then
-- If the block should be broken, destroy it
if expandedDefines.BLOCK_MEGA_SMASH_MAP[block.id] then
if block.contentID > 0 then
block:hit(false, player)
else
block:remove(true)
end
dashtimer = 0
player.speedX = -2 * lockedDirection
player.speedY = -5
elseif expandedDefines.BLOCK_MEGA_HIT_MAP[block.id] then
block:hit(true, player)
dashtimer = 0
player.speedX = -2 * lockedDirection
player.speedY = -5
end
end
I have never used the replaceCharacterLib function, so I might have misinterpreted the way to call it. At a glance it looks right, though. A side effect of this simple implementation is that the charge will always be cancelled and Wario will be unable to cut through blocks like butter anymore. Having both interactions simultaneously for different block IDs is a bit more complicated. I can get into that implementation if you want to.
Re: 1 small request, and a semi bigger one.
Posted: Thu Oct 29, 2020 8:11 pm
by RaccAttacc
Enjl wrote: ↑Thu Oct 29, 2020 5:48 pm
The latter is a matter of overriding the wario playable with a custom script in your episode, which is a bit more involved.
This needs to go into luna.lua for the level or episode:
Code: Select all
local playerManager = require("playerManager")
playerManager.overrideCharacterLib(CHARACTER_WARIO, require("myWario"))
And then you make a myWario.lua in the same folder as that file, which is a copy of basegame's wario. You'll need to edit the file a little bit though.
The lines 368-370 need to be copied below line 365, so that the if-statement section looks like this:
Code: Select all
if block.isHidden == false and block:mem(0x5a, FIELD_WORD) == 0 then
-- If the block should be broken, destroy it
if expandedDefines.BLOCK_MEGA_SMASH_MAP[block.id] then
if block.contentID > 0 then
block:hit(false, player)
else
block:remove(true)
end
dashtimer = 0
player.speedX = -2 * lockedDirection
player.speedY = -5
elseif expandedDefines.BLOCK_MEGA_HIT_MAP[block.id] then
block:hit(true, player)
dashtimer = 0
player.speedX = -2 * lockedDirection
player.speedY = -5
end
end
I have never used the replaceCharacterLib function, so I might have misinterpreted the way to call it. At a glance it looks right, though. A side effect of this simple implementation is that the charge will always be cancelled and Wario will be unable to cut through blocks like butter anymore. Having both interactions simultaneously for different block IDs is a bit more complicated. I can get into that implementation if you want to.
The call seemed to work, but the code for some reason didn't... Maybe its the way I implemented it, I went to line 365, hit enter and then pasted the code. When I tested the game Wario didnt have his dash or groundpound anymore. It's definitely the way I implemented it though.
Re: 1 small request, and a semi bigger one.
Posted: Fri Oct 30, 2020 2:27 am
by Emral
That... is interesting. Can you try again with this file as your myWario.lua? I can test around a bit in the afternoon if this still doesn't do it.
https://hastebin.com/vomijiniva.lua
Re: 1 small request, and a semi bigger one.
Posted: Fri Oct 30, 2020 9:09 am
by RaccAttacc
Enjl wrote: ↑Fri Oct 30, 2020 2:27 am
That... is interesting. Can you try again with this file as your myWario.lua? I can test around a bit in the afternoon if this still doesn't do it.
https://hastebin.com/vomijiniva.lua
Nope, still not working.
Re: 1 small request, and a semi bigger one.
Posted: Fri Oct 30, 2020 10:33 am
by Emral
I just tried it and it works. Here are the files I used:
https://discordapp.com/channels/7307675 ... 5402420255
Re: 1 small request, and a semi bigger one.
Posted: Fri Oct 30, 2020 11:27 am
by RaccAttacc
I clicked on the link. It's not bringing me anywhere. Atleast where I can get the files
Re: 1 small request, and a semi bigger one.
Posted: Fri Oct 30, 2020 1:59 pm
by Emral
RaccAttacc wrote: ↑Fri Oct 30, 2020 11:27 am
I clicked on the link. It's not bringing me anywhere. Atleast where I can get the files
Sorry I'm technically illiterate
https://cdn.discordapp.com/attachments/ ... rioTest.7z
Re: 1 small request, and a semi bigger one.
Posted: Fri Oct 30, 2020 3:49 pm
by RaccAttacc
Works like a dream. Thanks!
Re: 1 small request, and a semi bigger one.
Posted: Fri Oct 30, 2020 3:57 pm
by Emral
Sweet! Glad to hear.
Re: 1 small request, and a semi bigger one.
Posted: Sat Oct 31, 2020 8:11 pm
by DrMekar
Sorry for just clicking in into that Topic, so would this also work on a limited scale, like disabeling Peach's Float Ability?
Re: 1 small request, and a semi bigger one.
Posted: Sun Nov 01, 2020 2:42 am
by Emral
DrMekar wrote: ↑Sat Oct 31, 2020 8:11 pm
Sorry for just clicking in into that Topic, so would this also work on a limited scale, like disabeling Peach's Float Ability?
To disable peach's float just disable the hover timer. We didn't make peach so it's baked into the player class. It's one of the first offsets.
https://wohlsoft.ru/pgewiki/SMBX_Player_Offsets
Re: 1 small request, and a semi bigger one.
Posted: Sun Nov 01, 2020 2:28 pm
by DrMekar
Enjl wrote: ↑Sun Nov 01, 2020 2:42 am
DrMekar wrote: ↑Sat Oct 31, 2020 8:11 pm
Sorry for just clicking in into that Topic, so would this also work on a limited scale, like disabeling Peach's Float Ability?
To disable peach's float just disable the hover timer. We didn't make peach so it's baked into the player class. It's one of the first offsets.
https://wohlsoft.ru/pgewiki/SMBX_Player_Offsets
While thinking of what to do with the information you just gave me, I happen to see the sentence of the Code usage in your fooder and since
I'm not part of the Novaverese, I thought if I could import the Character Turtwig from Subzero Heroes, since it fits exacstly what I was looking for,
a Peach Playable who can't float and has the Ram Attack, I originally was going to attempt to take from Wario's Code.
What I want to ask though is how do I do this and is there a way to make in Episode based, instead of level based? (If not, it would't be a big deal, because the Character only gets unlocked in World 7 of 9, but still.)
Re: 1 small request, and a semi bigger one.
Posted: Sun Nov 01, 2020 2:42 pm
by Emral
Wario's code is a basegame variant of Turtwig's code.
Re: 1 small request, and a semi bigger one.
Posted: Sun Nov 01, 2020 2:56 pm
by DrMekar
Enjl wrote: ↑Sun Nov 01, 2020 2:42 pm
Wario's code is a basegame variant of Turtwig's code.
I thought that much, so you recommended me, not to make any 2.0 Characters before Beta 5 aka Full Release and after the experience
I made with my playable Lee Cintaro, who I almost drew from scratch and ended up not working at all over Broadssword, I stick to that.
Re: 1 small request, and a semi bigger one.
Posted: Mon Nov 02, 2020 1:57 am
by DrMekar
So, could you maybe atleast tell me, if this is still true or more, true for Wario?
Because if it is, my next Question would be how to put Wario's Code on Peachs.