Ack! Too many targets!

gameshow

New Member
Reaction score
1
Ok, i've got an ability which when cast, automatically searches all the units X distance from the caster to find any heroes, and then launches a hero-seeking attack.

Problem: It will always find ALL the heroes. I'd like it to stop once it finds one. do i need to turn the trigger off, or something?
 
Code:
Death On Wheels
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Flame Bastard - Death on Wheels 
    Actions
        Unit Group - Pick every unit in (Units within 1200.00 of (Position of (Triggering unit))) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Unit-type of (Picked unit)) is A Hero) Equal to True
                        ((Picked unit) belongs to an enemy of (Triggering player)) Equal to True
                        ((Picked unit) is alive) Equal to True
                    Then - Actions
                        Unit - Create 1 Remote Control Bomb for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                        Unit - Order (Last created unit) to Neutral - Kaboom! (Picked unit)
                    Else - Actions
 
If you just want this for one unit, put those "unit in range ..." in a variable of type unit-group,
then just attack "random unit of unit-group".

Or, try to add a "skip remaining actions".
 
I think i got it, what i did was created a variable which prevented the loop from continuing once it found a target. Here's the new code below:

Code:
Death On Wheels
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Flame Bastard - Death on Wheels 
    Actions
        Set death_on_wheels_targets = 0
        Unit Group - Pick every unit in (Units within 1200.00 of (Position of (Triggering unit))) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        death_on_wheels_targets Equal to 0
                        ((Unit-type of (Picked unit)) is A Hero) Equal to True
                        ((Picked unit) belongs to an enemy of (Triggering player)) Equal to True
                        ((Picked unit) is alive) Equal to True
                    Then - Actions
                        Set death_on_wheels_targets = 1
                        Unit - Create 1 Remote Control Bomb for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                        Unit - Order (Last created unit) to Neutral - Kaboom! (Picked unit)
                    Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper
  • Stephen Stephen:
    Oh no - please don't lose the Nuon content
    +1
  • The Helper The Helper:
    Someone email AtariAge and see if they want me to transfer the forum data over to it
  • Ghan Ghan:
    Could probably keep NUON stuff around here if we wanted.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top