• Check out the results of the Techtree Contest #19!
  • 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Why isnt this mui?

Status
Not open for further replies.
Level 11
Joined
Sep 12, 2008
Messages
657
hey.. i started coding again,
after a large break o.o
to help a friend make his map,
so basicly, i help him do the fishing system, and some other stuff..
i actually finished it, but when we tried it online,
it failed as behing mui..
any ideas why?


  • [trigger]
  • Fishing Setup
    • Events
      • Time - Elapsed game time is 0.05 seconds
    • Conditions
    • Actions
      • -------- Day --------
      • Set Fishing_DayUnit[1] = Peasant
      • Set Fishing_DayName[1] = Peasent
      • Set Fishing_DayItem[1] = Claws of Attack +15
      • Set Fishing_DayPercent[1] = 25
      • Set Fishing_DayCount = 1
      • -------- Night --------
      • Set Fishing_NightUnit[1] = Footman
      • Set Fishing_NightName[1] = Footman
      • Set Fishing_NightItem[1] = Crown of Kings +5
      • Set Fishing_NightPercent[1] = 10
      • Set Fishing_NightCount = 1
      • -------- Dont Touch Below --------
      • Set Fishing_DayPercent[0] = 0
      • Set Fishing_NightPercent[0] = 0
      • Countdown Timer - Start Fishing_Timer as a Repeating timer that will expire in 0.05 seconds
      • -------- Setup hashtable --------
      • Hashtable - Create a hashtable
      • Set Fishing_Hashtable = (Last created hashtable)
      • -------- Edit Here! --------
      • Set Fishing_Distance = 500.00
      • Set Fishing_Duration = 5.00
      • Set Fishing_Interval = 0.50
      • Set Fishing_Extra = 80.00
      • Set Fishing_Speed = ((Fishing_Distance - Fishing_Extra) / (Fishing_Duration / Fishing_Interval))
  • Fishing Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fishing Rod
    • Actions
      • -------- Dont touch below --------
      • Hashtable - Save Handle Of(Triggering unit) as (Key (Triggering unit)) of 0 in Fishing_Hashtable
      • Set Fishing_Random = (Random integer number between 1 and 100)
      • -------- ------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at (Position of (Triggering unit)) of type Buildability is off) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (In-game time of day) Greater than or equal to 6.00
              • (In-game time of day) Less than or equal to 18.00
            • Then - Actions
              • For each (Integer Fishing_Count) from 1 to Fishing_DayCount, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Fishing_Random Greater than or equal to Fishing_DayPercent[(Fishing_Count - 1)]
                      • Fishing_Random Less than Fishing_DayPercent[Fishing_Count]
                    • Then - Actions
                      • Set Fishing_DummyPoint = (Position of (Triggering unit))
                      • Set Fishing_Point[Fishing_Count] = (Fishing_DummyPoint offset by Fishing_Distance towards (Facing of (Triggering unit)) degrees)
                      • Unit - Create 1 Fishing_DayUnit[Fishing_Count] for Neutral Passive at Fishing_Point[Fishing_Count] facing Default building facing degrees
                      • Set Fishing_Dummy[Fishing_Count] = (Last created unit)
                      • Hashtable - Save Fishing_Count as (Key (Triggering unit)) of 1 in Fishing_Hashtable
                      • Custom script: call RemoveLocation(udg_Fishing_DummyPoint)
                      • Unit Group - Add (Triggering unit) to Mui_PausedUnits
                      • Set Mui_PauseDuration[Fishing_Count] = Fishing_Duration
                      • Set Fishing_RecievedItem[Fishing_Count] = Fishing_DayItem[Fishing_Count]
                    • Else - Actions
            • Else - Actions
              • For each (Integer Fishing_Count) from 1 to Fishing_DayCount, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Fishing_Random Greater than or equal to Fishing_NightPercent[(Fishing_Count - 1)]
                      • Fishing_Random Less than Fishing_NightPercent[Fishing_Count]
                    • Then - Actions
                      • Set Fishing_DummyPoint = (Position of (Triggering unit))
                      • Set Fishing_Point[Fishing_Count] = (Fishing_DummyPoint offset by Fishing_Distance towards (Facing of (Triggering unit)) degrees)
                      • Unit - Create 1 Fishing_NightUnit[Fishing_Count] for Neutral Passive at Fishing_Point[Fishing_Count] facing Default building facing degrees
                      • Set Fishing_Dummy[Fishing_Count] = (Last created unit)
                      • Hashtable - Save Fishing_Count as (Key (Triggering unit)) of 1 in Fishing_Hashtable
                      • Custom script: call RemoveLocation(udg_Fishing_DummyPoint)
                      • Unit Group - Add (Triggering unit) to Mui_PausedUnits
                      • Set Mui_PauseDuration[Fishing_Count] = Fishing_Duration
                      • Set Fishing_RecievedItem[Fishing_Count] = Fishing_NightItem[Fishing_Count]
                    • Else - Actions
        • Else - Actions
  • Fishing Loop
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Mui_PausedUnits and do (Actions)
        • Loop - Actions
          • Set Fishing_HtInteger = (Key (Picked unit))
          • Set Fishing_DummyPoint = (Position of Fishing_Dummy[(Load Fishing_HtInteger of 1 from Fishing_Hashtable)])
          • Set Fishing_DummyPoint2 = (Position of (Picked unit))
          • Set Fishing_Point[(Load Fishing_HtInteger of 1 from Fishing_Hashtable)] = (Fishing_DummyPoint offset by Fishing_Speed towards (Angle from Fishing_DummyPoint to Fishing_DummyPoint2) degrees)
          • Unit - Move Fishing_Dummy[(Load Fishing_HtInteger of 1 from Fishing_Hashtable)] instantly to Fishing_Point[(Load Fishing_HtInteger of 1 from Fishing_Hashtable)]
          • Animation - Play (Picked unit)'s attack animation
          • Custom script: call RemoveLocation(udg_Fishing_DummyPoint)
          • Custom script: call RemoveLocation(udg_Fishing_DummyPoint2)
[/triggers]


thanks in advance..
 
  • -------- Dont touch below --------
  • Hashtable - Save Handle Of(Triggering unit) as (Key (Triggering unit)) of 0 in Fishing_Hashtable
  • -------- ------------------------------- --------
  • Hashtable - Save Fishing_Count as (Key (Triggering unit)) of 1 in Fishing_Hashtable
  • -------- ------------------------------- --------
  • Hashtable - Save Fishing_Count as (Key (Triggering unit)) of 1 in Fishing_Hashtable
->
  • -------- Dont touch below --------
  • Hashtable - Save Handle Of(Triggering unit) as 0 of (Key (Triggering unit)) in Fishing_Hashtable
  • -------- ------------------------------- --------
  • Hashtable - Save Fishing_Count as 1 of (Key (Triggering unit)) in Fishing_Hashtable
  • -------- ------------------------------- --------
  • Hashtable - Save Fishing_Count as 1 of (Key (Triggering unit)) in Fishing_Hashtable
Make sure you change the loads too (Load 1 of Key(Picked unit)). I hve to ask though, why would you save the handle of a unit for itself?

Mind the leaks also.
 
Status
Not open for further replies.
Back
Top