This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] Creature waypoints  (Read 856 times)

Temptation_Town

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 64
    • View Profile
[QUESTION] Creature waypoints
« on: August 28, 2014, 11:57:56 pm »
I was trying to make custom waypoints for my NPCs and then I discovered that their movement is triggered by presence of a player, not by start of worldserver.exe. I was flying between different zones with my NPCs and it was looked like all their actions were stoped when I leaved their area.

As I understand this one is a result of DB way of making waypoints.

This is a problem because I need "live" creature behavior even without players in their zones.

So the question is: Will I get the same result with creature scripts in the core? Because I remember something like "creature AI updates with map updates which are trigerred by player".
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Amaroth

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1219
    • View Profile
    • Amaroth's Tools
Re: [QUESTION] Creature waypoints
« Reply #1 on: August 29, 2014, 01:52:55 am »
Problem is that server work with most of funkcions related to spawned NPCs and GOBs only when they are loaded, which means that some player is (or recently, a few minutes ago was) on sight distance from them (which can be modified in config, however, it is limited to 533yd, basic is (I think) 150yd). I don't know how many things would need to be changed to achieve what you want, but I fear it would turn your server into happy laggy land.

I would rather think about using of game_events. Just spawn more creatures, give each one of them another waypoint path ofr another daytime and then add every one of them to different game_event. Probably the easiest and the fastest way how to make this work.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

Want to support me for my releases and/or tutorials? You can send donation via Paypal to:
jantoms@seznam.cz

Temptation_Town

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 64
    • View Profile
Re: [QUESTION] Creature waypoints
« Reply #2 on: August 29, 2014, 02:34:44 am »
Thanks for your answer.

Quote from: "Amaroth"

I would rather think about using of game_events. Just spawn more creatures, give each one of them another waypoint path ofr another daytime and then add every one of them to different game_event. Probably the easiest and the fastest way how to make this work.

As I understand I'll get more spawned creatures from each game_event spawn but all of them will stay on their spot until some player triggers their movement.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Amaroth

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1219
    • View Profile
    • Amaroth's Tools
Re: [QUESTION] Creature waypoints
« Reply #3 on: August 29, 2014, 02:54:19 am »
Ah, seems you are not familiar with game_events. Game_events have 2 base funkcions (when refering only to NPCs) - they hide NPCs which are marked to not be spawned during them, and unhide NPCs which are marked to be spawned during them.

For instance, you will create game_event with ID 5 which will occur once per day for 8 hours, meaning it will  be active only, lets say from 8 AM to 4 PM every day (this is done in game_event table). Then, you can add creature into game_event_creature and link it with event.

For instance, you want creature with GUID 654 to NOT be spawned during event (it is lets say blacksmith who is sleeping at home, but during this event he's working at smithy, so you will want to have sleeping blacksmith hidden) and creature with GUI 721 to BE spawned, because thats the blacksmith, who is at smithy, going around, working there and so on.

So all you will need to do is to add 2 rows into game_event_creature, one will have eventEntry 5 and GUID 721 (NPC 721 will BE spawned during event with ID 5), while the second row will have eventEntry -5 and GUID 654 (NPC 654 will NOT be spawned during event with ID 5).

Now, you have 2 blacksmiths, one spawned at forge only during the event, one despawned during the event, meaning whenever there will be no blacksmith at forge, he will be spawned at home. Then you can just create two waypoint paths with scripts, emotes and such stuff, one for man resting at home and one for our heroic worker and... you are done.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

Want to support me for my releases and/or tutorials? You can send donation via Paypal to:
jantoms@seznam.cz