Jump to content
  • 0
snowflake1963

Adding New NPCs

Question

Hello All :)

 

I would like to add new NPCs without having to replace any current ones.

I am wondering if it is possible to do so and how to do it.

 

Thank you in advance for any help that is given.

 

mfg

Snowflake

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

You mean making NPCs from scratch?

 

Sure, simply make a new file (preferably .txt for ease of editing, but the extension doesn't matter at all since you could have it .c or even without extension if you want) wherever you like within the npc/ folder (you can even make a new folder inside it!) and add your NPC there. In fact, it's not even needed to put your script inside npc/, but that helps your tidyness.

 

For loading it, you could use the @loadnpc <path> script command or the loading structure that is called at bootup. I reccommend seeing examples directly in some files like npc/scripts.conf, which is better than giving an explanation and will let you know exactly what it asks for a location.

 

You can also read this part, extracted from doc/script_commands.txt to let you know a bit more:

 

Script loading structure
------------------------
 
Scripts are loaded by the map server as referenced in the
'conf/map-server.conf' configuration file, but in the default
configuration, it doesn't load any script files itself. Instead, it loads
the file 'npc/scripts_main.conf' which itself contains references to other
files. The actual scripts are loaded from txt files, which are linked up
like this:
 
npc: <path to a filename>
 
Any line like this, invoked, ultimately, by 'map-server.conf' will load up
the script contained in this file, which will make the script available.
No file will get loaded twice, to prevent possible errors.
 
Another configuration file option of relevance is:
 
delnpc: <path to a filename>
 
This will unload a specified script filename from memory, which, while
seemingly useless, may sometimes be required.

 

Hope I helped on it. Else please restate your question since I may have misunderstood.

Share this post


Link to post
Share on other sites
  • 0

@Mhalicot

I do mean new npcs, because whenever i add an npc by using an existing npc id kro decides to use that npc somewhere :)

so i want add the new npcs with their own ids.

 

@jaBote

I know how to load an npc in a script but thank you :)

Like i said to Mhalicot when ever i use an npc like for example the tw_tower, kro does updates

and adds the npc as a result of kro updates my npcs look like the tw_tower.

i want to add without replacing an already kro npc.

 

mfg

Snowflake

Share this post


Link to post
Share on other sites
  • 0

you could use a far way ID from kRO's current last ID #

for example : JT_4_TOWER_15 = 10002,

                     JT_COMMERCIALRICE_1 = 10105

or why not add your lub files in your custom grf

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.