# [Trigger]Fishing System. [Help]

Status
Not open for further replies.

#### funyuns9999

Level 2
Ok im making a tribes map where you have to survive and all that stuff.
And i was gonna make a fishing system. can anyone help me or tell me how to make something like this?

Example: someone uses the ability "Fish" they sit there and wait till they catch one. and the higher ur lvl the higher the chance u have of catching a fish.

Level 14
So a chance system?

#### GhostWolf

Level 29
Just use a random integer that is based on something like this
• Set chance = ((SomeNumber) / (Hero Level of (Triggering Unit))

and change the SomeNumber to the chance you want.

#### feelerly

Level 1
i have one of fishing system.

#### Attachments

• test.w3x
20.5 KB · Views: 128

#### funyuns9999

Level 2
i have one of fishing system.

cant open it. it says something does not exist then it says an error thing

Level 5
Try the random integer with an ability so when the hero/unit casts the ability it triggers a random integer so say 1/4 times it triggers text saying "You caught a fish" and puts a fish in your inventory. Else for the other four text "Didn't catch anything" or whatever you want it to say.

#### feelerly

Level 1
but, as Maddawn101 siad. how to make unit unmove untill caught a fish or player stop it. just loop.
example:
JASS:
``````local integer lv = GetUnitAbilityLevel( GetTriggerUnit(), 'A000')
// if ability of id 'A000' is the "Fishing",  lv is level of Fishing.
local boolean b = false
// use b to exit loop. when a unit/hero caught a fish, set b = true
loop
if GetRandomInt( 1, 100 ) <= (lv+1)*5 then
call CreateItemAtLoc( 'I000', GetUnitLoc( GetTriggerUnit() ) )
// there, I set an item is "Fish",if Trigger unit caught it. Fishing end!
set b = true
endif
call TriggerSleepAction( 1.00 )// check it every 1.00 sec
exitwhen b == true
endloop``````

I use this menthod in maps. then, if you want stop fishing when unit has stop
cast ability, you could create a new trigger to check unit stop casting ability.
and , stop fishing.

#### JoHnyW

Level 7
looks impressive but its JASS is it possible to create it in GUI ?

Maybe "cast sleep or stun on unit" when it fishes to make it unmove? But there is 1 more problem how to make fishing allowed only near the water ?

#### Eleandor

Level 21
• Events
• Unit - a unit starts the effect of an ability
• Conditions
• Ability - ability being cast is "Fish"
• Actions
• For each (Integer Int) from 1 to 3, do (Actions)
• Loop - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Random integer number between 1 and 100) Less than or equal to (Level of Fish for (Triggering unit))
• Then - Actions
• Set Int = 3
• Item - Create Fish at (Position of (Triggering unit))
• Else - Actions
• Game - Display to (All players) the text: fail
• Set Int = 1
• Wait 1.00 seconds
Leaks a point.

#### GhostWolf

Level 29
Maybe "cast sleep or stun on unit" when it fishes to make it unmove?

You can either simply make the ability take time or you can pause/unpause with a trigger.

But there is 1 more problem how to make fishing allowed only near the water ?

Set Point = Target point of ability being casted
If Terrain Type at Point = bla bla // boolean conditions
Else - Unit - Order (Triggering unit) to Stop
Show text to owner of triggering unit: you can't fish there !
Set (Triggering unit)'s mana to (Triggering unit)'s + Cost_Of_Ability
call RemoveLocation(udg_Point)

This requires that you put a specific terrain type inside the water !

• Events
• Unit - a unit starts the effect of an ability
• Conditions
• Ability - ability being cast is "Fish"
• Actions
• For each (Integer Int) from 1 to 3, do (Actions)
• Loop - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Random integer number between 1 and 100) Less than or equal to (Level of Fish for (Triggering unit))
• Then - Actions
• Set Int = 3
• Item - Create Fish at (Position of (Triggering unit))
• Else - Actions
• Game - Display to (All players) the text: fail
• Set Int = 1
• Wait 1.00 seconds

Why do you need a loop ?
Why do you need either of those "Set Int" ?
Why do you need that wait ?

They are all pretty useless.

Leaks a point.

Don't give em' leaky triggers, it takes the same time to write a point and remove it as it takes to write "Leaks a point" (yes I know its longer...).

Last edited:

#### Eleandor

Level 21
You need a loop because once you start fishing (once you start casting the ability), you have to check every second if you got a fish or not. Seeing as how in GUI you only have For loops, you have to manipulate it a bit. So no, they're not useless.

And yes, it's longer.
Besides, people who don't fix the leaks THEMSELVES are too lazy and don't deserve a non-leaking map...

#### GhostWolf

Level 29
Oh I got your loop point.
If I would be the maker I would prefer a one-chance spell but its whatever the maker wants
However, you still don't need those integers.

And a lot of map-makers don't even know about leaks.
I for one didn't know about them just a month or so ago.
If I would have ever finished a map (always start em'... never finish ) it would have been probably so horribly leaking = lagging.

If you put a custom script however, the maker would probably ASK about it ("what the hell is that custom script doing?") and so we get yet another maker to know about leaks ! so its important to write them and not be lazy

#### Eleandor

Level 21
However, you still don't need those integers.
What integers?

And a lot of map-makers don't even know about leaks.
That's why I tell them they have to fix it. If they don't bother asking what it is or searching through the fora (or reading a damn sticky with an obvious title "THINGS THAT LEAK"), it's not my problem...

#### Need_O2

Level 19
Besides, people who don't fix the leaks THEMSELVES are too lazy and don't deserve a non-leaking map...
No one deserves anything but me

#### GhostWolf

Level 29
"Set Int = 3", "Set Int = 1" - no need for Int.

And yes, you do have a point there about the leaks.

#### Eleandor

Level 21
"Set Int = 3", "Set Int = 1" - no need for Int.
Yes there is. The loop has to go on forever UNTIL you catch a fish. In gui this isn't possible unless you screw around with the for-loop, which is what I did, by manipulating the integer used for looping myself.

#### GhostWolf

Level 29
Oh only no I noticed you did "For each(Integer Int)".
Sorry

Status
Not open for further replies.

[Solved] Fishing System
Replies
9
Views
807
[Trigger] Fishing Error
Replies
18
Views
946
Replies
0
Views
608
Replies
0
Views
612
[Spell] Fishing ability
Replies
6
Views
619