Sign in to follow this  
Tritian

Guide To Adding Sprites

Recommended Posts

I'm relatively new to HB sources but I was playing around just for some knowledge.

 

I managed to add new spells in myself. It seemed pretty easy.

 

Monster sprites on the other hand, I'm having problems with.

 

Could anyone help and post as to which functions should be looked at?

Also, can someone explain what these mean?

 

 

MakeSprite( "GiantPlant", DEF_SPRID_MOB + 7*8*66, 40, TRUE);// Giant-Plant (Type: 76)

 

I.e, the 7*8*66, 40 part

 

Thanks a lot!

Share this post


Link to post
Share on other sites

Through some progression, I had managed to get the monsters to be accepted into the Client. Just as I summon the monster though, the client crashes. Any explanation?

Share this post


Link to post
Share on other sites

I searched in all files for the following: 'Slime'

 

Where ever there was a case or anything related to a slime, I added the new NPC.

 

The two main files were Game.cpp and Mapdata.cpp that contained sprites, sounds etc for the mob.

 

Share this post


Link to post
Share on other sites

MakeSprite( "GiantPlant", DEF_SPRID_MOB + 7*8*66, 40, TRUE);// Giant-Plant (Type: 76)

 

1- "GiantPlant" is the name of the sprite. Slime is = Slm, Skeleton is = skel and so on.

 

2- DEF_SPRID_MOB + 7*8*66 are the index of the sprites. DEF_SPRID_MOB will be always the same for all the mobs, so if you want to add a new mob you must use DEF_SPRID_MOB. The only thing that will change is the 7*8*66.

 

Use hbpak_editor to see these things that i'm going to explain you.

 

7 = amount of frames on the sprites

8 = amount of sprites for npc behavior. For example: NPC attacking has 8 sprites

66 = The "MONSTER ID". Really this isn't de monster id but it's an idea. For example. if your last monster on MakeSprite was 7*8*66 and you want to add another mob, you will have to do something like that: 7*8*67. For other monster: 7*8*68 and so on.

 

Also you have a lot of methods that draw the mobs, you have to check on those methods too. Just see how the others mobs are drawn.

 

methos like: DrawNpc_OnStop or something like that.

Share this post


Link to post
Share on other sites

MakeSprite( "GiantPlant", DEF_SPRID_MOB + 7*8*66, 40, TRUE);// Giant-Plant (Type: 76)

 

1- "GiantPlant" is the name of the sprite. Slime is = Slm, Skeleton is = skel and so on.

 

2- DEF_SPRID_MOB + 7*8*66 are the index of the sprites. DEF_SPRID_MOB will be always the same for all the mobs, so if you want to add a new mob you must use DEF_SPRID_MOB. The only thing that will change is the 7*8*66.

 

Use hbpak_editor to see these things that i'm going to explain you.

 

7 = amount of frames on the sprites

8 = amount of sprites for npc behavior. For example: NPC attacking has 8 sprites

66 = The "MONSTER ID". Really this isn't de monster id but it's an idea. For example. if your last monster on MakeSprite was 7*8*66 and you want to add another mob, you will have to do something like that: 7*8*67. For other monster: 7*8*68 and so on.

 

Also you have a lot of methods that draw the mobs, you have to check on those methods too. Just see how the others mobs are drawn.

 

methos like: DrawNpc_OnStop or something like that.

 

 

Thank you so much!

Really appreciate the help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this