1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

UnitDamageUnit function missing ?

Discussion in 'StarCraft II Modding' started by Rushhour2, Aug 31, 2010.

  1. Rushhour2

    Rushhour2

    Joined:
    Apr 30, 2010
    Messages:
    14
    Resources:
    0
    Resources:
    0
    Don't tell me that there is no equivalent for the function UnitDamageTarget...

    The only possibilty I currently see is modifying a unit's damage and adding a weapon, but that would be incredibly stupid if there was no such function. How could I dynamically deal damage to other units? I can't create effects for every possibilty.

    I searched all Unit action functions. The overall editor-search-function doesn't seem to work.

    And for all those german people that are desperatly searching the " timer " variable: It is called "Zeitschalter" ... stupid translations. :D
     
  2. wangbot

    wangbot

    Joined:
    Aug 2, 2010
    Messages:
    17
    Resources:
    0
    Resources:
    0
    Create a damage effect in the data editor and use catalog funcs to change the damage amount and the create effect funcs to apply the effect to units that you want to damage.
     
  3. Rushhour2

    Rushhour2

    Joined:
    Apr 30, 2010
    Messages:
    14
    Resources:
    0
    Resources:
    0
    Wow that's a powerful function. Thanks I didn't know it existed. +rep

    But I'm confused about the player-parameter part. Could it be unsafe to set it for one player only and then deal damage with this effect? Do I need to use the preset "c_playerAny" or do I need to loop through every player and set it?

    And: Am I right that there is no hasing function for objects like units? No GetHandleId ? :(
    How do you make your good old MUI spells? How do you index the arrays/record-structs/data tables)? I don't want to rely on the data editor only.
     
  4. wangbot

    wangbot

    Joined:
    Aug 2, 2010
    Messages:
    17
    Resources:
    0
    Resources:
    0
    You just need to change the damage value for the player that's dealing the damage. Catalog funcs that set fields basically do what upgrades do; there's no danger in only one player having an ugprade, so there's no danger here either.

    Unfortunately, there's no hashing function for units. Hopefully blizz will add one in a later patch, but that may not happen.

    However, one way to do MUI is to take advantage of unit custom values. You can store fixed values (and there are multiple indices, so more than one system can use custom values), so you can either directly store numerical data or store the index of some global array or something where you have that unit's data.