SMBX - Hammer Starman (Repost)

General discussion about Super Mario Bros. X.

Moderator: Userbase Moderators

DarkShadeX
Volcano Lotus
Volcano Lotus
Posts: 535
Joined: Sat Jan 18, 2014 11:34 am

SMBX - Hammer Starman (Repost)

Postby DarkShadeX » Fri May 22, 2015 4:05 pm

I got a lot of emails about if i could repost the Starman code from a while ago,if you guys really want it,then here:

Code: Select all

--Set some Variables first:
local StarPower_P1 = false
 local StarTimer_P1 = 0


 -- Find Starman:
function countNPCID(id)
   local npcs = findnpcs(id, -1)
   local count = 0
   for k,v in pairs(npcs) do
      count = count + 1
   end
   return count
end

function onLoop()

 local HNPC = findnpcs(171, -1) -- The Hammer in section!
 
 hud(false)
 printText("GOT STARPOWER: "..tostring(StarPower_P1), 30, 50)
 printText("STARMAN NPC IN ROOM: "..tostring(count), 30, 70)
 printText("INVINCIBILITY LEFT: "..tostring(StarTimer_P1), 30, 90)
 -- Get Star Power:
 
 if(StarPower_P1 == false and countNPCID(103) == 0 and count ~= -1 )then
   count = -1
   StarTimer_P1 = 600
  end
  
 -- Check Stuff:
if(StarTimer_P1 >= 1)then
  StarPower_P1 = true -- Keep Power state to true.
  mem(0x00B2C8C0, FIELD_WORD, 0xFFFF) -- Make the Player Invincible.
 else
  StarPower_P1 = false -- Keep Power state to false.
  mem(0x00B2C8C0, FIELD_WORD, 0) -- Make the Player NOT Invincible.
  HNPC[0].x = -1000000 HNPC[0].y = -1000000 -- Reset Hammer Position!
 end

 -- If you're in Invincibility State: 
if(StarPower_P1 == true and StarTimer_P1 >= 1)then -- Reduce Invincibility Time!
 StarTimer_P1 = StarTimer_P1 - 1
 HNPC[0].x = player.x HNPC[0].y = player.y -- Set Hammer position to player.
 end
 
end
Make sure to tweak the code to make it work better.

Radishl
Guest

Re: SMBX - Hammer Starman (Repost)

Postby Radishl » Mon May 25, 2015 9:36 pm

Wow, neat!
We could really use this.

Thanks Dark!

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: SMBX - Hammer Starman (Repost)

Postby PersonNamedUser » Tue Jul 21, 2015 11:40 pm

How do you use this?

SMBXxer
Fuzzy
Fuzzy
Posts: 1023
Joined: Fri Dec 20, 2013 4:33 pm

Re: SMBX - Hammer Starman (Repost)

Postby SMBXxer » Sat Jul 25, 2015 2:58 pm

What object does it replace? I use this in Lunaglobal, right?

FanofSMBX
Ludwig von Koopa
Ludwig von Koopa
Posts: 3878
Joined: Sun Dec 22, 2013 12:01 pm

Re: SMBX - Hammer Starman (Repost)

Postby FanofSMBX » Sun Jul 26, 2015 4:09 am

SuperMario12345 wrote:How do you use this?
I think you put the code in your level's lunadll.lua and then you collect a Red Coin.

SMBXxer
Fuzzy
Fuzzy
Posts: 1023
Joined: Fri Dec 20, 2013 4:33 pm

Re: SMBX - Hammer Starman (Repost)

Postby SMBXxer » Sun Jul 26, 2015 11:17 pm

FanofSMBX wrote:
SuperMario12345 wrote:How do you use this?
I think you put the code in your level's lunadll.lua and then you collect a Red Coin.
.lua?
I still have .dll, do I need to change?

Wohlstand
Chargin' Chuck
Chargin' Chuck
Posts: 2008
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: SMBX - Hammer Starman (Repost)

Postby Wohlstand » Sun Aug 09, 2015 5:46 pm

SMBXxer wrote:
FanofSMBX wrote:
SuperMario12345 wrote:How do you use this?
I think you put the code in your level's lunadll.lua and then you collect a Red Coin.
.lua?
I still have .dll, do I need to change?
LunaLUA is same LunaDLL but in new view, and with a lot of new better things (Lua-scripting sub-system, Better Audio engine, Improvment of Graphic system with OpenGL usage, Some bug-fixes, etc. Don't worry, it still support old lunadll.txt, but this sub-system no more have updates, most of new things are available for lunadll.lua)


Return to “General”

Who is online

Users browsing this forum: No registered users and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari