Pet - Go To Checks

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

Pet - Go To Checks

Postby Etaew » Tue May 24, 2011 10:29 am

As found on the Dominvm forums, as they use outdated code I had to check ours. And it seems we don't have any target in view or range checks.

I don't know if these checks are from live, but it makes sense to me.

http://dominivm.org/forum/showthread.ph ... 38#pid5138

Obviously message feedback is required too ;)
Retired DOL Enthusiast | Blog
User avatar
Etaew
Inactive Staff Member
 
Posts: 7602
Joined: Mon Oct 13, 2003 5:04 pm
Website: http://etaew.net
Location: England

Re: Pet - Go To Checks

Postby Hiatus » Tue May 24, 2011 10:41 am

I can't register ;/
Graveen wrote:If you can't see the problem, then this is the problem :mrgreen:
Hiatus
Support Team
 
Posts: 263
Joined: Sat Apr 30, 2011 3:54 pm

Re: Pet - Go To Checks

Postby Etaew » Tue May 24, 2011 10:46 am

I can't register ;/
Ah yes, I had to register too.

Is annoying, they should make the forum public.
Retired DOL Enthusiast | Blog
User avatar
Etaew
Inactive Staff Member
 
Posts: 7602
Joined: Mon Oct 13, 2003 5:04 pm
Website: http://etaew.net
Location: England

Re: Pet - Go To Checks

Postby geshi » Tue May 24, 2011 1:29 pm

It says you have to register at http://dominivm.org/administrator/index.php ..

When I try I get the error "Username and password do not match" :lol:
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: Pet - Go To Checks

Postby Etaew » Tue May 24, 2011 1:42 pm

I used the register link on the dominivm.org home page.
Retired DOL Enthusiast | Blog
User avatar
Etaew
Inactive Staff Member
 
Posts: 7602
Joined: Mon Oct 13, 2003 5:04 pm
Website: http://etaew.net
Location: England

Re: Pet - Go To Checks

Postby Tolakram » Tue May 24, 2011 1:46 pm

Sorry but you cannot register at this time because the administrator has disabled new account registrations.

edit: I was able to register from their homepage.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Pet - Go To Checks

Postby Etaew » Wed May 25, 2011 9:27 pm

Anyway, I won't make a patch at the moment. In case you can't visit their forum.

This is some thrown together code to not allow a pet to be moved to a target if you cant see the target. Perhaps a message should be sent to the player too.
Code: Select all
public virtual void CommandNpcGoTarget()
{
IControlledBrain npc = ControlledBrain;
if (npc == null)
return;

if (npc.Body.IsConfused) return;

GameObject target = TargetObject;
if (target == null)
{
Out.SendMessage(LanguageMgr.GetTranslation(Client, "GamePlayer.CommandNpcGoTarget.MustSelectDestination"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

//Etaew - check target in view
if (!m_targetInView)
return;
//end Etaew
Out.SendMessage("You command " + npc.Body.GetName(0, false) + " to go to your target.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
npc.Goto(target);
}
Retired DOL Enthusiast | Blog
User avatar
Etaew
Inactive Staff Member
 
Posts: 7602
Joined: Mon Oct 13, 2003 5:04 pm
Website: http://etaew.net
Location: England

Re: Pet - Go To Checks

Postby Dinberg » Thu May 26, 2011 9:39 am

When does targetInView get updated? I think it would be better to end this void with a LOScheckRequest to the client, then send the pet to the target in the callback of the los check's reply if it can be seen.
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: Pet - Go To Checks

Postby Tolakram » Thu May 26, 2011 11:43 am

TargetInView is not 100% reliable, might not even be 10% reliable. It is set on the client if the client can clearly tell your target is not in view (behind a fixed client structure). The bit is set on the client and updated during the player position update (this is my best guess). Only LOS calls will be 100% accurate, though if TargetInView is false you can be fairly certain LOS will fail as well.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Pet - Go To Checks

Postby Dinberg » Fri May 27, 2011 12:22 am

Good call, I like that; use the targetInView to check whether to send the los.
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest