Unsummon Building for units

CBBPhoenix

New Member
Reaction score
1
Hey guys

I am working on a map where one of the Heroes should be able to "unsummon" their own units to gain ressources (like Undead's Unsummon Buildning in melee maps), but although I have set Targets Allowed to: Air, Ground, Non-Hero, Not Self, Player Units, it says ingame that I must target an Undead Buildning. Seems like some built-in Blizzard cruelty, but is there anything to do about it?

PS: I don't use JASS in my triggering of the map and I am pretty sure that I won't be able to use it.:(
 

oveRLuckEd

New Member
Reaction score
6
Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to <Ability>
    • Actions
      • Unit - Kill (Target unit of ability being cast)
      • Player - Add (Integer((Random real number between 0.00 and 100.00))) to (Owner of (Casting unit)) Current gold

I don't know how to make it to add % of unit's price.
 

ZugZugZealot

New Member
Reaction score
33
Here's an example...

Trigger:
  • Refund w Items
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Unsummon Building
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Town Hall
            • Then - Actions
              • Player - Add -192 to (Triggering player) Current gold
              • Player - Add -102 to (Triggering player) Current lumber
              • Unit - Create 1 Footman for Player 1 (Red) at (Target point of ability being cast) facing (Random angle) degrees
            • Else - Actions
        • Else - Actions


"A unit Starts the effect of an ability" is typically better than "A unit Begins casting an ability". "A unit begins casting an ability" is something you'd want to do with SFX kind of things, but for actual application use "A unit Starts the effect of an ability" to prevent cancel exploiting.
 

oveRLuckEd

New Member
Reaction score
6
Here's an example...

Trigger:
  • Refund w Items
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Unsummon Building
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Town Hall
            • Then - Actions
              • Player - Add -192 to (Triggering player) Current gold
              • Player - Add -102 to (Triggering player) Current lumber
              • Unit - Create 1 Footman for Player 1 (Red) at (Target point of ability being cast) facing (Random angle) degrees
            • Else - Actions
        • Else - Actions


"A unit Starts the effect of an ability" is typically better than "A unit Begins casting an ability". "A unit begins casting an ability" is something you'd want to do with SFX kind of things, but for actual application use "A unit Starts the effect of an ability" to prevent cancel exploiting.

With this trigger he needs to make an action for every build which he wants to unsummon..
 

jackall

You can change this now in User CP.
Reaction score
37
yup... he said he needs to unsummon units not buildings
Trigger:
  • unsummon unit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Unsummon Unit
    • Actions
      • Set unsummonTarget = (Target unit of ability being cast)
      • Set unsummonOwner = (Owner of unsummonTarget)
      • Player - Add (Point-value of unsummonTarget) to unsummonOwner Current gold
      • Floating Text - Create floating text that reads (|cffffcc00+ + ((String((Point-value of unsummonTarget))) + |r)) above unsummonTarget with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Unit - Hide unsummonTarget
      • Unit - Remove unsummonTarget from the game

unsummonTarget is a unit variable
unsummonOwner is a player variable
i suggest you base the ability off bloodlust as you can cast it on allies
dont forget to change the point value of ALL your units so that you dont get 100 for each and every unsummon
 

oveRLuckEd

New Member
Reaction score
6
Trigger:
  • Map Initialization
    • Events
      • Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sell Tower
    • Actions
      • Player - Add (Point-value of (Target unit of ability being cast)) to (Owner of (Casting unit)) Current gold
      • Set Point = (Position of (Target unit of ability being cast))
      • Unit - Remove (Target unit of ability being cast) from the game
      • Special Effect - Create a special effect at Point using UI\Feedback\GoldCredit\GoldCredit.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation( udg_Point )

You need only to change point value of each unit to gold which you want to be given when the unit is going to be unsummon
 

CBBPhoenix

New Member
Reaction score
1
Hmh ya it sounds useful with point values, but I am already using them for heroes to see if a hero is agi, str and int based, but as it should only be cast on units there should be no problems. However; I would like for the ability to give more % gold as it reaches higher levels. Is that possible at all? Thanks for the help so far :D and thanks in advance.
 

jackall

You can change this now in User CP.
Reaction score
37
Trigger:
  • sell unit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sell Unit
    • Actions
      • Set unsummonTarget = (Target unit of ability being cast)
      • Set unsummonOwner = (Owner of unsummonTarget)
      • Set unsummonValue = ((Point-value of unsummonTarget) x (Level of Sell Unit for (Triggering unit)))
      • Player - Add unsummonValue to (Owner of (Triggering unit)) Current gold
      • Floating Text - Create floating text that reads (|cffffcc00+ + ((String(unsummonValue)) + |r)) above unsummonTarget with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Unit - Hide unsummonTarget
      • Unit - Remove unsummonTarget from the game

this gives the point value of your unit X level of ability
unsummonValue is an integer variable
 

CBBPhoenix

New Member
Reaction score
1
Ah yes, that's the Arithmetic function right? I think that solves everything thank you. But I was wondering in general when using the "A unit starts the effect of an ability" does it refer to the unit casting the ability (here: the Hero) or the target (the unit to be unsummoned)? To me it seems as it refers to the Hero according to your trigger. Going to try the trigger :p thanks

Came to think of something. This ability I am requesting could just be made from Transmute... But luckily my hero already has that ability to use on enemies so I guess this is fine to avoid cooldown overrides...
 

jackall

You can change this now in User CP.
Reaction score
37
the event does refer to the casting hero aswell as these events:
Trigger:
  • Unit - A Unit Starts casting an ability
    • Unit - A Unit Finishes casting an ability
    • Unit - A Unit Starts channeling an ability
and so on
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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 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