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?
And the repopulator:
Thank You!
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
- If - Conditions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - 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
- If - Conditions
- 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))]
- Events
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
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Custom script: call RemoveLocation (udg_Temp_Point)
Thank You!