[Trigger] Trying to MUI

Status
Not open for further replies.
Level 5
Joined
Nov 11, 2009
Messages
172
I made my first attempt, and wondering what I did wrong :(
  • Bleed
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bleed
    • Actions
      • Set Bleed_Integer3 = (Bleed_Integer3 + 1)
      • Set Bleed_Caster[Bleed_Integer3] = (Triggering unit)
      • Set Bleed_Counter[Bleed_Integer3] = 5.00
      • Set Bleed_Target[Bleed_Integer3] = (Target unit of ability being cast)
      • Set Bleed_Damage[Bleed_Integer3] = (Real(((Strength of Bleed_Caster[Bleed_Integer3] (Include bonuses)) x 2)))
      • If (Bleed_Integer3 Greater than 0) then do (Trigger - Turn on BleedLoop <gen>) else do (Do nothing)
  • BleedLoop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bleed_Integer3 Greater than 0
        • Then - Actions
          • Set Bleed_Integer = 1
          • For each (Integer Bleed_Integer2) from 1 to Bleed_Integer3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Bleed_Counter[Bleed_Integer] Greater than 0.00
                • Then - Actions
                  • Unit - Cause Bleed_Caster[Bleed_Integer] to damage Bleed_Target[Bleed_Integer], dealing Bleed_Damage[Bleed_Integer] damage of attack type Spells and damage type Normal
                  • Set Bleed_Counter[Bleed_Integer] = (Bleed_Counter[Bleed_Integer] - 1.00)
                  • Set Bleed_Integer = (Bleed_Integer + 1)
                • Else - Actions
                  • Set Bleed_Integer3 = (Bleed_Integer3 - 1)
        • Else - Actions
      • If (Bleed_Integer3 Equal to 0) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
Integer Bleed_Integer2 is used in a loop yet never referenced.
Bleed_Integer is referenced yet never setup to anything (think you meant Bleed_Integer2 for this).

Set Bleed_Integer3 = (Bleed_Integer3 - 1)
And? Um what if the bleed ending is not the final index (which is almost certain).... This will just kill the last cast bleed keeping the earilest one running even though the eariliest one expired. What you need to do is remove the expired one, and set the final one to it (and all parameters) before you set the counter down by one so that no legally active ones are removed and the expired one is. Or you could use a struct like system and asig each instance a static index using an index recycling system which avoids the needed for shifiting large ammounts of data on destruction, but you will need to use one of them.
 
Level 9
Joined
May 30, 2008
Messages
430
just create a unit with life drain some where around the map with timed life (the bleed duration) and order this unit to cast life drain to the targeted unit. So it will work fine (ofc u must modify the the spell but still it's easy and fast way until u find a way to do spells on your own)
 
Level 5
Joined
Nov 11, 2009
Messages
172
just create a unit with life drain some where around the map with timed life (the bleed duration) and order this unit to cast life drain to the targeted unit. So it will work fine (ofc u must modify the the spell but still it's easy and fast way until u find a way to do spells on your own)

I'm not sure you understand this..
 
Level 9
Joined
May 30, 2008
Messages
430
life drain i damage per second for x interval of time, so it will be like bleed if u make some modifications (the target will loose hp over time there will be a problem if the unit use wind walk but still it will work). Also there are a lot of tutorials for Damage over Time triggers w/e i don't think this trigger is hard to be created
 
Level 5
Joined
Nov 11, 2009
Messages
172
life drain i damage per second for x interval of time, so it will be like bleed if u make some modifications (the target will loose hp over time there will be a problem if the unit use wind walk but still it will work). Also there are a lot of tutorials for Damage over Time triggers w/e i don't think this trigger is hard to be created

Read the trigger again and think some.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
I advise scrapping the high level GUI interface and going down to pure JASS. JASS behaves like a lot of procedural languages so you should have no problem understanding how it works and thus no problem making MUI spells then.

Basically, you must consider any variable clashes, what data has to be stored, that kind of stuff. Then design your code around it thinking of how to store the values.
The 2 main ways of storing stuff are hashtables (or simlar systems) and arrays. Inside functions you can use locals to store data temperarorly.
 
Status
Not open for further replies.
Top