Post here for help and support regarding LunaLua and SMBX2's libraries and features.
Moderator: Userbase Moderators
|
|
|
|
-
RaccAttacc
- Spiny

- Posts: 26
- Joined: Wed Oct 28, 2020 4:13 pm
- Flair: I am the uterus 2
- Pronouns: she/her
Postby RaccAttacc » Thu Oct 29, 2020 5:09 pm
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.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9865
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Thu Oct 29, 2020 5:48 pm
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.
|
|
|
|
|
|
|
|
|
-
RaccAttacc
- Spiny

- Posts: 26
- Joined: Wed Oct 28, 2020 4:13 pm
- Flair: I am the uterus 2
- Pronouns: she/her
Postby RaccAttacc » Thu Oct 29, 2020 8:11 pm
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.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9865
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » 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
|
|
|
|
|
|
|
|
|
-
RaccAttacc
- Spiny

- Posts: 26
- Joined: Wed Oct 28, 2020 4:13 pm
- Flair: I am the uterus 2
- Pronouns: she/her
Postby RaccAttacc » Fri Oct 30, 2020 9:09 am
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.
|
|
|
|
|
|
|
|
|
-
RaccAttacc
- Spiny

- Posts: 26
- Joined: Wed Oct 28, 2020 4:13 pm
- Flair: I am the uterus 2
- Pronouns: she/her
Postby RaccAttacc » 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
|
|
|
|
|
|
|
|
|
-
RaccAttacc
- Spiny

- Posts: 26
- Joined: Wed Oct 28, 2020 4:13 pm
- Flair: I am the uterus 2
- Pronouns: she/her
Postby RaccAttacc » Fri Oct 30, 2020 3:49 pm
Works like a dream. Thanks!
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9865
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Fri Oct 30, 2020 3:57 pm
Sweet! Glad to hear.
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 781
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
Postby DrMekar » 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?
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9865
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » 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
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 781
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
Postby DrMekar » Sun Nov 01, 2020 2:28 pm
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.)
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9865
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Sun Nov 01, 2020 2:42 pm
Wario's code is a basegame variant of Turtwig's code.
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 781
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
Postby DrMekar » Sun Nov 01, 2020 2:56 pm
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.
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 781
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
Postby DrMekar » Mon Nov 02, 2020 1:57 am
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.
|
|
|
|
|
Return to “LunaLua Help”
Users browsing this forum: No registered users and 1 guest
|