Multiple Hero Selection Spell. Not Working as expected.

Kelv

TH.net Regular
Reaction score
7
I changed a spell from a single hero, to a multiple hero spell, and I actually thought that the spell work easier and better, but I cant seem to get the spell to work. I have one trigger that splits all the heroes into two groups at the beginning of the game, into Alliance and Horde heroes. So I have this skill which is an alliance spell. My first trigger is this:
Code:
Manual Select
    Events
        Unit - A unit Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to True
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Sold unit))) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to False
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                        Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                        Special Effect - Destroy (Last created special effect)
                        Unit - Move (Sold unit) instantly to (Position of (Picked unit))
                        Neutral Building - Remove (Unit-type of (Sold unit)) from all marketplaces
                    Else - Actions
                        Do nothing
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
                Special Effect - Create a special effect at (Position of (Sold unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                Special Effect - Destroy (Last created special effect)
        Game - Display to (All players) the text: ((Name of (Owner of (Sold unit))) + ( has chosen:  + (Name of (Sold unit))))
        Item - Create Replenishment at (Center of (Playable map area))
        Hero - Give (Last created item) to (Sold unit)
        Selection - Select (Sold unit) for (Owner of (Sold unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Sold unit)) is an ally of Player 1 (Red)) Equal to True
            Then - Actions
                Unit Group - Add (Sold unit) to Ally_Heroes
            Else - Actions
                Unit Group - Add (Sold unit) to Horde_Heroes
Player 1 is a computer for the alliance, player 6 is a computer for the horde.

My second trigger, which is the spell trigger, is this:
Code:
Pray to Naaru
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Pray to Naaru 
    Actions
        Unit Group - Pick every unit in Ally_Heroes and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Less than or equal to 80
                    Then - Actions
                        Wait 0.50 seconds
                        Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
                        Wait 0.10 seconds
                        Special Effect - Destroy (Last created special effect)
                        Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ((Real((Level of Pray to Naaru  for (Triggering unit)))) x 150.00))
                        Floating Text - Create floating text that reads (Healed  + (String(((Level of Pray to Naaru  for (Triggering unit)) x 150)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 100.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
                        Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
                        Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
                        Wait 0.40 seconds
                        Special Effect - Destroy (Last created special effect)
                        Trigger - Run (This trigger) (ignoring conditions)
                    Else - Actions
                        Game - Display to (All allies of (Owner of (Triggering unit))) for 10.00 seconds the text: ((A'dal: Sorry  + (Name of (Owner of (Triggering unit)))) + , My powers are not strong enough.)
                        Floating Text - Create floating text that reads FAILED! at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
                        Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
                        Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees

Can anyone see any glitches in my code, aside from leaks? (If you notice there are likes (which I assume there are) feel free to call me out on them, it would be a help, but its not the point of the thread. Thanks for reading
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
could it be that more then 1 hero cast this at the same time?
in each case this Special Effect - Destroy (Last created special effect) after a wait will remove any last created special effect(not only the one of the spell
 

Iwan_Krissov

New Member
Reaction score
18
Are you sure its not working?
I could imagine its working very slowly, because you have waits in your loop. Every time the trigger is called, it will have to wait about 1.00 secs within the loop. I dont know if this is working at all, using waits in loops, but it will definitely slow it down...#

EDIT:
No does not work at all, I tried out. Get rid of the waits inside the loop
 

Kelv

TH.net Regular
Reaction score
7
Okay, it seems to be working now, I haven't done that much testing. The problem is, what do I replace with those waits? I cant have the spell going off, maybe 1000 times in a second. I want the trigger to occur once a second.
 

Iwan_Krissov

New Member
Reaction score
18
Code:
Pray to Naaru
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Pray to Naaru 
    Actions
        Unit Group - Pick every unit in Ally_Heroes and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Less than or equal to 80
                    Then - Actions
                        Trigger - Run Wait1 <gen> (ignoring conditions)
                        ...and so on

Code:
wait1
    Events
    Conditions
    Actions
        Wait 0.50 seconds
        Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl

perhaps something like this ... but there are surely other ways to do so, but I dont know them ...
 

Kelv

TH.net Regular
Reaction score
7
Okay, I would like to get some more input from someone that knows other ways.
+ rep for helping me realize the problem was with the waits.
 

cleeezzz

The Undead Ranger.
Reaction score
268
you could use timers but its takes a lot more work for something this simple.
 

Kelv

TH.net Regular
Reaction score
7
If I wanted to use timers, how would I do it. Would I need more than one trigger?
 

Kelv

TH.net Regular
Reaction score
7
bump, you can delete this please, I am looking from advice from someone with experience in triggers without waits.
 

cleeezzz

The Undead Ranger.
Reaction score
268
well..set a new variable, Timer, name it whatever you want.
and..

Code:
Pray to Naaru
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Pray to Naaru 
    Actions
        Unit Group - Pick every unit in Ally_Heroes and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Less than or equal to 80
                    Then - Actions
                        Set Temp_Int [Playner number of (Owner of (Triggering Unit))) = 0
                        Timer - Start (My_Timer[(Player number of (Owner of (Triggering Unit))) as a repeating timer that will expire in .30 seconds.
can i just round the waits? lol.
Code:
My Timer
    Events
        Time - My_Timer[1] expires
        Time - My_Timer[2] expires
        Time - My_Timer[3] expires
        Time - My_Timer[4] expires
        Time - My_Timer[5] expires
        Time - My_Timer[6] expires
        Time - My_Timer[7] expires
        Time - My_Timer[8] expires
        Time - My_Timer[9] expires
        Time - My_Timer[10] expires
        Time - My_Timer[11] expires
        Time - My_Timer[12] expires
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                Custom script:   if GetExpiredTimer() == udg_My_Timer[bj_forLoopAIndex] then
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Temp_Int[Integer A] = 1
                    Then - Actions
                        Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
                        Special Effect - Destroy (Last created special effect)
                        Set Temp_Int[Integer A] = 2
                     Else - Actions
                            If - Conditions
                                 Temp_Int[Integer A] = 2
                            Then - Actions
                                 Blah balh
                Custom script:   endif
get it?

when it reaches the end of the trigger like lets say temp_int = 8 or 9
do- Pause My_Timer[Integer A] so it stops setting it off.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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