Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Unit Size - Trigger Editor - Default Size?

Discussion in 'World Editor Help Zone' started by Newbestyle, Jan 17, 2012.

  1. Newbestyle

    Newbestyle

    Joined:
    Nov 3, 2008
    Messages:
    42
    Resources:
    0
    Resources:
    0
    [SOLVED - Not possible]
    Hey there,

    I've seen some spells modifying the unit size already, so I've decided to try one aswell.
    xxdingo... is coding in Jass, im using the GUI.
    The spell he made changes the size of a unit to a specific multiplier and kills it, then resets its unit size.
    Here is my problem:

    • Animation - Change Voodoo_Unit_Target's size to (Voodoo_Real_Temp%, Voodoo_Real_Temp%, Voodoo_Real_Temp%) of its original size

    This changes the unit size over time, working brilliantly.
    However, once the timer expires i want to reset the unit size.

    The only way I found is following function:
    • Animation - Change Voodoo_Unit_Target's size to (100.00%, 100.00%, 100.00%) of its original size


    If the unit I'm modifying is scaled x2 by default (Object Editor/Art-Scaling Value) its size will be less than it was before. This is because the 100% refer to the original scale of the model itself.

    My question to you fine folks is wether you know a possibilty (in Jass or however) how to return the scaling value of a unit in particular. So I can save it beforehand and reset it to the value afterwards.
     
    Last edited: Jan 17, 2012
  2. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    even if you adjust it in the object editor the base of your unit is always 100% so
    if you increase it to 10% you must divide it also to 10%, coz the new size is the
    new 100% size of your unit...
     
  3. Newbestyle

    Newbestyle

    Joined:
    Nov 3, 2008
    Messages:
    42
    Resources:
    0
    Resources:
    0
    It is not. E.g. the forest trolls:
    The Forest Troll Warlord has the same model as the Trapper has, but is x1.55 as big.
    My scale increases from 100%-200%.
    The very moment the trigger starts, the Warlord will become as small as the Trapper.
    If both units are being 200% of their original scale they are the exact same size.
     
  4. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    no, I mean sample if you adjust the size from object editor to 0.1 then that's his 100%
    size (normal size)...
    maybe you post triggers or best the model...as Ima check it when Im off duty...
     
  5. Newbestyle

    Newbestyle

    Joined:
    Nov 3, 2008
    Messages:
    42
    Resources:
    0
    Resources:
    0
    Well, still.. The trigger increases the unit size from 100% up to 200%.
    If you take a look at the screenshots, you will see that the Warlord ("Kriegsherr" in german - the left one) will be set to the 1x size of the model.

    This is not the point though. Im only wondering if one could use a custom script to fix it.
    Probably there is a possibility in JASS to return the size of the unit.
    Trigger:
    • Events
      • Time - Every 0.05 seconds of game time
    • Actions
      • If - Conditions
        • Spell_Voodoo_Real_Timer Less than 8.00
      • Then - Actions
        • Set Spell_Voodoo_Real_Timer = (Spell_Voodoo_Real_Timer + 0.05)
        • Set Spell_Voodoo_Real_Temp = (100.00 + (Spell_Voodoo_Real_Timer x (100.00 / 8.00)))
        • Animation - Change Spell_Voodoo_Unit_Effect's size to (Spell_Voodoo_Real_Temp%, Spell_Voodoo_Real_Temp%, Spell_Voodoo_Real_Temp%) of its original size
        • Animation - Change Spell_Voodoo_Unit_Target's size to (Spell_Voodoo_Real_Temp%, Spell_Voodoo_Real_Temp%, Spell_Voodoo_Real_Temp%) of its original size
      • Else - Actions

     
  6. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    There's no way to get a unit's scale size.

    When you scale up, use Set Spell_Voodoo_Real_Temp = (155 + ...)
    When you scale it down, set the size to 1.55, 1.55, 1.55
     
  7. Newbestyle

    Newbestyle

    Joined:
    Nov 3, 2008
    Messages:
    42
    Resources:
    0
    Resources:
    0
    Okay, thanks a lot.
    I'm sad, but still.. Thanks. :*
     
  8. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    This will do...
     

    Attached Files:

  9. Newbestyle

    Newbestyle

    Joined:
    Nov 3, 2008
    Messages:
    42
    Resources:
    0
    Resources:
    0
    Thanks a lot for your effort and that script. My GUI "script" - if I may call it such - is working fine though. I will stick to that. Thanks folks. :)