• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Help? Fishing

Status
Not open for further replies.
Level 2
Joined
Feb 27, 2014
Messages
18
  • Fishing
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Fishing
      • ((Casting unit) is in (Units within 512.00 of (Position of Fishing spot 0033 <gen>))) Equal to True
    • Actions
      • Unit - Pause (Casting unit)
      • Wait 7.00 seconds
      • Item - Create Salmon at (Position of (Triggering unit))
      • Unit - Unpause (Triggering unit)
The problem is, that the unit won't unpause!
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
I don't see any reason why the unit wouldn't unpause. Try removing "Item - Create Salmon at (Position of (Triggering unit))" and see if it still won't unpause. If it does unpause, then that's the problem.

You have two location and one group leaks everytime a unit casts it. Also, you might wanna use "Unit - A unit Starts the effect of an ability" in the event to prevent players abusing it (unless it is instant).
 
Level 39
Joined
Feb 27, 2007
Messages
4,992
"Casting unit" won't work after a Wait, but "triggering unit" and some other ones will. If you're using that instead of Triggering Unit that could be the problem. You're leaking a few locations (and the group, but you don't need that); instead of checking if it's in a group just check the distance.
  • Events
    • Unit - A unit begins casting an ability /Could be spell effect, begins channel, etc. depending on your needs-- idk
  • Conditions
    • (Ability being cast) equal to Fishing
  • Actions
    • Custom script: local location p //THIS MUST BE THE FIRST LINE
    • Set FishPoint = Position of (Triggering Unit)
    • Set FishPoint2 = Center of (Fishing Spot 0033 <gen>) //You could store this point permanently in some variable like "fish_spot[x]" if you have multiple you want to check against
    • Set Dist = Distance between (FishPoint) and (FishPoint2)
    • -------- This line vvvvv has to go here because of the wait --------
    • Custom script: call RemoveLocation(udg_FishPoint2) //change the stuff inside the () to be "udg_" + <the name of your variable in the variable editor>
    • If (all conditions) then (actions) else (actions)
      • If - Conditions
        • Distance between FishPoint and FishPoint2 less than or equal to 512.00
      • Then - Actions
        • Custom script: set p = udg_FishPoint
        • Unit - Pause (triggering unit)
        • Wait - 7.00 seconds
        • Unit - Unpause (triggering unit)
        • Custom script: set udg_FishPoint = p
        • Item - Create Salmon at FishPoint
      • Else - Actions
    • Custom script: call RemoveLocation(udg_FishPoint) //These remove the location (point) leaks that occur every time you use "position of..." without saving it to a variable first and removing it
 
Status
Not open for further replies.
Top