Fishing System Glitch

2evil

New Member
Reaction score
16
So i have an automated fishing system that works much like regular harvesting [auto-acquires the nearest source of resources and continually does runs, etc.], but I am getting an odd glitch where after it runs an outside trigger, the ship does not return to its port.

To clarify, this happens every time after 15 fish are caught and the repopulating trigger is ran.

Also, an unrelated note - sometimes instead of selling the item back to the port, they drop it right next to it. Any ideas on that?

Trigger:
  • Ensnare
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Ensnare [sea]
    • Actions
      • Set Temp_Point = (Position of (Triggering unit))
      • Item - Create Fish I at Temp_Point
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Hero - Give (Last created item) to (Triggering unit)
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - 1.00)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Sea_Items_Unit_Array[(Integer A)]
            • Then - Actions
              • Set Fish_Spawn_Counter[(Integer A)] = (Fish_Spawn_Counter[(Integer A)] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fish_Spawn_Counter[(Integer A)] Greater than or equal to 15
                • Then - Actions
                  • Set Fish_Spawn_Counter[(Integer A)] = 0
                  • Set Fish_Temp_Type = Sea_Items_Unit_Array[1]
                  • Trigger - Run Fish Adder <gen> (ignoring conditions)
                • Else - Actions
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is dead) Equal to True
        • Then - Actions
          • Unit - Remove (Target unit of ability being cast) from the game
        • Else - Actions
      • Trigger - Run Debug Update <gen> (ignoring conditions)
      • Wait 0.50 game-time seconds
      • Unit - Pause (Triggering unit)
      • Wait 9.50 game-time seconds
      • Unit - Unpause (Triggering unit)
      • Wait 0.10 game-time seconds
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to Shipyard_Array[(Custom value of (Triggering unit))]


And the repopulator:
Trigger:
  • Fish Adder
    • Events
    • Conditions
      • Fish_Temp_Type Equal to Sea_Items_Unit_Array[1]
      • (Random integer number between 1 and 10) Greater than or equal to 3
    • Actions
      • Game - Display to (All players) the text: Adder Active.
      • Set Temp_Point = (Random point in (Playable map area))
      • Unit - Create 1 Hermit Crab for Neutral Passive at Temp_Point facing (Random angle) degrees
      • For each (Integer A) from 1 to 100000, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain pathing at Temp_Point of type Floatability is off) Equal to True
            • Then - Actions
              • Set Temp_Point = (Random point in (Playable map area))
              • Unit - Move (Last created unit) instantly to Temp_Point
            • Else - Actions
              • Game - Display to (All players) the text: (Loop + ((String((Integer A))) + Pass))
              • Custom script: exitwhen true
      • Custom script: call RemoveLocation (udg_Temp_Point)


Thank You!
 

2evil

New Member
Reaction score
16
[bump]

when I made this I made sure that [ensnare] did not use any variables beyond where it execures [fish adder] just to prevent this type of thang :[
 

2evil

New Member
Reaction score
16
[Dubug Update] runs every time, and the problem is isolated to when [Fish_Spawn_Counter[A]] >= 15, that branch of the if.

but this is [Debug Update]
Trigger:
  • Debug Update
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for Debug_Multi item in column 2, row (Integer A) to (String(Fish_Spawn_Counter[(Integer A)]))
 

mr_fj

New Member
Reaction score
10
Umm I don't know why, but maybe it would help if you filled out all the Else' with Do Nothing's?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top