Neshoba

Member
searched a few site and they all deadended at this but nobody pointed out what to do with it :(
[Constructable]
public Slave() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 ) something to do with these ###
any help would be appreaciated have a few pets that want keep up with players as the run
 
The last two, doubles, are Passive 0.2 and Active 0.4 speeds
Active = battle mode

I always get this confused but higher numbers are faster, I think
0.4 is lower than 0.2
 
lower should be faster ;) I am pretty sure it is basically the wait time between each move. Active comes first in the parameters and is lower so :p
 
searched a few site and they all deadended at this but nobody pointed out what to do with it :(
[Constructable]
public Slave() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 ) something to do with these ###
any help would be appreaciated have a few pets that want keep up with players as the run

Dont change anything to do with the individual scripts speed. It has to do with pets in general and commands in general.

In BaseAI.cs

public virtual bool DoOrderCome()
under Debug("My master told me to come.

change to
Code:
//Change Speed
					var mOnHorse = _Mobile.ControlMaster.Mount != null;
					var mDirection = _Mobile.ControlMaster.Direction;
					var mRunning = (mDirection & Direction.Running) != 0;

					bool WMR;

					if (mOnHorse)
					{
						_Mobile.CurrentSpeed = (mRunning ? .1 : .15);
						WMR = WalkMobileRange(_Mobile.ControlMaster, 2, true, 0, 1);
					}
					else
					{
						_Mobile.CurrentSpeed = (mRunning ? .2 : .25);
						WMR = WalkMobileRange(_Mobile.ControlMaster, 2, mRunning, 0, 1);
					}
if (WMR)
					{
						if (_Mobile.Combatant != null && !_Mobile.Combatant.Deleted && _Mobile.Combatant.Alive &&
							!_Mobile.Combatant.IsDeadBondedPet)
						{
							_Mobile.Warmode = true;

							if (!DirectionLocked)
							{
								_Mobile.Direction = _Mobile.GetDirectionTo(_Mobile.Combatant);
							}
						}
						else
						{
							_Mobile.Warmode = false;
						}
					}

Also under public virtual bool DoOrderFollow()
under DebugSay("My master told me to follow")

Code:
//Change Speed
					var mOnHorse = _Mobile.ControlTarget.Mount != null;
					var mDirection = _Mobile.ControlTarget.Direction;
					var mRunning = (mDirection & Direction.Running) != 0;

					bool WMR;

					if (mOnHorse)
					{
						_Mobile.CurrentSpeed = (mRunning ? .1 : .15);
						WMR = WalkMobileRange(_Mobile.ControlTarget, 2, true, 0, 1);
					}
					else
					{
						_Mobile.CurrentSpeed = (mRunning ? .2 : .25);
						WMR = WalkMobileRange(_Mobile.ControlTarget, 2, mRunning, 0, 1);
					}

					if (WMR)
					{
						if (_Mobile.Combatant != null && !_Mobile.Combatant.Deleted && _Mobile.Combatant.Alive &&
							!_Mobile.Combatant.IsDeadBondedPet)
						{
							_Mobile.Warmode = true;

							if (!DirectionLocked)
							{
								_Mobile.Direction = _Mobile.GetDirectionTo(_Mobile.Combatant);
							}
						}
						else
						{
							_Mobile.Warmode = false;

							if (Core.AOS)
							{
								_Mobile.CurrentSpeed = 0.1;
							}
						}
					}

Lastly, same thing in DoOrderGuard()
Directly under _Mobile.Warmode = false;

Change to this:

Code:
//Change Speed
				var mOnHorse = _Mobile.ControlMaster.Mount != null;
				var mDirection = _Mobile.ControlMaster.Direction;
				var mRunning = (mDirection & Direction.Running) != 0;

				if (mOnHorse)
				{
					_Mobile.CurrentSpeed = (mRunning ? .1 : .15);
					WalkMobileRange(_Mobile.ControlMaster, 2, true, 0, 1);
				}
				else
				{
					_Mobile.CurrentSpeed = (mRunning ? .2 : .25);
					WalkMobileRange(_Mobile.ControlMaster, 2, mRunning, 0, 1);
				}
 
change it to that or add it in "?????this is My base ai original (a copy of it )
 

Attachments

  • BaseAIorig.cs
    77.2 KB · Views: 4
change it to that or add it in "?????this is My base ai original (a copy of it )

It would just the file BaseAI.cs you would just make sure that whatever I have listedn, you have. So replace whatever else you have with what I posted.
 
----------------------------------------------------------------------------
JustUO - [http://www.playuo.org] Version 1.0
Publish 4
Core: .NET Framework Version 4.0.30319
Core: Optimizing for 2 processors
RandomImpl: CSPRandom (Software)
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Mobiles/AI/BaseAIorig.cs:
CS1513: Line 1300: } expected
CS1513: Line 1449: } expected
CS1513: Line 1629: } expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

k got them added hopefuly in rite spot but cant get past these errors here please help with this and show Me where I went wrong attached my file to review
 

Attachments

  • BaseAIorig.cs
    79.4 KB · Views: 4
----------------------------------------------------------------------------
JustUO - [http://www.playuo.org] Version 1.0
Publish 4
Core: .NET Framework Version 4.0.30319
Core: Optimizing for 2 processors
RandomImpl: CSPRandom (Software)
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Mobiles/AI/BaseAIorig.cs:
CS1513: Line 1300: } expected
CS1513: Line 1449: } expected
CS1513: Line 1629: } expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

k got them added hopefuly in rite spot but cant get past these errors here please help with this and show Me where I went wrong attached my file to review

Your error code is saying your missing end curly braces. Just add three } to the end of the code.
I didn't give you the entire code blocks for all those methods, just the ones that needed to be modified.

In most cases, reading the error will give you a pretty good idea of what you need to do, whether its a null reference exception, object out of index, or just adding a few curly braces as it is here.
[doublepost=1464054035][/doublepost]Here ya go.
 
----------------------------------------------------------------------------
JustUO - [http://www.playuo.org] Version 1.0
Publish 4
Core: .NET Framework Version 4.0.30319
Core: Optimizing for 2 processors
RandomImpl: CSPRandom (Software)
Scripts: Compiling C# scripts...Failed with: 1 errors, 55 warnings
Warnings:

Errors:
+ Mobiles/AI/BaseAIorig.cs:
CS0103: Line 1285: The name 'DirectionLocked' does not exist in the current
context
CS0103: Line 1400: The name 'DirectionLocked' does not exist in the current
context
CS0103: Line 1421: The name 'iCurrDist' does not exist in the current contex
t
CS0161: Line 1554: 'Server.Mobiles.BaseAI.DoOrderGuard()': not all code path
s return a value
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

getting this now :(
 
Try this, just cleaned up the code and re-did it. If its something else, then it shouldn't be an issue with the code I gave you. Might be something to do with your existing scripts.
 

Attachments

  • [ServUO.com]-BaseAIorig (1).cs
    115.8 KB · Views: 17
throwed massive errors :( easy fix those were _Mobile.Warmode just had to add the m in front but its still throwin the other errors
and I do appreaciate the help more than You know I have a comprehension problem so some things are a real struggle for Me
 
throwed massive errors :( easy fix those were _Mobile.Warmode just had to add the m in front but its still throwin the other errors
and I do appreaciate the help more than You know I have a comprehension problem so some things are a real struggle for Me

Did your original files compile perfectly fine before the changes?
 
yea just put original back in and compiled it and logged in

how much difference is there in the coding for justuo and serveuo ??
 
You have an old version of BaseAI. I would suggest updating to ServUO if possible, as most of my edits are based on additional features =[
 
running on justuo and have a totally spawned live world so looks like pets will be bothersome til I can get this worked out but I thank You for taking the time to look at it and help :)
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back