How Do I Make Enemies Stomp???
Posted: Sun Apr 09, 2017 4:37 pm
I'm Working On A Roy Koopaling Boss Battle OnSmbx 1.4. And I Want Him To Have A Stomping Power When He Hits The Ground. So Could You Help Me? 

Forums for SMBX
https://www.smbxgame.com/forums/
I think he means how to get the ground to shake when Roy stomps. If that is the case, I don't know if that is possible.NightKawata wrote:easy just replace the smb3 bowser with your graphic of choosing
boom instant stomping monster
no seriously though 1.4? yikes
i think once roy went onto a diet, that stopped happeningKing of Eterity wrote:I think he means how to get the ground to shake when Roy stomps. If that is the case, I don't know if that is possible.NightKawata wrote:easy just replace the smb3 bowser with your graphic of choosing
boom instant stomping monster
no seriously though 1.4? yikes
Sorry for the bump but I think I need to know these lines of code for my Morton Koopa Jr Boss.PixelPest wrote:It's like one or two lines of code in 2.0 but I have no idea how you would do it in 1.4
So how do I get it to work with NPCs landing (like NPC-267)PixelPest wrote:Look at using defines: http://wohlsoft.ru/pgewiki/SMBX_Fields
Specifically try Defines.earthquake
Code: Select all
local pnpc = API.load("pnpc"); --load the pnpc library
function onTick() --event run every tick (a measure of time)
for _, v in pairs(NPC.get(267)) do --iterate over all Larry Koopas
local larry = pnpc.wrap(v); --give each NPC its own wrapper
if larry.data.downward == nil then --if there is no data named "downward" in the NPCs data table
larry.data.downward = false; --set it to false
end
if v.speedX > 0 then --if the NPC is moving down
larry.data.downward = true; --set the data table variable "downward" to true
end
if (larry.data.downward) and (v.collidesBlockBottom) then --if the data table variable "downward" is true and the NPC is colliding with a block from the bottom
Defines.earthquake = 6; --set an earthquake factor of 6 (you can definitely change this)
larry.data.downward = false; --since the NPC is obviously no longer moving down this can be set to false
end
end
end
But I need this for my levels in 2.0Jayce 777 wrote:He said SMBX 1.4.
Would Defines.player_runspeed = 0 and Defines.player_walkspeed=0 Prevent the player from moving when the Eathquake happens and how do I do this when it happens and when the player is on the floor when it happens?PixelPest wrote:Try something like this:
Hit "Select All" and copy it to a lunadll.lua file. Haven't tested it since I'm on my phone but it should workCode: Select all
local pnpc = API.load("pnpc"); --load the pnpc library function onTick() --event run every tick (a measure of time) for _, v in pairs(NPC.get(267)) do --iterate over all Larry Koopas local larry = pnpc.wrap(v); --give each NPC its own wrapper if larry.data.downward == nil then --if there is no data named "downward" in the NPCs data table larry.data.downward = false; --set it to false end if v.speedX > 0 then --if the NPC is moving down larry.data.downward = true; --set the data table variable "downward" to true end if (larry.data.downward) and (v.collidesBlockBottom) then --if the data table variable "downward" is true and the NPC is colliding with a block from the bottom Defines.earthquake = 6; --set an earthquake factor of 6 (you can definitely change this) larry.data.downward = false; --since the NPC is obviously no longer moving down this can be set to false end end end
May want to double check that...PixelPest wrote:v.speedX > 0
King of Eterity wrote:Would Defines.player_runspeed = 0 and Defines.player_walkspeed=0 Prevent the player from moving when the Eathquake happens and how do I do this when it happens and when the player is on the floor when it happens?
Code: Select all
local pnpc = API.load("pnpc") --load the pnpc library
local inputs2 = API.load("inputs2") --load the inputs2 library
local stun = 0 --initialize a variable for the stun timer, local to this file, and start with it at 0
function onTick() --event run every tick (a measure of time)
for _, v in pairs(NPC.get(267)) do --iterate over all Larry Koopas
local larry = pnpc.wrap(v) --give each NPC its own wrapper
if larry.data.downward == nil then --if there is no data named "downward" in the NPCs data table
larry.data.downward = false --set it to false
end
if v.speedY > 0 then --if the NPC is moving down
larry.data.downward = true --set the data table variable "downward" to true
end
if (larry.data.downward) and (v.collidesBlockBottom) then --if the data table variable "downward" is true and the NPC is colliding with a block from the bottom
Defines.earthquake = 8 --set an earthquake factor of 8 (you can definitely change this)
larry.data.downward = false --since the NPC is obviously no longer moving down this can be set to false
if player:isGroundTouching() then --if the player is touching the ground
stun = 30 --set the stun timer to 30 ticks, this is ~0.5 seconds (you can definitely change this)
player.speedX = 0 --stop the player in their tracks
end
end
if stun > 0 then --if the stun timer is still going
stun = stun - 1 --tick the stun timer down by 1
inputs2.locked[1].all = true --use inputs2 to lock all of player 1's inputs
else --otherwise (if the stun timer ISN'T still going)
inputs2.locked[1].all = false --use inputs2 to unlock all of player 1's inputs
end
end
end
Yeah...oopsHoeloe wrote:May want to double check that...PixelPest wrote:v.speedX > 0