How Do I Make Enemies Stomp???

Need help with any SMBX game-related issues? Ask your questions here.

Moderator: Userbase Moderators

TheTojoz
Shy Guy
Shy Guy
Posts: 6
Joined: Sun Apr 09, 2017 4:24 pm
Contact:

How Do I Make Enemies Stomp???

Postby TheTojoz » 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? :|
Last edited by TheTojoz on Sun Apr 09, 2017 4:45 pm, edited 1 time in total.

NightKawata
Spike
Spike
Posts: 285
Joined: Wed Jul 30, 2014 12:33 am
Contact:

Re: How Do I Make Enemies Stomp???

Postby NightKawata » Sun Apr 09, 2017 4:38 pm

easy just replace the smb3 bowser with your graphic of choosing

boom instant stomping monster

no seriously though 1.4? yikes

ElectriKong
Bowser
Bowser
Posts: 4651
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Pronouns: he/him
Contact:

Re: How Do I Make Enemies Stomp???

Postby ElectriKong » Sun Apr 09, 2017 7:06 pm

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 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
Spike
Spike
Posts: 285
Joined: Wed Jul 30, 2014 12:33 am
Contact:

Re: How Do I Make Enemies Stomp???

Postby NightKawata » Sun Apr 09, 2017 7:56 pm

King of Eterity wrote:
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 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.
i think once roy went onto a diet, that stopped happening

good on him

Koopsakimoto
Swooper
Swooper
Posts: 68
Joined: Wed Jul 20, 2016 3:50 pm
Contact:

Re: How Do I Make Enemies Stomp???

Postby Koopsakimoto » Sun Apr 09, 2017 9:27 pm

Lx xzit made some scripts for the SMB3 Koopalings

Bowser 1000
Spiny
Spiny
Posts: 26
Joined: Mon Apr 10, 2017 8:18 am

Re: How Do I Make Enemies Stomp???

Postby Bowser 1000 » Mon Apr 10, 2017 8:21 am

i do not think it is possible! but it would be very cool

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: How Do I Make Enemies Stomp???

Postby PixelPest » Mon Apr 10, 2017 8:25 am

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

ElectriKong
Bowser
Bowser
Posts: 4651
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Pronouns: he/him
Contact:

Re: How Do I Make Enemies Stomp???

Postby ElectriKong » Thu May 04, 2017 12:38 pm

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
Sorry for the bump but I think I need to know these lines of code for my Morton Koopa Jr Boss.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: How Do I Make Enemies Stomp???

Postby PixelPest » Thu May 04, 2017 8:35 pm

Look at using defines: http://wohlsoft.ru/pgewiki/SMBX_Fields

Specifically try Defines.earthquake

ElectriKong
Bowser
Bowser
Posts: 4651
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Pronouns: he/him
Contact:

Re: How Do I Make Enemies Stomp???

Postby ElectriKong » Fri May 05, 2017 4:03 pm

PixelPest wrote:Look at using defines: http://wohlsoft.ru/pgewiki/SMBX_Fields

Specifically try Defines.earthquake
So how do I get it to work with NPCs landing (like NPC-267)

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: How Do I Make Enemies Stomp???

Postby PixelPest » Fri May 05, 2017 10:19 pm

Try something like this:

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 
Hit "Select All" and copy it to a lunadll.lua file. Haven't tested it since I'm on my phone but it should work

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: How Do I Make Enemies Stomp???

Postby loop » Sat May 06, 2017 2:45 am

He said SMBX 1.4.

ElectriKong
Bowser
Bowser
Posts: 4651
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Pronouns: he/him
Contact:

Re: How Do I Make Enemies Stomp???

Postby ElectriKong » Sat May 06, 2017 6:42 am

Jayce 777 wrote:He said SMBX 1.4.
But I need this for my levels in 2.0
PixelPest wrote:Try something like this:

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 
Hit "Select All" and copy it to a lunadll.lua file. Haven't tested it since I'm on my phone but it should work
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?
Last edited by ElectriKong on Sat May 06, 2017 7:58 am, edited 1 time in total.

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: How Do I Make Enemies Stomp???

Postby Hoeloe » Sat May 06, 2017 7:57 am

PixelPest wrote:v.speedX > 0
May want to double check that...

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: How Do I Make Enemies Stomp???

Postby The0x539 » Sat May 06, 2017 10:08 am

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 

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: How Do I Make Enemies Stomp???

Postby PixelPest » Sat May 06, 2017 10:16 am

Hoeloe wrote:
PixelPest wrote:v.speedX > 0
May want to double check that...
Yeah...oops


Return to “Help and Support”

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari