• 🏆 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!

Mui problems

Status
Not open for further replies.
Level 5
Joined
Apr 8, 2008
Messages
88
Here's the trigger. I've noticed that when several unit's are using this "spell", it get mixed and well. It turns out bad.

Isn't this trigger compatible for multiple usage? How to make it so it is?

+Rep for help that solves my problem :thumbs_up:


  • Fishing
    • Events
      • Time - Every 0.07 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Fishing Greater than 0
        • Then - Actions
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set Curent_Integer_Value = (Integer A)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Is_Fishing[Curent_Integer_Value] Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • How_Many_Runs[Curent_Integer_Value] Less than 19
                    • Then - Actions
                      • Set Curent_Position[Curent_Integer_Value] = (Position of Fish[Curent_Integer_Value])
                      • Set Move_Fish_Here[Curent_Integer_Value] = (Curent_Position[Curent_Integer_Value] offset by ((Real(Total_Range_Fishing[Curent_Integer_Value])) / 20.00) towards (Real(Degrees_Between_Fish_N_Fisher[Curent_Integer_Value])) degrees)
                      • Unit - Move Fish[Curent_Integer_Value] instantly to Move_Fish_Here[Curent_Integer_Value]
                      • Set How_Many_Runs[Curent_Integer_Value] = (How_Many_Runs[Curent_Integer_Value] + 1)
                      • -------- Fixing Memory Leaks --------
                      • Custom script: call RemoveLocation(udg_Curent_Position[udg_Curent_Integer_Value])
                      • Custom script: call RemoveLocation(udg_Move_Fish_Here[udg_Curent_Integer_Value])
                    • Else - Actions
                      • -------- When the fish is close to the caster, he gets an item and the fish get's removed --------
                      • Set Curent_Position[Curent_Integer_Value] = (Position of Fish[Curent_Integer_Value])
                      • Item - Create Fish at Curent_Position[Curent_Integer_Value]
                      • Unit Group - Pick every unit in (Units within 50.00 of Curent_Position[Curent_Integer_Value]) and do (Hero - Give (Last created item) to (Picked unit))
                      • Unit - Remove Fish[Curent_Integer_Value] from the game
                      • Set Is_Fishing[Curent_Integer_Value] = False
                      • Set Fishing = (Fishing - 1)
                      • Set How_Many_Runs[Curent_Integer_Value] = 0
                      • -------- Fixing Memory Leaks --------
                      • Custom script: call RemoveLocation(udg_Curent_Position[udg_Curent_Integer_Value])
                • Else - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
 
Level 5
Joined
Apr 8, 2008
Messages
88
Uhm...
but i set the "Set Curent_Integer_Value = (Integer A)" each time it loops.
Shouldn't that give the Curent_Integer_Value 1 the first loop, 2 at the second and so on?
so each player have one "loop"
 
Level 11
Joined
Jan 25, 2009
Messages
572
Use this instead of setting it to a variable AFTER the Loop.

In the actions menu, you can choose "For each integer (Variable) fro 1 to 12 do Actions-"

Here is what it will look like =) : For each (Integer Integer_Loop) from 1 to 12, do (Actions)
Loop - Actions
 
Level 11
Joined
Jan 25, 2009
Messages
572
Use this instead of setting it to a variable AFTER the Loop.

In the actions menu, you can choose "For each integer (Variable) fro 1 to 12 do Actions-"

Here is what it will look like =) :
  • For each (Integer Integer_Loop) from 1 to 12, do (Actions)
    • Loop - Actions
EDIT: Oh shit, sry for doubble post, my reason is that my internet is wierd...
 
Level 5
Joined
Apr 8, 2008
Messages
88
And if i do like that, it will be mui?

What's the difference?

(If it does, +rep to both)

dont have time to test right now*
 
You force IntegerA to be of maximum value = 12. This results a static value, the result of which I am not aware of. Instead of 12, it should be the integer variable, which increases by 1 in your first trigger.
  • Trigg1
  • Set MUI = (MUI + 1)
  • Trigg2
    • For each (Integer A) from 1 to MUI, do (Actions)
      • Loop - Actions
And then you will refer to every value of the second trigger as [(IntegerA)].

I highly recommend not to use Integer A though, because it is used on default engine's stuff and might interfere with your trigger. Use a custom trigger instead.
 
Level 5
Joined
Apr 8, 2008
Messages
88
So, when a unit casts the spell "Fish" ( as it is in this case ) i set [Mui] (integer) to
Mui = Mui + 1

And then i do the
For each (Integer A) from 1 to MUI, do (Actions)
Loop - Actions

Should i reset the "Mui" at any time?
or just keep it going higher and higher?
 
Of course. Maximum instances are 8192, but users keep resetting it to 100. Of course, that means that 100 units maximum can cast the spell at a time. Recycling your indexing systems is your main priority. You can refer to the following tutorial:
http://www.hiveworkshop.com/forums/...stanceabilty-timers-custom-values-more-96460/

I suggest you downloaded some spells that use indexing systems though. You'll learn better and maybe faster.
 
Status
Not open for further replies.
Top