• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Trying to make a trigger MUI

Status
Not open for further replies.
Level 8
Joined
Jul 29, 2010
Messages
319
I'm struggling to make my trigger MUI, I've been reading the tutorial and I'm trying to make a buffer system so that my trigger will work for multiple players using it at once
  • Lunge
  • -This trigger starts the system and sets the variables-
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Lunge
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Set WriteIndex = (WriteIndex + 1)
          • Set Casting_Unit[WriteIndex] = (Triggering unit)
          • Set Max_Distance[WriteIndex] = 0
          • Set Max_Distance[ReadIndex] = 0
          • Set Target_Point = (Target point of ability being cast)
          • Wait 0.10 seconds
          • Set ReadIndex = (ReadIndex + 1)
          • Trigger - Turn on EVERY 010 <gen>
        • Else - Actions
It's supposed to be a lunge or dash system, I know there are tons of those systems out there already that will work fine but I have trouble with jass and none of the systems look quite how I want them to, at least if I make it myself I'll learn a lot more.
  • EVERY 010
  • -This trigger moves the unit-
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Max_Distance[ReadIndex] Less than 10
        • Then - Actions
          • Unit - Move Casting_Unit[ReadIndex] instantly to ((Position of Casting_Unit[ReadIndex]) offset by 15.00 towards (Facing of Casting_Unit[ReadIndex]) degrees)
          • Set Max_Distance[ReadIndex] = (Max_Distance[ReadIndex] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ReadIndex Equal to WriteIndex
            • Then - Actions
              • Set ReadIndex = 0
              • Set WriteIndex = 0
            • Else - Actions
          • Trigger - Turn off (This trigger)
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
It looks like you want do use dynamic indexing. I would recommend reading this tutorial: Visualize: Dynamic Indexing
You don't need seperate read and write indices. I would also remove the wait in the first trigger.
You will need point variables to avoid leaks.
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
You can either use indexing or hashtable to achieve MUI.
Visualize: Dynamic Indexing
Hashtables and MUI
You can use the one you like most.

For your trigger, though. It can be quite problematic if two unit cast it at the same time. To check if it's MUI, simply try to cast it with two units.
Instead of "Unit - A unit Begins channeling an ability", use "Unit - A unit Starts the effect of an ability".
 
Level 8
Joined
Jul 29, 2010
Messages
319
It looks like you want do use dynamic indexing. I would recommend reading this tutorial: Visualize: Dynamic Indexing
You don't need seperate read and write indices. I would also remove the wait in the first trigger.
You will need point variables to avoid leaks.
You can either use indexing or hashtable to achieve MUI.
Visualize: Dynamic Indexing
Hashtables and MUI
You can use the one you like most.

For your trigger, though. It can be quite problematic if two unit cast it at the same time. To check if it's MUI, simply try to cast it with two units.
Instead of "Unit - A unit Begins channeling an ability", use "Unit - A unit Starts the effect of an ability".
Thank you for the quick replies guys, i'll check out the links, thank you for the help :D :)

EDIT: Dynamic Indexing is the most appealing to me, thank you guys for the suggestion, that link really helps
 
Last edited:
Status
Not open for further replies.
Top