Jump to content
  • 0

Facing problem on adding custom npc Sprite/ID


NoWayHome

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   0
  • Joined:  02/23/22
  • Last Seen:  

Hi rAthena!

I am facing problem on adding custom npc even thou I have follow all the guide that shown on all previous topic.

After done adding the custom npc spr/act,
I also edited jobname.lub and npcidentity.lub
and yes I have also edited src/map/npc.hpp and script_constants.hpp

After I recompile my server I still failed to load my new custom npc sprite.
Can anyone please guide the correct way to add on my custom npc?

P/S: this all were the guide I have done research. 

 sorry for my bad english.
If i post on the wrong place please move my topic to the correct one, Thank You Very Much!!

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

i followed the guide from here/

https://herc.ws/wiki/Custom_NPC

after changing files from npc.hpp you need to recompile

 

jobname.lub

 [jobtbl.JT_kakashi] = "kakashi",

 

npcidentity.lub

JT_kakashi = 10500,

 

Npc.hpp

JT_kakashi = 10500,

find #define MAX_NPC_CLASS2_END NPC_RANGE3_END change to

#define MAX_NPC_CLASS2_END 10900

 

GRF Side

data\sprite\npc\

kakashi.act

kakashi.spr

 

finally on script side

prontera,143,143,4    script    Kakashi    10500,{

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   0
  • Joined:  02/23/22
  • Last Seen:  

On 3/6/2022 at 4:51 PM, kalabasa said:

i followed the guide from here/

https://herc.ws/wiki/Custom_NPC

after changing files from npc.hpp you need to recompile

 

jobname.lub

 [jobtbl.JT_kakashi] = "kakashi",

 

npcidentity.lub

JT_kakashi = 10500,

 

Npc.hpp

JT_kakashi = 10500,

find #define MAX_NPC_CLASS2_END NPC_RANGE3_END change to

#define MAX_NPC_CLASS2_END 10900

 

GRF Side

data\sprite\npc\

kakashi.act

kakashi.spr

 

finally on script side

prontera,143,143,4    script    Kakashi    10500,{

Hi @kalabasa thanks for your reply!
But I still failed to load my custom npc sprite in the game.

Can you help me check is there any problem with the steps I've done?
Or maybe I did it wrongly please correct me! 
Appreciate for help!



 

sprite.png

jobname.png

npcidentity.png

npchpp.png

script.png

putty.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

40 minutes ago, NoWayHome said:

 @kalabasa


 

sprite.png

 

 

 

 

 

Im not expert to these but i think here your problem was on the npc file itself? it says 0 Bytes? meaning its an empty file thats why it wont load.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   0
  • Joined:  02/23/22
  • Last Seen:  

9 hours ago, kalabasa said:

Im not expert to these but i think here your problem was on the npc file itself? it says 0 Bytes? meaning its an empty file thats why it wont load.

Okay, I have uploaded the right act/spr files again, same problem appear =(

Any Idea?

[Error]: status_set_viewdata (NPC): No view data for class 30000t
[Debug]: Source (NPC): Recruitment Board at vip_lounge (152,131)

 

Edited by NoWayHome
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

sorry if i cant help last thing try to use my npc id that i use 10500

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

your value shouldn't exceed 

NPC_RANGE3_END
JT_NEW_NPC_3RD_END = 19999,
JT_gprecruit = 20100,
NPC_RANGE3_END, // Officia: JT_NEW_NPC_3RD_END=20101

now you have set the NPC ID at 20100, and you have 100 free slot in front  to cater official server adding more NPC in future.

its not recommend to jump to a high number since it wasting your server memory

 

or ... just adjust this if you are confident.

//Checks if a given id is a valid npc id. [Skotlex]
//Since new npcs are added all the time, the max valid value is the one before the first mob (Scorpion = 1001)
#define npcdb_checkid(id) ( ( (id) > NPC_RANGE1_START && (id) < NPC_RANGE1_END ) || (id) == JT_HIDDEN_WARP_NPC || ( (id) > NPC_RANGE2_START && (id) < NPC_RANGE2_END ) || (id) == JT_INVISIBLE || ( (id) > NPC_RANGE3_START && (id) < NPC_RANGE3_END ) || ( (id) >= 30000 && (id) <= 31000))

then you can use id between 30000 ~ 31000.

Edited by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   0
  • Joined:  02/23/22
  • Last Seen:  

Hi @Emistry I have tried what u told me but it appear act/spr error when load the npc.

//Checks if a given id is a valid npc id. [Skotlex]
//Since new npcs are added all the time, the max valid value is the one before the first mob (Scorpion = 1001)
#define npcdb_checkid(id) ( ( (id) > NPC_RANGE1_START && (id) < NPC_RANGE1_END ) || (id) == JT_HIDDEN_WARP_NPC || ( (id) > NPC_RANGE2_START && (id) < NPC_RANGE2_END ) || (id) == JT_INVISIBLE || ( (id) > NPC_RANGE3_START && (id) < NPC_RANGE3_END ) || ( (id) >= 30000 && (id) <= 31000))
Edited by NoWayHome
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

On 3/9/2022 at 8:04 PM, Emistry said:

its not recommend to jump to a high number since it wasting your server memory

for clarifications

does the higher number means

the given range slots of NPC that you mentioned or

higher NPC id's ?

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

3 hours ago, kalabasa said:

the given range slots of NPC that you mentioned or

range slot, when the server startup it will auto allocate some space to hold the npc view data

if you assigned too much free slot, you are just wasting ur resources.

3 hours ago, kalabasa said:

higher NPC id's ?

and value shouldn't exceed NPC_RANGE3_END (unless you know exactly what you are trying to do), else no resources will be allocated for the npc view data.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...