HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Regarding Conflict of two different scripts

05-27-2005, 02:03 PM#1
winma
Hey guys...

i've been scripting for hero abilities on this two team AOS/DOTA type of map and i've come to a few problems.

Several custom abilities made from Thunder Clap as a base to be used as dummy "activating" spells. Each of those custom made abilities have different effects and an entirely different trigger.

The event is a generic unit when the unit starts the effects of an ability.

The abilities work flawlessly when they're activated individually.

E.g 1 - Hastega
When the spell is casted, an array of dummy units are created over the casting unit and then the dummy units pick units from a unit group and cast a spell (blood lust) on them. then after all that is done, (wait around 0.5 seconds) all the dummy units are removed.

E.g 2 - Hell Fire
Over time (around 0.3 second interval) from 1 to 9 dummy units are created at random spots around the caster and then each are ordered to cast a thunderclap spell. This is all done when the hero with Hell Fire activates it through casting the ability.

The problem occurs when i cast Hell Fire, and then my opponent casts Hastega in the process. The Hell Fire triggers are interrupted somehow and don't finish off with the remaining unit creations from the array. The spell is then stopped.

So in short, i want to ask if is there any way to fix two GUI triggered spells so that they may be casted at the same time, and yet fully function. I never recall this happening when i started triggering custom spells in 1.16..

please tell me this is a 1.18 bug and it'll be fixed T-T

otherwise help would be greatly accepted in order to solve this problem.
05-27-2005, 03:36 PM#2
StealthFox
You can't use multiple Thunder Clap based spells at the same time. Thunder Clap has a built-in order string and a unit cannot use it one after another. Its like trying to use two different mirror images...it just doesn't work. Try switching them to a different base and I'm assuming you'll want ones that don't have a target. Also, try using unit abilities that become hero abilities. (There are a lot more unit abilities than hero abilities)
05-27-2005, 04:35 PM#3
Anitarf
StealthFox is right, having multiple abilities of the same type on the same hero causes bugs due to orderstring conflict. However, that is not your problem.

Your problem is that "cast" event responses are bugged and work as a global variable. So, if there's a trigger running on a cast event and another cast event happens, it will override the other's trigger "casting unit" or "cast target". If your triggered spell is a no-target or point-target spell (in your case, you use thunder clap, so it's a no-target), you can replace it with a summon spell. Then you can use the "unit spawns a summoned unit" event which event responses ("summoning unit", "summoned unit") aren't bugged like that.

Alternatively, you can use the cast event and then local variables to store the casting unit. This is a problem only if your trigger waits, if it executes all it's actions immediately when it runs, this problem cannot occur.
05-27-2005, 10:24 PM#4
winma
Oh i see. So it's the event of Generic "Unit starts the effect of an ability". I'll try out the unit spawn a summoned unit event. But i need to at least have one more other event that can do similar things. Because i have a total of 3 abilities on the map on 3 different heroes that have wait events in the trigger. Nevertheless i'll try storing the casting unit in a local variable as well. Thanks for the help.
05-28-2005, 08:17 AM#5
Anitarf
Well, if it's on different heroes, then you can use the same summon spell for all of them. The orderstring conflict only happens if you use same spells on the same hero. As I said, with the summon event, the event responses will be the same even after waits, even if other summon events happen in the meantime.
05-31-2005, 11:21 PM#6
winma
I just checked everything again and this time i clearly saw what the problem was...
When i cast the first ability, the dummy unit spends its time casting haste on units around it. But when i activate another ability... the dummy unit from the previous ability dissapears for some reason. It happens vice versa as well.

I need to know if there are any script conflicts between these two... I stopped using arrays for my dummy unit casting spells ability(Hastega) but Hellfire still has arrays. Here are the triggers


Code:
Hell Fire
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Hell Fire (Arhimonde 2)
        (Unit-type of (Casting unit)) Equal to Hell's Servant
    Actions
        Set Hell_Fire_caster = (Casting unit)
        For each (Integer A) from 1 to (1 + (2 x (Level of Hell Fire (Arhimonde 2) for Hell_Fire_caster))), do (Actions)
            Loop - Actions
                Unit - Create 1 Dummy Caster (Archimonde) for (Owner of Hell_Fire_caster) at ((Position of Hell_Fire_caster) offset by (Random real number between 100.00 and 400.00) towards (Random angle) degrees) facing Default building facing degrees
                Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                Set Hell_Fire_Dummy_Unit[(Integer A)] = (Last created unit)
                Unit - Order Hell_Fire_Dummy_Unit[(Integer A)] to Human Mountain King - Thunder Clap
                Special Effect - Create a special effect at (Position of Hell_Fire_Dummy_Unit[(Integer A)]) using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
                Wait 0.05 game-time seconds

Code:
Hastega
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Hastega 
        (Unit-type of (Casting unit)) Equal to Glock (keeper of time)
    Actions
        Set Hastega_Caster = (Casting unit)
        For each (Integer A) from 0 to 0, do (Actions)
            Loop - Actions
                Unit - Create 1 Dummy Caster (Time Mage's hastega) for Neutral Passive at (Position of Hastega_Caster) facing Default building facing degrees
                Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                Set dummy_hastega = (Last created unit)
                Unit - Set Level of Haste (dummy haste) for dummy_hastega to (Level of Hastega  for Hastega_Caster)
                Unit - Order dummy_hastega to Orc Shaman - Bloodlust Hastega_Caster
                Wait 0.10 game-time seconds
                For each (Integer B) from 1 to 15, do (Actions)
                    Loop - Actions
                        Unit Group - Pick every unit in (Units within 600.00 of (Position of Hastega_Caster) matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of Hastega_Caster)) Equal to True) and ((((Matching unit) has buff Haste ) Equal to False) and (((Mat and do (Actions)
                            Loop - Actions
                                Unit - Order dummy_hastega to Orc Shaman - Bloodlust (Picked unit)
                        Wait 0.10 game-time seconds

And that's all to it...
i'm thinking maybe the "last created unit" event response is somehow overwritten when i cast a spell or something. This is really weird because when i tried spells before they never stuffed up like this...

Just to make sure - the exact thing happening is when i cast Hellfire, the dummy units start being placed randomly around the hero (hero number 1) and it lasts for around .8 seconds. WHen i cast hastega (it's on another hero) the hellfire dummies all dissapeared (i gave them a model so i can see them). I just want to see if anyone knows what is happening and how they manage to dissapear...

does activating another trigger reset the previous values or something? because i don't have any scripts that INSTANTLY removes all of the previous dummy units... i thought that maybe using arrays would reset everything in the variables... but i still gave the units a 3 second expiration time... which is really weird.

EDIT: I think the problem is that my spells don't have multi instance or something... i've searched the forums for a while and checked the tutorials and i can't find a thread on it... can someone give me a link please? thanks in advance.
06-01-2005, 09:30 PM#7
Anitarf
Well, the thing that can get reset is the (Integer A) variable, I see you use it in both spells (quite needlessly in one of them).

Edit: by the way, the hastega trigger appears to me to loop too much. You pick every unit and cast haste on it 15 times.
06-01-2005, 09:55 PM#8
Earth-Fury
create Number Dummy_haste at loction of (casting unit) owned by ower of (casting unit)
pick all units of type Dummy_Haste and do
put the actions in your loop here, using picked unit.

try that instead of the loop. (i may have left something out, but i cant stand laying out exact tirggers)
06-01-2005, 10:22 PM#9
winma
but the problem with that was that if i used the unit group and then cast on each of them, the spell only casts on around 1 or 2 of them because it happens so fast... That's why i had to use loops... and i thought it wasn't efficient to put wait actions within picking units.. I've even set the caster backswing of thedummy unit to 0.000 and made sure the spells had no casting time... it still won't cast on every unit in an instant at the same time.
06-01-2005, 10:40 PM#10
Earth-Fury
spells need some time to register. also, is the casting time set to ZERO?
06-02-2005, 05:03 AM#11
winma
guys, i can never thank you enough! i've finally used custom variables for each separate loop and it's all working now! thanks a bunch!