removing units help

Epicurus

New Member
Reaction score
1
I need to get these units out of a region after a couple of other things are done but when I test it the units stay.

JASS:
Save01
    Events
        Unit - A unit enters secondary death 01 <gen>
    Conditions
        ((Owner of (Triggering unit)) controller) Equal to User
    Actions
        Hero - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 10) experience to (Triggering unit), Hide level-up graphics
        Player - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 10) to (Owner of (Triggering unit)) Current gold
        Unit Group - Remove all units of (Units of type Light Blue Flag) from (Units in secondary death 01 <gen>)
 

Tyrulan

Ultra Cool Member
Reaction score
37
It's the Unit Group call.

Pick all units in region matching matching unit is owned by player (10)(light blue) and remove unit

Something like that, too lazy to do it in GUI but if you need me to I will.

EDIT: Oh and use Entering Unit, not Triggering Unit. :p
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
@Tyrulan: Triggering Unit is the correct call here, Entering Unit and etc. are mostly buggy, but the exclusive few can not be used here.
 

Tyrulan

Ultra Cool Member
Reaction score
37
Alright, didn't know. Why would Blizzard commands be bugged?... My suggestion still follows, use a select units in region.
 

Epicurus

New Member
Reaction score
1
Thanks Tyrulan.

I would also like to know what is buggy about the entering command, I'm doing a kdo tag were all your gold comes from saving units so it would be a big problem if it has a bunch of problems.

Also, when the unit is removed, I wanted another units to be created somewhere on the map. I tried "unit leave region" but that didn't work. Any thoughts?

Thanks
 

Tyrulan

Ultra Cool Member
Reaction score
37
It would be easier to tell you why if you looked at the Jass code...

Entering Unit:
constant native GetEnteringUnit takes nothing returns unit

Triggering Unit:
constant native GetTriggerUnit takes nothing returns unit

There is no real difference in the command itself but the way the WE handles it was done badly. Similar to how you can never really remove the effects of earthquake when editing the spell, it has it's own internal data which can glitch and bug especially when running the spell as MUI. (Multi-Unit Instanceable)
 

Epicurus

New Member
Reaction score
1
What do you think making units from when another is removed.
There is no "unit is removed."
 

Tyrulan

Ultra Cool Member
Reaction score
37
Not sure what you mean... but here. This should help.

Trigger:
  • Untitled Trigger 002
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in No region matching ((Unit-type of (Matching unit)) Equal to Footman)) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
@Tyrulan: That trigger leaks, set the units equal to footman into a group and remove it afterward.
 

Tyrulan

Ultra Cool Member
Reaction score
37
If it leaks then please, post a new GUI tag. I'm not trying to make the code perfect and you should never take to hear that I've made the trigger perfectly, merely I am showing how this particular problem could be solved. You can't remove all leaks in GUI anyways.
 

Epicurus

New Member
Reaction score
1
ok, I'll post what I tried so theres no confusion.

So here, is where they are removed. Notice the unit group remove blah blah...

JASS:
Save01
    Events
        Unit - A unit enters secondary death 01 <gen>
    Conditions
        ((Owner of (Triggering unit)) controller) Equal to User
    Actions
        Hero - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 10) experience to (Triggering unit), Hide level-up graphics
        Player - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 10) to (Owner of (Triggering unit)) Current gold
        Unit Group - Pick every unit in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue)) and do (Unit - Remove (Picked unit) from the game)


Then I want to make a new unit when the flags are removed, but nothing happens. I think its becuase "leave region" is different than "remove"

JASS:
civil make
    Events
        Unit - A unit leaves (Playable map area)
    Conditions
        (Unit-type of (Triggering unit)) Equal to Light Blue Flag
    Actions
        Unit - Create 1 Civilian (Male 2) for Player 10 (Light Blue) at (Random point in (Playable map area)) facing Default building facing degrees
 

Tyrulan

Ultra Cool Member
Reaction score
37
Why not just have your Unit Group command use Multiple Actions and create your new unit then??
 

Epicurus

New Member
Reaction score
1
I tried this, but when I tested it there were three flags and three spots of units popped up on the map one spot had 1 another 2 and the last had 3. I want it to make 1 unit per flag.

Trigger:
  • Save01
    • Events
      • Unit - A unit enters secondary death 01 <gen>
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Hero - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 10) experience to (Triggering unit), Hide level-up graphics
      • Player - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 10) to (Owner of (Triggering unit)) Current gold
      • Unit Group - Pick every unit in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue)) and do (Actions)
        • Loop - Actions
          • Unit - Create ((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))) + 0) Civilian (Male 2) for Player 10 (Light Blue) at (Random point in (Playable map area)) facing Default building facing degrees
          • Unit - Remove (Picked unit) from the game
 

Tyrulan

Ultra Cool Member
Reaction score
37
When it goes through the loop the first time it is creating 3 units for (Every Unit in Region). The second time through it creates 2 units for (Every Unit In Region) Third unit was removed, an so on.

Change the create unit to just Create 1 (unit type) at random point in region)..

:)

EDIT: Sorry let me clarifiy

-First Loop-
3 units in region
Creates 1 unit for each
Remove 1 unit

-Second Loop-
2 units in region
Creates 1 unit for each
Remove 1 unit

-Third Loop-
1 unit in region
creates 1 unit
removes last unit
 

Epicurus

New Member
Reaction score
1
Thanks.

I'm still new to a lot of the triggers so I'm sorry if I'm being painfully noobish.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top