Npc Dmg and Npc scaling

Need help with any SMBX game-related issues? Ask your questions here.
User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Npc Dmg and Npc scaling

Postby Cigarettes » Thu Nov 07, 2019 6:37 pm

Having a hard time try to figure out how to make my npc take no hits and be friendly... Is there a way? Can i increase npc size using smbx 1.3? I have made alot of sprites for this project so far but for remaining sprites i need to upscale them.

User avatar
LGLMAKING
Ripper II
Ripper II
Posts: 305
Joined: Mon Jun 18, 2018 7:28 am
Flair: There's always another secret.
Current Project: Captain Toad: Shine Scramble

Re: Npc Dmg and Npc scaling

Postby LGLMAKING » Fri Nov 08, 2019 6:48 am

Cigarettes wrote:
Thu Nov 07, 2019 6:37 pm
Having a hard time try to figure out how to make my npc take no hits and be friendly... Is there a way? Can i increase npc size using smbx 1.3? I have made alot of sprites for this project so far but for remaining sprites i need to upscale them.
There is an option called "friendly". It makes npc's invulnerable and let's you use the message option. In fact, you can tie events to this. For your second question, you'll need custom graphics. Once you got those, check the dimensions of the image files. Pay attention to the size on the y-axis. Divide this number by the number of frames to get the graphicsheight. The graphicswidth can be read simply by clicking on the image in the same way you found the height of your gfx. Create a .txt document named after the npc you want to resprite (for example the name for the smb3 goomba used by SMBX is npc-1).

Write the following lines for the hitboxes and gfxsize:
gfxwidth=width of your sprites
gfxheight=well, you read how to calculate graphicsheight above, right?
width=width of your enemy's hitbox
height=height of your enemy's hitbox

Hope that helps
"I am incredibly lucky I know you and im glad I gave you a chance to be a part of this" -Eri7
Image
Image
Image
Pretty much nearly the co-producer of the Novaverse (see links above)

User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Re: Npc Dmg and Npc scaling

Postby Cigarettes » Fri Nov 08, 2019 12:33 pm

LGLMAKING wrote:
Fri Nov 08, 2019 6:48 am
Cigarettes wrote:
Thu Nov 07, 2019 6:37 pm
Having a hard time try to figure out how to make my npc take no hits and be friendly... Is there a way? Can i increase npc size using smbx 1.3? I have made alot of sprites for this project so far but for remaining sprites i need to upscale them.
There is an option called "friendly". It makes npc's invulnerable and let's you use the message option. In fact, you can tie events to this. For your second question, you'll need custom graphics. Once you got those, check the dimensions of the image files. Pay attention to the size on the y-axis. Divide this number by the number of frames to get the graphicsheight. The graphicswidth can be read simply by clicking on the image in the same way you found the height of your gfx. Create a .txt document named after the npc you want to resprite (for example the name for the smb3 goomba used by SMBX is npc-1).

Write the following lines for the hitboxes and gfxsize:
gfxwidth=width of your sprites
gfxheight=well, you read how to calculate graphicsheight above, right?
width=width of your enemy's hitbox
height=height of your enemy's hitbox

Hope that helps
Very helpful but...
So Friendly npcs can still take dmg if you make them enemy npc...so enemy npcs can be set to friendly but you can still jump on them and kill them with turtle shells =( i replaced my koopas with my custom npcs works perfect but i can kill them when set to friendly =( i need to switch my koopas because i need that behavor for the npc .because i don't know how to create one from scratch. I don't know how to check dimensions and height other than right click properties and it will tell but i have no option to change it. If i make this text document how do i attach it to the image?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8230
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Npc Dmg and Npc scaling

Postby Enjl » Fri Nov 08, 2019 1:24 pm

friendly npcs are, by definition, immune to interaction from any other npc. you cannot jump on them or kill them. if you find yourself able to do so, maybe you didn't actually set them friendly or forgot to save the level & refresh the tester.

npc txt files are attached to the npc by the filename. the npc-1.txt file will apply to npc 1, which uses npc-1.png. to edit images, download an image editing software like gimp or paint.net.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Re: Npc Dmg and Npc scaling

Postby Cigarettes » Fri Nov 08, 2019 1:56 pm

Enjl wrote:
Fri Nov 08, 2019 1:24 pm
friendly npcs are, by definition, immune to interaction from any other npc. you cannot jump on them or kill them. if you find yourself able to do so, maybe you didn't actually set them friendly or forgot to save the level & refresh the tester.

npc txt files are attached to the npc by the filename. the npc-1.txt file will apply to npc 1, which uses npc-1.png. to edit images, download an image editing software like gimp or paint.net.
ok so if i have my image file set npc-1 gif....i can make a text doc with name put it the same folder and it will auto attach basiclly?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8230
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Npc Dmg and Npc scaling

Postby Enjl » Fri Nov 08, 2019 1:57 pm

yes
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Re: Npc Dmg and Npc scaling

Postby Cigarettes » Fri Nov 08, 2019 2:05 pm

Enjl wrote:
Fri Nov 08, 2019 1:57 pm
yes

Sounds good will the image auto stretch?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8230
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Npc Dmg and Npc scaling

Postby Enjl » Fri Nov 08, 2019 2:09 pm

Cigarettes wrote:
Fri Nov 08, 2019 2:05 pm
Enjl wrote:
Fri Nov 08, 2019 1:57 pm
yes

Sounds good will the image auto stretch?
No. The default renderer has no stretching capabilities. the gfxwidth/gfxheight properties merely tell smbx how much space to allocate for one frame of the image to draw from the spritesheet.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Re: Npc Dmg and Npc scaling

Postby Cigarettes » Fri Nov 08, 2019 2:17 pm

Enjl wrote:
Fri Nov 08, 2019 2:09 pm
Cigarettes wrote:
Fri Nov 08, 2019 2:05 pm
Enjl wrote:
Fri Nov 08, 2019 1:57 pm
yes

Sounds good will the image auto stretch?
No. The default renderer has no stretching capabilities. the gfxwidth/gfxheight properties merely tell smbx how much space to allocate for one frame of the image to draw from the spritesheet.
Ok so make the text doc first then make the npc gif got it you have been real helpful.

Added in 11 minutes 22 seconds:
Enjl wrote:
Fri Nov 08, 2019 2:09 pm
Cigarettes wrote:
Fri Nov 08, 2019 2:05 pm
Enjl wrote:
Fri Nov 08, 2019 1:57 pm
yes

Sounds good will the image auto stretch?
No. The default renderer has no stretching capabilities. the gfxwidth/gfxheight properties merely tell smbx how much space to allocate for one frame of the image to draw from the spritesheet.
One more question if i make the text doc do you need to put in every single code? or just the ones i need?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8230
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Npc Dmg and Npc scaling

Postby Enjl » Fri Nov 08, 2019 2:31 pm

Just the ones you need. I usually make the images first, because when I have the image done I know what to write into the txt files (dimensions, number of frames, etc). Either works, though.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Re: Npc Dmg and Npc scaling

Postby Cigarettes » Fri Nov 08, 2019 2:52 pm

LGLMAKING wrote:
Fri Nov 08, 2019 6:48 am
Cigarettes wrote:
Thu Nov 07, 2019 6:37 pm
Having a hard time try to figure out how to make my npc take no hits and be friendly... Is there a way? Can i increase npc size using smbx 1.3? I have made alot of sprites for this project so far but for remaining sprites i need to upscale them.
There is an option called "friendly". It makes npc's invulnerable and let's you use the message option. In fact, you can tie events to this. For your second question, you'll need custom graphics. Once you got those, check the dimensions of the image files. Pay attention to the size on the y-axis. Divide this number by the number of frames to get the graphicsheight. The graphicswidth can be read simply by clicking on the image in the same way you found the height of your gfx. Create a .txt document named after the npc you want to resprite (for example the name for the smb3 goomba used by SMBX is npc-1).

Write the following lines for the hitboxes and gfxsize:
gfxwidth=width of your sprites
gfxheight=well, you read how to calculate graphicsheight above, right?
width=width of your enemy's hitbox
height=height of your enemy's hitbox

Hope that helps
Where do i find out how many frames an npc uses? to get my Gfxheight?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8230
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Npc Dmg and Npc scaling

Postby Enjl » Fri Nov 08, 2019 3:04 pm

gfxheight is height of one frame. frames is number of frames per facing direction on the sprite sheet. that number depends on how you choose to arrange the sprite sheet. a goomba has 2 frames on framestyle 0, a koopa has 2 frames on framestyle 1, and a shy guy has 2 frames on framestyle 2.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Re: Npc Dmg and Npc scaling

Postby Cigarettes » Fri Nov 08, 2019 3:56 pm

ok so each picture in the the sprite sheet is a frame. so goombas have 2 frames and if i take the width of it and divide it by 2 i get my new height?

User avatar
Hoeloe
Grinder
Grinder
Posts: 1166
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Current Project: A2XT Episode 2

Re: Npc Dmg and Npc scaling

Postby Hoeloe » Fri Nov 08, 2019 8:38 pm

Not the width. Take the height of the entire image file and divide it by two to get the height of a single frame. Also you should be using .png files rather than .gif files if you're using SMBX2 (and I would strongly suggest using SMBX2 over 1.3).

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8230
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Npc Dmg and Npc scaling

Postby Enjl » Sat Nov 09, 2019 1:59 am

To illustrate:
Image
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
LGLMAKING
Ripper II
Ripper II
Posts: 305
Joined: Mon Jun 18, 2018 7:28 am
Flair: There's always another secret.
Current Project: Captain Toad: Shine Scramble

Re: Npc Dmg and Npc scaling

Postby LGLMAKING » Wed Nov 13, 2019 5:54 am

Oh yeah, there's a setting for your specified "friendliness". Simply use this npc code:

nohurt=1

and if you want to prevent the player from simply jumping on it combine that with this:

jumphurt=1

Note it doesn't work with spinjumps
"I am incredibly lucky I know you and im glad I gave you a chance to be a part of this" -Eri7
Image
Image
Image
Pretty much nearly the co-producer of the Novaverse (see links above)

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8230
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Npc Dmg and Npc scaling

Postby Enjl » Wed Nov 13, 2019 11:54 am

LGLMAKING wrote:
Wed Nov 13, 2019 5:54 am
Oh yeah, there's a setting for your specified "friendliness". Simply use this npc code:

nohurt=1

and if you want to prevent the player from simply jumping on it combine that with this:

jumphurt=1

Note it doesn't work with spinjumps
Does not simulate friendliness, enemies can still die to other enemies. Using a mix of nohurt=true jumphurt=true spinjumpsafe=false nogravity=true noblockcollision=true CAN be useful for making wacky intangible npcs for decoration, but that's far from the topic at hand and fairly cumbersome in general.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Re: Npc Dmg and Npc scaling

Postby Cigarettes » Wed Nov 20, 2019 10:09 pm

Image

When i try to place her on screen it shows all 4 of her blinking how do i make it normal this is Npc-164 replacement

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8230
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Npc Dmg and Npc scaling

Postby Enjl » Thu Nov 21, 2019 12:11 am

frames=2
framestyle=1

Compare the contents of this post with the image I sent above to understand it better.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Cigarettes
Spiny
Spiny
Posts: 49
Joined: Fri Oct 25, 2019 9:15 am
Chat Username: Cigs

Re: Npc Dmg and Npc scaling

Postby Cigarettes » Thu Nov 21, 2019 3:45 pm

gfxwidth=602----size of whole picture
gfxheight=1596----size of whole picture
width=602------------------don't know for npc 164
height=386-----------------don't know for npc 164
frames=2
framestyle=1
anything else i am missing here? your image help is good but im unsure of this npc the goal is to ride the rabbit like you would ride the mole in super mario world


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 3 guests