Fishing Trigger

ShinyPickle

New Member
Reaction score
9
Is there anyone out there who can help me out? I want to make an ability "Fish". I have the ability done, but I can't get the trigger. :( I want it to only be able to be used in the water.

EDIT: I can find this part of the trigger...

"If terrain type of terrain at target point of ability being cast equal to terrain type at center of region..."

but I want it to work on all water, not just one region.
 

Vestras

Retired
Reaction score
249
Is there anyone out there who can help me out? I want to make an ability "Fish". I have the ability done, but I can't get the trigger. :( I want it to only be able to be used in the water.

EDIT: I can find this part of the trigger...

"If terrain type of terrain at target point of ability being cast equal to terrain type at center of region..."

but I want it to work on all water, not just one region.

If only 1 unit uses the Fish ability, then you could store the region in a varialbe, and when the ability is finished, you could do:

JASS:
Custom script: Call RemoveLocation(YourRegion)


I'm not soo good at custom script,but that should do it. This should make it not overwrite itself.
Now, if you use that, your region should not anymore excist, and when the unit uses the Fish ability again, it should be a new region.
 

Builder Bob

Live free or don't
Reaction score
249
Put this in the header of your map (click your map name above all your triggers). It's a function that will return true if the point you give it is in water.

JASS:
function IsPointWater takes location l returns boolean
	local real x = GetLocationX(l)
	local real y = GetLocationY(l)
    return IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY) and not(IsTerrainPathable(x,y,PATHING_TYPE_AMPHIBIOUSPATHING))
endfunction


Now make 2 variables:
a boolean named myBoolean
a point variable named myLocation

Set the variable myLocation to the cast location and then run this custom script.
Code:
Custom script: set udg_myBoolean = IsPointWater(udg_myLocation)

Now your myBoolean variable will be true if the point was in water, so you can use it in an If/Then/Else block.

Remember to remove the location afterwards to prevent a leak like this
Code:
Custom script: call RemoveLocation(udg_myLocation)
 

Insane!

Shh I didn't edit this, go away.
Reaction score
122
I'm not soo good at custom script

ahem
call RemoveLocation(udg_BLA)

For you GUI users
Code:
FISH
    Events
        Unit - A unit Begins casting an ability
    Conditions
        And - All (Conditions) are true
            Conditions
                (Terrain pathing at (Position of (Triggering unit)) of type Walkability is off) Equal to True
                (Terrain pathing at (Position of (Triggering unit)) of type Amphibious Pathing is off) Equal to False
    Actions
        Do nothing but fish
 

ShinyPickle

New Member
Reaction score
9
Ok, I got teh ability working and whatnot, but now I have a new problem. I made the ability after "Silence" so it could have that little circle thing and be able to target ground, but Silence doesn't have a missile. So I took "Firebolt" and edited that to look like a fishing bobber being thrown.

When you cast the ability, (The one I did after Silence) I want the unit to learn the other one, cast it exactly where he casted Silence and then unlearn it. I know how to make him learn/unlearn abilities with triggers, but I can't find an action to make him cast it.
 

Insane!

Shh I didn't edit this, go away.
Reaction score
122
Code:
FISH
    Events
        Unit - A unit Begins casting an ability
    Conditions
        And - All (Conditions) are true
            Conditions
                (Terrain pathing at (Position of (Triggering unit)) of type Walkability is off) Equal to True
                (Terrain pathing at (Position of (Triggering unit)) of type Amphibious Pathing is off) Equal to False
                (Ability being cast) Equal to 0_0
    Actions
        Unit - Add ??? to (Triggering unit)
        Unit - Order (Triggering unit) to Neutral Dark Ranger - Silence (Target point of ability being cast)
        Wait 2.00 seconds
        Unit - Remove ??? from (Triggering unit)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top