Fork me on GitHub
How to make NPC;s Follow each other
Post: #1
Good day

Can any one help me with this

I need to make 3 npc's walk behind each other and i have no clue on how to go forth.

i use the .npc follow command ingame but the dam one just follows me.

any help will be apreciated.

Thank you.

NP. I have posted this in Project Silvermoon and in Scripdev2 forum.

I realy need this help fast.
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction." - Albert Einstein
Reply
Post: #2
well pretty easy...

First you should see the UDB forum for this.
Second cmangos team implemented a new system called creature linking.

the easiest way is to use that creature_linking or creature_linking_template tables.
But use creature_linking.

Code:
INSERT INTO creature_linking VALUES
(@slaveguid, @masterguid, map);

Insert the line with the proper modifications into db, restart the server and you have it all working
-- Axxl
[-] The following 1 user says Thank You to alexluana for this post:
  â€¢ SADraco
Reply
Post: #3
alexluana you the best works awsome thank you very much.
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction." - Albert Einstein
Reply
Post: #4
Noooooo

_ALWAYS_ use by entry f possible. In this case use creature_linking_template
guids are evil!
Reply
Post: #5
what do you mean by this

Sorry i learn as i go along
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction." - Albert Einstein
Reply
Post: #6
for creature linking, you have two possibilities
1 link by guid with `creature_linking` table
2 link by entry with `creature_linking_template` table.

If possible, always use the second way. Because guids are evil.
Just not use guids unless you absolutely have to
Reply
Post: #7
ok so let me get this strait

if one is spawned of a creature rathere use `creature_linking_template` and if many is spawned you dont realy have a option but to use `creature_linking`
like

More than one of a creature use

Quote:INSERT INTO creature_linking VALUES
(@slaveguid, @masterguid, map);

one of each creature - rather use

Quote:INSERT INTO creature_linking_template VALUES
(@slaveentry, @masterentry, map);

is that correct

thank you for the advice.
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction." - Albert Einstein
Reply
Post: #8
Depends again.
creature_linking_template has an (optional) range column.
If the range is 0, than the linking will be map-wide.
if it is > 0 it will always affect npcs each within the range.

So, you can have many "slaves" following one unique master, this will work just fine with c_l_t(range =0)

But you also might have multiple groups of same setup, say a big npc, and 2 little adds, then using c_l_t with range > 0 can work to link the little adds together to the correct big npc.

Edit:
Main difference is the question:
Should all npcs of entry Y be linked to any npc of entry X.
if this is true, c-l-t is most likely proper.

So, if you have two npcs of entry Y, but one should be an individual, and the other not, then linking will have to be done by guid Sad
In every other case there should be a way to use linking by entry
Reply
Post: #9
may i ask do you have a example of how this code would look like for instance main npc in middle and one on left side and one on right side.

and do you have to put in the xyz co ordinits of each slave seprate for starting points.

again sorry for the stupid questions but i do find this very intresting.

and is there a way like a zone or limit to say how far the slave must be from the master
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction." - Albert Einstein
Reply
Post: #10
Just copy the creature_linking_template from either ytdb or udb and take a look around how the linked mobs behave
There should be examples for nearly all cases
(make sure to checkout some with range and some without range)
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Question Make creature stop and stay on waypoint stavaren 4 697 03-02-2017, 04:22 PM
Last Post: stavaren
  purpose of make some movement ack message magiceye 2 1,498 10-16-2015, 01:54 AM
Last Post: magiceye

Forum Jump:


Users browsing this thread: 1 Guest(s)

Continued MaNGOS | Return to Top | | Lite (Archive) Mode | RSS Syndication