Add an npc code that allows it to take damage from Player's Hammer Shell

Description: Have any suggestions or new ideas for SMBX-38A? This is a place for you. Good suggestions may appear in future versions of SMBX-38A.
Moderators: Yoshi021, Lx Xzit, 5438A38A, Semi-moderatos, Moderators

fnafan8888888888 M
Topic author, Count
Count
fnafan8888888888 M
Topic author, Count
Count
Age: 18
Reputation: 25
Posts: 215
Joined: 30 Jun 2019

Post #1by fnafan8888888888 » 17 Nov 2019, 23:31

I recommend to add an npc code that makes it take damage from the player when he ducks in his Hammer Suit.

Victor ManuelMR M
Marquis
Marquis
Avatar
Victor ManuelMR M
Marquis
Marquis
Age: 18
Reputation: 53
Posts: 156
Joined: 7 Feb 2018

Post #2by Victor ManuelMR » 19 Nov 2019, 20:47

fnafan8888888888 wrote:I recommend to add an npc code that makes it take damage from the player when he ducks in his Hammer Suit.

But there is already a function for this: sysval(DisableHammerShield)
Image
[1.4.5] - Dream Team at The Challenging Portals:
Image

fnafan8888888888 M
Topic author, Count
Count
fnafan8888888888 M
Topic author, Count
Count
Age: 18
Reputation: 25
Posts: 215
Joined: 30 Jun 2019

Post #3by fnafan8888888888 » 19 Nov 2019, 21:43

Victor ManuelMR wrote:But there is already a function for this: sysval(DisableHammerShield)
Thanks for the information, but I suggested this because not all people can use scripts, also do you know where can I find a topic that includes scripts instructions such as "sysval(DisableHammerShield)"?

fnafan8888888888 M
Topic author, Count
Count
fnafan8888888888 M
Topic author, Count
Count
Age: 18
Reputation: 25
Posts: 215
Joined: 30 Jun 2019

Post #4by fnafan8888888888 » 24 Nov 2019, 1:55

Victor ManuelMR wrote:But there is already a function for this: sysval(DisableHammerShield)
Also can you tell me how to use the "sysval(DisableHammerShield)"?
I want to make npc-282(Ludwig's Fireball) or any other npc take damage from the Hammer Shield.

Victor ManuelMR M
Marquis
Marquis
Avatar
Victor ManuelMR M
Marquis
Marquis
Age: 18
Reputation: 53
Posts: 156
Joined: 7 Feb 2018

Post #5by Victor ManuelMR » 24 Nov 2019, 19:37

Spoiler
fnafan8888888888 wrote:
Victor ManuelMR wrote:But there is already a function for this: sysval(DisableHammerShield)
Also can you tell me how to use the "sysval(DisableHammerShield)"?
I want to make npc-282(Ludwig's Fireball) or any other npc take damage from the Hammer Shield.

Use the following script:


do
sysval(DisableHammerShield) = 1
call sleep(1) 'time interval, if you don't have the game will crash
loop


Image
[1.4.5] - Dream Team at The Challenging Portals:
Image

fnafan8888888888 M
Topic author, Count
Count
fnafan8888888888 M
Topic author, Count
Count
Age: 18
Reputation: 25
Posts: 215
Joined: 30 Jun 2019

Post #6by fnafan8888888888 » 24 Nov 2019, 23:35

Victor ManuelMR wrote:
Spoiler
fnafan8888888888 wrote:
Victor ManuelMR wrote:But there is already a function for this: sysval(DisableHammerShield)
Also can you tell me how to use the "sysval(DisableHammerShield)"?
I want to make npc-282(Ludwig's Fireball) or any other npc take damage from the Hammer Shield.

Use the following script:


do
sysval(DisableHammerShield) = 1
call sleep(1) 'time interval, if you don't have the game will crash
loop


How to add time interval?

Lx Xzit M
Moderator
Moderator
Avatar
Lx Xzit M
Moderator
Moderator
Reputation: 385
Posts: 750
Joined: 9 Nov 2015
Website

Post #7by Lx Xzit » 25 Nov 2019, 2:23

The code has already a wait time interval, which is the line "call sleep(1)".
You also don't need a do-loop for that, you can just put in the script the line "sysval(DisableHammerShield) = 1", trigger it through "Level Start" and it will work.
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

fnafan8888888888 M
Topic author, Count
Count
fnafan8888888888 M
Topic author, Count
Count
Age: 18
Reputation: 25
Posts: 215
Joined: 30 Jun 2019

Post #8by fnafan8888888888 » 25 Nov 2019, 2:49

Lx Xzit wrote:The code has already a wait time interval, which is the line "call sleep(1)".
You also don't need a do-loop for that, you can just put in the script the line "sysval(DisableHammerShield) = 1", trigger it through "Level Start" and it will work.
I did it, but Ludwig's Fireball(npc-282) still hurts Hammer Mario when he ducks.


Return to “Ideas & Suggestions”