Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
onisaiyan808's Fishing System v.0.4.w3x
Variables
Initialization
Initialization
Credits
Fishing
How to Set the Fishing Ability
How to Import
Stacking
Casts Fishing
Fishes Recovery
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
Name
Type
is_array
initial_value
DefaultAmount
integer
No
FSHT
hashtable
No
Max
integer
No
TempInt
integer
No
TempSFX
effect
No
Initialization
Events
Map initialization
Conditions
Actions
-------- This trigger sets all the values of the fishes. --------
-------- The hashtable is vital to keep ANY system MUI. I reccommend reading the tutorial made by wyrmlord to learn more about hashtables. --------
Hashtable - Create a hashtable
Set Variable Set FSHT = (Last created hashtable)
-------- Change the variable DefaultAmount to set the starting amount of fishes for each fish. --------
Set Variable Set DefaultAmount = "10"
-------- Change the variable Maxt to set the maximum amount of fishes a fish can have. --------
Set Variable Set Max = "20"
-------- This line here destroys a leak that is caused from the loop. Very important to learn about leaks and how to destroy them. --------
Custom script: set bj_wantDestroyGroup = true
-------- This loop here sets the amount of fishes for all fishes on the map. --------
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
-------- This If statement ensures that only the fishes are affected by the loop. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Picked unit)) Equal to School of Fishes
(Unit-type of (Picked unit)) Equal to Green Fish
Then - Actions
-------- This line sets the amount of fishes to a fish. --------
Hashtable - Save DefaultAmount as 0 of (Key (Picked unit).) in FSHT .
-------- This floating text shows how much fishes it has left. --------
Floating Text - Create floating text that reads (String((Load 0 of (Key (Picked unit).) from FSHT.))) above (Picked unit) with Z offset 0 , using font size 10 , color ( 100 %, 100 %, 100 %), and 0 % transparency
-------- This line saves the floating text so, that it can be changed when someone fishes from a fish. --------
Hashtable - Save Handle Of (Last created floating text) as 1 of (Key (Picked unit).) in (Last created hashtable) .
-------- Special effects things go here. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to School of Fishes
Then - Actions
Special Effect - Create a special effect attached to the overhead (Unexpected type: 'attachpoint') of (Picked unit) using Doodads\Ruins\Water\FishSchool\FishSchool.mdl
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Green Fish
Then - Actions
Special Effect - Create a special effect attached to the overhead (Unexpected type: 'attachpoint') of (Picked unit) using Doodads\Ruins\Water\FishTropical\FishTropical.mdl
Else - Actions
Else - Actions
Credits
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
Game - Display to (All players) the text: Welcome to onisaiyan808's Fishing System!Credits to HeroSlayer for pointing out a flaw in my loopand to SFilip from TheHelper.Net for the item stacking trigger.
The only thing you would probably have to worry about is the Data - Art Duration and Data - Follow Through Time. Change these values if you to make the pause last longer or shorter but keep them the same value.
These are the steps on how to import this system into your map.
1. Move all the triggers into one folder.
2. Copy the folder.
3. Open your map.
4. Paste the folder into your trigger editor.
5. Copy the "Fishing" ability in the object editor of this map.
6. Open your map.
7. Paste the ability into your object editor.
Notes: Remember to tick the "Automatically create unknown variables while pasting trigger data" on so, that you don't have to copy all of the variables.
Stacking
Events
Unit - A unit Acquires an item
Conditions
(Charges remaining in (Item being manipulated)) Not equal to 0
Actions
For each (Integer A) from 1 to 6 , do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
(Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
Then - Actions
Item - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer A)) to ((Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
Item - Remove (Item being manipulated)
Else - Actions
Casts Fishing
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Fishing
Actions
-------- This If statement ensures that only the fishes are affected by the loop. --------
Set Variable Set TempInt = (Load 0 of (Key (Target unit of ability being cast).) from FSHT.)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Greater than 0
Then - Actions
-------- From here --------
Set Variable Set TempInt = ((Load 0 of (Key (Target unit of ability being cast).) from FSHT.) - 1)
Hashtable - Save TempInt as 0 of (Key (Target unit of ability being cast).) in FSHT .
Floating Text - Change text of (Load 1 of (Key (Target unit of ability being cast).) in FSHT) to (String(TempInt)) using font size 10
-------- And here, it changes the fishesCount and fishesCountText because fishes are being harvested with the Fishing Pole. --------
-------- Special effects things go here. --------
Animation - Play (Triggering unit) 's attack animation
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.