Search found 9 matches

by FiftyTifty
Wed Mar 08, 2023 4:11 pm
Forum: Discussion
Topic: Making an NPC walk from Lumbridge to Varrock?
Replies: 2
Views: 6363

Re: Making an NPC walk from Lumbridge to Varrock?

You are attempting to do something the NPC system is fundamentally incapable of, because NPCs are not designed to go that far. In fact, there's mechanics in place that *stop* NPCs from moving that far. Also, even if NPCs didn't have their own movement mechanics, you physically can't pathfind from l...
by FiftyTifty
Wed Mar 08, 2023 2:33 pm
Forum: Discussion
Topic: Making an NPC walk from Lumbridge to Varrock?
Replies: 2
Views: 6363

Making an NPC walk from Lumbridge to Varrock?

Now that I have a basic script going that spawns a few NPC instances, I'd like to make them move about. I've made two attempts, with their own problems. val locSpawn = Location.create(3225, 3220, 0) //Lumbridge val locDestination = Location.create(3211, 3386, 0) //Varrock 1. Use NPC.configureMovemen...
by FiftyTifty
Wed Mar 08, 2023 2:17 pm
Forum: Discussion
Topic: Beginner - How to add a custom script?
Replies: 9
Views: 7447

Re: Beginner - How to add a custom script?

I got the baiscs done for the script. I'll share it here for posterity. It has three parts. 1. OnStartup() - Spawns the NPCs, and creates two lists. One for NPCs, and another for their dialogue tick counters. 2. OnTick() - Used to iterate through the list of dialogue tick counters and reduce them by...
by FiftyTifty
Tue Mar 07, 2023 2:56 pm
Forum: Discussion
Topic: Beginner - How to add a custom script?
Replies: 9
Views: 7447

Re: Beginner - How to add a custom script?

Made progress! So to actually add a script, you can save it anywhere you like in the `src\main\core` package. I made a new package called scripts and added a new Kotin class file inside of it. https://i.imgur.com/KzULTvI.png For the .kt file, you need a few things: 1. Import the ContentAPI and liste...
by FiftyTifty
Tue Mar 07, 2023 1:23 pm
Forum: Discussion
Topic: Beginner - How to add a custom script?
Replies: 9
Views: 7447

Re: Beginner - How to add a custom script?

Right, so made a bit of progress. First up, was to add a function to ContentAPI.kt that allows you to spawn an NPC through a script. I added the following block of code: /** * Spawns an NPC, based off of the ::npc command * @param id The ID of the NPC to create an instance of * @param location Where...
by FiftyTifty
Mon Mar 06, 2023 8:08 pm
Forum: Discussion
Topic: Beginner - How to add a custom script?
Replies: 9
Views: 7447

Re: Beginner - How to add a custom script?

Ah, I understand what you mean. Sorry, I should have clarified better.

Yes, I'd like to spawn a specific instance of an NPC ID, and give it custom logic. That's actually exactly what I'm after; creating unique instances with custom behaviour, from the same base IDs.
by FiftyTifty
Mon Mar 06, 2023 7:42 pm
Forum: Discussion
Topic: Beginner - How to add a custom script?
Replies: 9
Views: 7447

Re: Beginner - How to add a custom script?

Oh of course, I'm well aware I'm a complete noob going into a mature project blind. That's all dream stuff at this point in time. It'd be like trying to code something on the level of the adventurer bots. I'm keeping the scope real small with this first project: Spawn npc, make them say something.
by FiftyTifty
Mon Mar 06, 2023 7:34 pm
Forum: Discussion
Topic: Beginner - How to add a custom script?
Replies: 9
Views: 7447

Re: Beginner - How to add a custom script?

There's about 5 different ways to do this and 3 of them are correct depending on purpose. I'm looking to do this with Java, rather than simple database or JSON entries. My end goal is to dynamically spawn unique and persistent NPCs, create sandbox behaviour for them, and remove them completely when...
by FiftyTifty
Mon Mar 06, 2023 7:07 pm
Forum: Discussion
Topic: Beginner - How to add a custom script?
Replies: 9
Views: 7447

Beginner - How to add a custom script?

Found this cool project earlier today, and had a go at getting the server downloaded, set up, and compiled. The wiki instructions were on point, so it was not difficult at all. Now I'd like to start with a custom script that does the following: 1. Print a message to the console when the server start...