Code:
Server.Engines.Harvest.Fishing.System.BeginHarvesting(m_Mobile, ___ );

i have to fit a tool in the space after the comma but it throws back Server.Items.FishingPole is a type, but it is used like a variable...
any ideas?
 
If its checking or has checked for the FishingPole in its pack, wouldn't Tool or HarvestTool work? Just tossing that out there, no idea if either would work or not.
 
Lines 871 to 879 are where my issue lies....
the BaseAI.cs script is attached.

Code:
public virtual void OnActionChanged()
        {
            switch (Action)
            {
                case ActionType.Wander:
                    m_Mobile.Warmode = false;
                    m_Mobile.Combatant = null;
                    m_Mobile.FocusMob = null;
                    m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
                    break;

                case ActionType.Combat:
                    m_Mobile.Warmode = true;
                    m_Mobile.FocusMob = null;
                    m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
                    break;

                case ActionType.Guard:
                    m_Mobile.Warmode = true;
                    m_Mobile.FocusMob = null;
                    m_Mobile.Combatant = null;
                    m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
                    m_NextStopGuard = Core.TickCount + (int)TimeSpan.FromSeconds(10).TotalMilliseconds;
                    m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
                    break;

                case ActionType.Flee:
                    m_Mobile.Warmode = true;
                    m_Mobile.FocusMob = null;
                    m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
                    break;

                case ActionType.Interact:
                    m_Mobile.Warmode = false;
                    m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
                    break;

                case ActionType.Backoff:
                    m_Mobile.Warmode = false;
                    m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
                    break;

                //gametec 04
                case ActionType.Fish:
                    m_Mobile.Warmode = false;
                    //m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
                    //m_Mobile.Animate((int)WeaponAnimation.Slash2H, 13, 2, true, true, 4);

                    Server.Engines.Harvest.Fishing.System.BeginHarvesting(m_Mobile, this);

                    //Action = ActionType.Fish;
                    break;
            }
        }
[doublepost=1525293637][/doublepost]The entire system comprises of BaseCreature, BaseIntelligence, a new Fisher script and the AI that goes with that script.

What I am doing is the first stage of ActionAI which is a step forward to making everyone's server come alive with walking, talking, and "doing" NPC's. The first stage is making a test character called the Fisher. Then create the rest of the system using him as an example. The reason I took on this project is because UO is pretty bland when it comes to NPCs and I know it is possible to do more with them. I will be releasing this system when I am done with it, but I wont release a half done system. I want everyone to enjoy these.

What He Is Supposed To Do: (Keep In Mind That All Of These NPCs Are Going To Sell Their Wares Eventually)
  • The fisher: will fish all shallow and deep water tiles from either a boat, shoreline, or dock. If they are not near a water source then they will walk around until they find one. They will fish in random spots and will also eventually control boat movement so they can fish in random deep water locations. They have an animation: fishing as well.
  • Please Note: he is not actually fishing, rather he is simulating the process.
  • He will face and interact with any player that is within a range of 2 tiles from him and will offer to sell his wares to them.
What I Have So Far:
  • The fisher currently can be added to the game, and he does fish, but the animation is wrong and that is what this line is supposed to fix based on the Fishing.cs.
What I Can Do As Far As Skill Level Goes:
  • I can make the Fisher a vendor, I can control what he sells.
  • I can have the Fisher turn to the player and sell his wares.
  • I can set up keywords for different results with player interaction: with custom gumps or not.
  • I can have them control boats
What I Will Have Issues With:
  • I think my next obstacle will be getting him to stop fishing when he turns inland or talks to players and then getting the animation to start up again when the player is out of range and he is close to the water again.
    • This will also affect all of the other NPC's I have planned with this system... so this is important.
  • I may have trouble with the way-points and trying to get these guys to walk around with a purpose.
    • This will also affect all of the other NPC's I have planned with this system... so this is important.
What NPC's Are Planned For ActionAI:

Laborers: (It's the general movements I am after - simulating them actually working instead of standing still)
  • Fishers (current active project)
  • Miners
  • Hunters
  • Lumberjacks
  • Crop/ Tree Pickers
Artisans: (It's the general movements I am after - simulating them actually working instead of standing still)
  • Blacksmiths
  • Tailors
  • Cooks
  • Tinkers
  • Carpenters
[doublepost=1525299677][/doublepost]So if I throw in new FishingPole()

It compiles, but the animation doesn't work... :/
 

Attachments

  • BaseIntelligence.cs
    108.1 KB · Views: 11
  • ScriptAnalysis.rar
    48.7 KB · Views: 10
Last edited:
BeginHarvest - it only creates a target, you need to either create a target forcibly and specify the coordinates, or simply cause pseudo animation throw and effect throw.
[doublepost=1525353030][/doublepost]Example:
Create ThrowingTimer and check in OnTick method players in range.
if players > 0
check water tiles in range, and get random values, after which send next animations:

Code:
                        int sound = 0x364; // water sound
                        int effect = 0x352D; // throwing pole in water animation.

                        from.Animate(AnimationType.Attack, 12); // where fish.EffectActions = new int[] { Core.SA ? 6 : 12 };
                        Effects.SendLocationEffect(loc, map, effect, 16, 4);
                        Effects.PlaySound(loc, map, sound);
 
Back