If then ells

Lord Regno

Active Member
Reaction score
19
How many if its then els action can you have on eat others.
Like:

Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Then - Actions
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
            • Else - Actions
 

HydraRancher

Truth begins in lies
Reaction score
197
Potentially Unlimited, supposing you had the universes greatest computer, capable of handling a googleplex If's. It depends wether your computer can handle it, but ofcourse why would you need so many?
 

Lord Regno

Active Member
Reaction score
19
Thanks, I think I will have 9 triggers with 10-20 if's in every trigger.

Why? A example:

Trigger:
  • Trigger Removed
 

jig7c

Stop reading me...-statement
Reaction score
123
your floating text leaks, set it to a variable, and null it at the end!
 

Lord Regno

Active Member
Reaction score
19
Maby in point (that I will fix).

Will it be deleted after 1,5 sec because of this trigger? If its so then I think it's don't leak, I think null is delete? :confused: Or are it only I ho imagine that lifespan don't delete it complicity?

Trigger:
  • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds


And do a commuter fix 10-30 if then ells steps?
 

Rushhour

New Member
Reaction score
46
Floating texts aren't handles in the original meaning, they do not "leak" if you disable permanence and set their life span. The only problem would be if you create about 100 and only hide them but never destroy them, then you won't be able to create new ones.
The bounty texts of wc3 are also only floating texts with a certain color, velocity, fading age and disabled permance ;)

And nulling doesn't delete a handle, it only "clears" the local pointer variable, so there is no need in nulling a global variable as it gets overwritten.

And to the many If-Then-Elses: You better find a work around, maybe with array variables that store the ability id and whatever you need and got the same index ..
 

Lord Regno

Active Member
Reaction score
19
And to the many If-Then-Elses: You better find a work around, maybe with array variables that store the ability id and whatever you need and got the same index ..

Do you mean to many on etch others or just to many of then ells? If it's to many if it's ells then I don't now how to solve it bit if its to many if then ells on etch others then I can make this:

Edited the trigger above, ells this will be a long thread I even clipped it a bit.
 

Rushhour

New Member
Reaction score
46
I just mean if you are basically doing the same thing only with different abilites, items, heroes, then you could set these to an array variable at map init
like:
items[1]=Shoe
ability[1]=throw shoe at bush
Then this could be easily done for hundreds of ability-item connections without having to build up such a great if then else tree.
You yourself will know better if it works on your trigger. Sorry but reading it is a pain :D
Trigger:
  • For each Loop Integer A from 1 to X
    • loop
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Items[Integer A]
        • Then - Actions
          • Set temp_ability = Abilities[Integer A]
        • Else - Actions


If you know some Jass you could make your own function for all these floating text things too, than you would save a lot lines of code if you just call your function which creates the text, sets velocity,... .
 

Lord Regno

Active Member
Reaction score
19
That I would never come up with alone, that will same me allot of work th that would work on my map +rep Now I will number all 35 "ability items" and abilitys...

edit: ps. I can't jass yet
 

panzer

New Member
Reaction score
0
Wow

:eek:Now that's what i call a trigger! You must e a world editor genius. :eek:

BTW Just wondering .... does it work aswell???:nuts:
 

Lord Regno

Active Member
Reaction score
19
Do you mean my trigger? Yes it's works but this will save you alot of works:

Trigger:
  • Init ability item
    • Events
      • Time - Elapsed game time is 0.07 seconds
    • Conditions
    • Actions
      • Set abilitys_item[1] = Tome of Absorb Mana
      • Set abilitys_item[2] = Tome of Bash
      • Set abilitys_item[3] = Tome of Berseker
      • Set abilitys_item[4] = Tome of Breath of Fire
      • Set abilitys_item[5] = Tome of Chain Lightning
      • Set abilitys_item[6] = Tome of Cleaving attack
      • Set abilitys_item[7] = Tome of Devotion aura
      • Set abilitys_item[8] = Tome of Evasion
      • Set abilitys_item[9] = Tome of Forked Lightning
      • Set abilitys_item[10] = Tome of Heal
      • Set abilitys_item[11] = Tome of Hurl Bouler
      • Set abilitys_item[12] = Tome of Immolation
      • Set abilitys_item[13] = Tome of Invilibility
      • Set abilitys_item[14] = Tome of Slow
      • Set abilitys_item[15] = Tome of Summon
      • Set abilitys_item[16] = Tome of Throw hammer


Trigger:
  • Init ability
    • Events
      • Time - Elapsed game time is 0.08 seconds
    • Conditions
    • Actions
      • Set abilitys[1] = Absorb Mana (lvl 1)
      • Set abilitys[2] = Bash
      • Set abilitys[3] = Berserk (attack speed 1)
      • Set abilitys[4] = Breath of Fire (lvl 1)
      • Set abilitys[5] = Chain Lightning (lvl 1)
      • Set abilitys[6] = Cleaving Attack (lvl 1)
      • Set abilitys[7] = Devotion Aura (def 1)
      • Set abilitys[8] = Evasion (lvl 1)
      • Set abilitys[9] = Forked Lightning (lvl 1)
      • Set abilitys[10] = Heal (lvl 1)
      • Set abilitys[11] = Hurl Boulder (lvl 1)
      • Set abilitys[12] = Immolation (lvl 1)
      • Set abilitys[13] = Invisibility
      • Set abilitys[14] = Slow (lvl 1)
      • Set abilitys[15] = Summon Water Elemental (summon 1)
      • Set abilitys[16] = Throw Hammer
      • Set number_of_abilitys = 16


Trigger 1 and two must have same items and abilitys.

The big trigger:
Trigger:
  • Tome of ability
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Powerup
      • (Item-type of (Item being manipulated)) Not equal to Tome of Power
    • Actions
      • Set temp_player = (Owner of (Hero manipulating item))
      • For each (Integer A) from 1 to number_of_abilitys, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to abilitys_item[(Integer A)]
            • Then - Actions
              • Set temp_ability = abilitys[(Integer A)]
              • Set ability_int[1] = 1
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ability_int[1] Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of temp_ability for (Hero manipulating item)) Equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • max_abilitys_count[(Player number of temp_player)] Equal to 4
                • Then - Actions
                  • Set ability_int[1] = 0
                  • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You alredy have 4 a...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of (Hero manipulating item)) Current lumber) Greater than or equal to 1
                    • Then - Actions
                      • Set ability_int[1] = 0
                      • Unit - Add temp_ability to (Hero manipulating item)
                      • Player - Add -1 to (Owner of (Hero manipulating item)) Current lumber
                      • Set max_abilitys_count[(Player number of temp_player)] = (max_abilitys_count[(Player number of temp_player)] + 1)
                      • Floating Text - Create floating text that reads -1 above (Hero manipulating item) with Z offset 11.00, using font size 14.00, color (50.00%, 100.00%, 50.00%), and 0.00% transparency
                      • Custom script: call RemoveLocation (udg_temp_point)
                      • Floating Text - Set the velocity of (Last created floating text) to 10.00 towards 70.00 degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                    • Else - Actions
                      • Set ability_int[1] = 0
                      • Game - Display to (All players) the text: You haven't enatch ...
                      • Sound - Play KnightNoLumber1 <gen> at 100.00% volume, attached to (Hero manipulating item)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of temp_ability for (Hero manipulating item)) Greater than or equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of (Hero manipulating item)) Current lumber) Greater than or equal to 1
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of temp_ability for (Hero manipulating item)) Equal to 1
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Hero level of (Hero manipulating item)) Greater than or equal to 5
                            • Then - Actions
                              • Set ability_int[1] = 0
                              • Player - Add -1 to (Owner of (Hero manipulating item)) Current lumber
                              • Floating Text - Create floating text that reads -1 above (Hero manipulating item) with Z offset 11.00, using font size 14.00, color (25.00%, 100.00%, 25.00%), and 0.00% transparency
                              • Floating Text - Set the velocity of (Last created floating text) to 10.00 towards 70.00 degrees
                              • Floating Text - Change (Last created floating text): Disable permanence
                              • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                              • Unit - Increase level of temp_ability for (Hero manipulating item)
                            • Else - Actions
                              • Set ability_int[1] = 0
                              • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You don't are in re...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of temp_ability for (Hero manipulating item)) Equal to 2
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Hero level of (Hero manipulating item)) Greater than or equal to 10
                                • Then - Actions
                                  • Set ability_int[1] = 0
                                  • Player - Add -1 to (Owner of (Hero manipulating item)) Current lumber
                                  • Floating Text - Create floating text that reads -1 above (Hero manipulating item) with Z offset 11.00, using font size 14.00, color (25.00%, 100.00%, 25.00%), and 0.00% transparency
                                  • Floating Text - Set the velocity of (Last created floating text) to 10.00 towards 70.00 degrees
                                  • Floating Text - Change (Last created floating text): Disable permanence
                                  • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                                  • Unit - Increase level of temp_ability for (Hero manipulating item)
                                • Else - Actions
                                  • Set ability_int[1] = 0
                                  • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You don't are in re...
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Level of temp_ability for (Hero manipulating item)) Equal to 3
                                • Then - Actions
                                  • Set ability_int[1] = 0
                                  • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: This skill are alre...
                                • Else - Actions
                                  • Set ability_int[1] = 0
                    • Else - Actions
                      • Set ability_int[1] = 0
                      • Game - Display to (All players) the text: You haven't enatch ...
                      • Sound - Play KnightNoLumber1 <gen> at 100.00% volume, attached to (Hero manipulating item)
                • Else - Actions
        • Else - Actions


Set ability_int[1] = 0 you don't need that, its only there becas i have 2 triggers thats are adding abilitys and thefore I need it.
 
General chit-chat
Help Users
  • The Helper The Helper:
    I just got to watch the video because even though I was there I was trying to work out tech problems with the chat since I was the social media guy so I was distracted but check it out guys the video is super fucking great!
    +1
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top