Jump to content

shikyo

Members
  • Posts

    4
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

About shikyo

  • Birthday 01/01/1

shikyo's Achievements

Newbie

Newbie (1/3)

0

Reputation

  1. Okay, so I solved this problem now. In case anyone is looking for a way to do this, I'll briefly go over what I did. 1. I started out with rewriting the CreatureLinkingMgr to use GUID rather than entry ID (don't really get why it was entry ID to begin with ). 2. Then I added an update function to the LinkingMgr's holder class, as well as made the creature class call that function every 2.5 secs if it was a) a slave and b) had the follow flag. So the creature update function would be something like this: Creature::Update(): if (m_creatureLinkingSlaveFollower) // AddSlaveToHolder() now returns bool if it needs regular updating { if (m_creatureLinkingSlaveTimer < update_diff) { GetMap()->GetCreatureLinkingHolder()->DoLinkingUpdateEvent(this); m_creatureLinkingSlaveTimer = 2500; } else m_creatureLinkingSlaveTimer -= update_diff; } 3.In the CreatureLinkingMgr's update function I check if distance is further than max_dist (which is a new float added to the creature_linking_template), and if it is I use MovePoint to catch up, kind of like this: if (!pWho || !pWhom) return; // (left out get delta x and y for space) float dist = sqrt(dx*dx + dy*dy); dist = dist - pWho->GetObjectBoundingRadius() - pWhom->GetObjectBoundingRadius(); if (dist < 0.0f) dist = 0.0f; CreatureLinkingInfo const *pInfo = sCreatureLinkingMgr.GetLinkedTriggerInformation(pWho); if (dist < pInfo->max_dist) return; pWho->GetMotionMaster()->MovePoint(0, pWhom->GetPositionX(), pWhom->GetPositionY(), pWhom->GetPositionZ()); 4.The last touch was to get the creature to pickup the waypoint system (so it wouldn't wanna keep going back to the old WPs), the first touch was another HasInArc function with different parameters: bool HasInArc( const float arcangle, const float posAngle ) const; // So we don't have to use a game object 5.The last part was adding some extra code to the WaypointMovementGenerator.cpp. It's split up like this: OnArrive(): m_arrivedAsIntended = true; // We did not get interrupted by MovePoint StartMove(): if (creature.IsLinkingFollower() && !m_arrivedAsIntended) { for whole i_path list: { // Is this WP closer than the last? And, is it also in front of us (we don't wanna be going back) if (newDist < distance && creature.HasInArc(M_PI_F, angle)) closestWP = this one; dist = newDist; } i_currentNode = closestWP; } m_arrivedAsIntended = false; And that is the mist of the system. It's not the most delicate system, but at least it works. Hope this helps someone in a similar pickle.
  2. Don't mean to bump my own question, but I'm looking for some information about trying to modify the core to allow better group patrolling. Anyone have any idea or tip for me? Lost atm, tried a lot of stuff, but don't really know how I could get the patrols in synch. So, I'm basically looking for some brain storming; if you have ever thought about implementing something that would make mobs go in synch, or if you have a clue how it might be done, please do share some of that information. I really need it . Thanks!
  3. Thanks for your answer. You wouldn't happen to know how other cores implement this ?
  4. Hey, so I've been trying to get 3 mobs to walk alongside each other in a given path. The thing is they're turning, which means the path is of different lengths for each mob. This results in the mobs, after walking for a while, getting out of synch. I have been trying to get them in synch by testing various values on wait time, and the more I try the closer I get; but since they walk back and forth they eventually get out of synch it seems, no matter how much I tweek the wait times. So, my question is simply; is there some way, say through a script or something, to get them to go in synch? I'm thinking of two possible options: 1) A rendezvous point, where the mobs all wait until the three of them have reached their corresponding point. 2) Modified speed on the shorter pathed mob and the in the middle mob. Are either of these solutions doable? And if so, care to give me a hint? Been looking all over to find a solution, but to no avail. Huge thanks to anyone able to answer my question. (P.S. Just noticed that creature_linking_template has a FLAG_FOLLOW, is that something I could apply here?)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use