Pick all units to determine Damage, and some Special Effects

DM Cross

You want to see a magic trick?
Reaction score
568
I'm having a problem with this trigger I'm using to pick all units in the map at casting so that number will determine how much damage an ability does. Here's the code I tried:

Code:
Bomb
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Bomb
    Actions
        Set BombDamage = ((Real((Number of units in (Units in (Playable map area))))) x 10.00)
        Set BombTarget = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
        Wait 9.75 seconds
        Special Effect - Create a special effect at BombTarget using Units\Demon\Infernal\InfernalBirth.mdl
        Wait 2.00 seconds
        Special Effect - Destroy (Last created special effect)
        Special Effect - Destroy BombEffect
        Unit Group - Pick every unit in (Units within 500.00 of BombTarget) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - BombDamage)

BombTarget is a Point variable.
BombDamage is a Real variable. (Should I be using an Integer?)

The special effects work fine. It's the damage that seems to be screwed up, since that's the part my computer froze until I restarted it at.

Also, is it alright that I didn't set the Infernal special effect to a variable, and simply destroyed it 2 seconds after I created it?

I figured this was easier, but didn't know if it was a good or bad idea...

Any help, guys?
 
So the problem is with dealing damage, isn't it?
Have you tried with "Unit - Damage area"?
I don't know if it needs the caster to be a certain distance or whatever, but I think it can work.
Code:
Unit - Order (Caster) to damage area of size 500.00 at (BombTarget) for BombDamage using attack type Spells and damage type Normal.
 
I suggest you destroy every special effect you make the instant after you make it (the next action; this includes in the loop). I believe special effects will finish the animation after they are destroyed. As long as it isn't a looping animation, it's a bit cleaner.

Also, what the heck is BombEffect, and why are you destroying it?

Like xPheRe said, also try using the damage actions instead. (Except I've never gotten Damage Area to work, though I haven't tried very hard at it.)

Otherwise that looks like it should work, as long as you don't cast it twice.
 
BombEffect is a special effect variable, as I stated.

Edit
Found the damage area. Sorry, wasn't looking far down enough.
 
Unit - Order unit to damage ...

Should be the very last thing in the "unit" list (or close to the end, at least).

Careful though, as it damages anything in that area...
For a bomb, that's expected I guess :)


> BombEffect is a special effect variable

I see no "set BombEffect"?


[EDIT]
:rolleyes:
 
Oh, you're right... I just forgot about it, I guess, and I set it before I tested, but it froze the comp, anyway -.-

This is what I turned it into:

Code:
Bomb
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Bomb
    Actions
        Set BombDamage = ((Number of units in (Units in (Playable map area))) x 10)
        Set BombTarget = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
        Wait 9.75 seconds
        Special Effect - Create a special effect at BombTarget using Units\Demon\Infernal\InfernalBirth.mdl
        Wait 2.00 seconds
        Special Effect - Destroy (Last created special effect)
        Special Effect - Destroy BombEffect
        Unit Group - Pick every unit in (Units within 500.00 of BombTarget) and do (Actions)
            Loop - Actions

Anymore ideas?
 
Code:
Bomb
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Bomb
    Actions
        Set BombDamage = ((Number of units in (Units in (Playable map area))) x 10)
        Set BombTarget = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
                Special Effect - Destroy (Last created special effect)
        Wait 9.75 seconds
        Special Effect - Create a special effect at BombTarget using Units\Demon\Infernal\InfernalBirth.mdl
        Special Effect - Destroy (Last created special effect)
        Wait 2.00 seconds
        Unit Group - Pick every unit in (Units within 500.00 of BombTarget) and do (Actions)
            Loop - Actions
                [i]<damage picked unit>[/i]
Try that... although it really shouldn't be crashing. :confused:
 
Code:
SpiritBomb
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Spirit Bomb (Goku)
    Actions
        Set SpiritBombDamage = ((Real((Number of units in (Units in (Playable map area))))) x 2.00)
        Set SpiritBombTarget = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
                Special Effect - Destroy (Last created special effect)
        Wait 9.75 seconds
        Special Effect - Create a special effect at SpiritBombTarget using Units\Demon\Infernal\InfernalBirth.mdl
        Wait 2.00 seconds
        Special Effect - Destroy (Last created special effect)
        Unit Group - Pick every unit in (Units within 500.00 of SpiritBombTarget) and do (Actions)
            Loop - Actions
                Unit - Order (Casting unit) to damage area in 0.50 seconds of size 500.00 at SpiritBombTarget for SpiritBombDamage using attack type Spells and damage type Normal.

It still crashs. It just manages to crash AFTER the ability ends. And the first special effect doesn't happen until after the ability...
 
Alexander said:
It still crashs. It just manages to crash AFTER the ability ends. And the first special effect doesn't happen until after the ability...
Try zapping the waits or changing them to game-time waits (which they should be anyway).
 
I stripped it down to doing nothing but damage.

Code:
Bomb
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Bomb
    Actions
        Set BombDamage = ((Real((Number of units in (Units in (Playable map area))))) x 2.00)
        Unit Group - Pick every unit in (Units within 500.00 of BombTarget) and do (Actions)
            Loop - Actions
                Unit - Order (Casting unit) to damage area in 0.50 seconds of size 500.00 at BombTarget for BombDamage using attack type Spells and damage type Normal.

Yup, it still crashes. So ... It must be something with the damage, if you want my opinion (not that I really understand it, so yeah...)

Could it be that I'm ordering the casting unit to do more damage then he's capable of doing? Or that the type of damage isn't his type of damage? (The casting unit is a hero, with hero melee damage)

Still need help.
 
I think the damage area is flawed. It doesn't matter anyway if you order a unit to attack area or whatever, because it STILL doesn't give gold for killing said unit. That's why I set life of ____ to life of ____ - (damage to be done)

Ordering to damage area of a different type or amount should NOT be the problem :)
 
Gold? Who said anything about gold. If anything, I don't want gold given.

I already tried "Set life of Picked unit to (Life of Picked unit - BombDamage)" or whatever. See the first post.

I still don't know how to write the proper code for this...
 
That so? Well that was an issue for CoH, so there :D

Well, I can't make heads or tails of your graphics. It'd be better if after creation you set a Special Effects Array equal to the effect placed on the targeted units (using an integer that is constantly set to 0). After the wait, you can run a for loop to delete them all.
 
The problem isn't with the Special Effects, Rin. I just tore the trigger down, and used NO Special Effects whatsoever, just the damage part, and it didn't work.

I'll keep the stuff you said in mind and all, but... That's not what I need help on.
 
Yea? Well, consider removing the DAMAGE doing and see if the graphics still work. I'm actually more convinced the problem is with the ability itself--not the trigger.

Because, to put it simply, I have abilities like these all the time and they work.
 
OK, I'll try doing just the graphics, then.

By the way, the ability itself is based of off Flame Strike. All the damage values and stuff were set to 0.

Here's something weird -.- One of the damn data files for Flame Strike is in some Raw code.

Data - WESTRING_AEVAL_HSF6

I... Have no idea what that field is for. Anyone else know?
 
Nope, but I preferred leaving that ghost field ALONE. Perhaps if you changed it, you might've damaged something.

And hey, if you set various area settings to 0, you won't be able to target anything. Try 10 :)
 
Sounds like an area of effect field? Just judging by the AE in it. Maybe not though.
 
Whatever it was, that's what was crashing the game. I set it to default and then was able to test it (without the trigger enabled) and it didn't crash! :)

I'll try to remake the trigger (since I destroyed msot of the damn thing) and see if it works.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    How often does the Trending Content box refresh?
  • The Helper The Helper:
    Also, in the last template there was a seperation between sticky threads and regular threads in the forum
  • Ghan Ghan:
    Not sure. It's probably part of a cron job.
  • The Helper The Helper:
    Hey Ghan, whatever cron job its part of its not running its been the same for days. If it does not work can we remove it?
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top