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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest.
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. 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.

A confusing Reals and Integers

Discussion in 'World Editor Help Zone' started by Edge45, Feb 17, 2014.

  1. Edge45

    Edge45

    Joined:
    May 15, 2013
    Messages:
    2,570
    Resources:
    27
    Models:
    8
    Icons:
    17
    Template:
    2
    Resources:
    27
    Hello WEditors, What is the real or integer of 30% of intelligence, For Example
    I created a shockwave with triggered damage, but first i need a variable,

    • Set Variable - Set DamageReal - (60.00 + (Real(Intelligence of Casting Unit (Include Bonus)) (x or /) (3?)

    what is it? X or / And the last number, 3?
     
  2. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,979
    Resources:
    17
    Spells:
    17
    Resources:
    17
    Damage-calculation should be done in Reals.

    To get 30%, you should multiply the value of INT by 0.30.
    • Set Damage = (60.00 + ((Real((Intelligence of (Triggering unit) (Include bonuses)))) x 0.30))


    Note that, Damage variable is Real.

    Using Real to be used as Damage gives one advantage and that is: Accuracy

    If you're using Integer for damaging:
    Imagine your INT is 5, therefore 30% out of 5 is 1.5, in Integer, it would be converted to 1.

    In Real, you would get the 1.5 as damage.

    Yes, Real value is not shown in the Unit's UI HP/MP Bar, but it does exist.

    One of the proof it exists is if the unit is damaged until its HP reaches a value of 0.404 and below, it will die.
     
  3. Edge45

    Edge45

    Joined:
    May 15, 2013
    Messages:
    2,570
    Resources:
    27
    Models:
    8
    Icons:
    17
    Template:
    2
    Resources:
    27
    Oh thanks defskull :)
     
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Integers are 32 bit signed integers that comply with the C/C++ type uint32_t.
    Floats are 32 bit float values which are not very compliant to IEEE floats.

    Use integers for absolute whole number precision. Use floats for fractional precision but be aware they are only accurate to a certain number of significant figures (possibly with error >1 unit for very large values).
     
  5. Edge45

    Edge45

    Joined:
    May 15, 2013
    Messages:
    2,570
    Resources:
    27
    Models:
    8
    Icons:
    17
    Template:
    2
    Resources:
    27
    thq's
    but another prob. So I use damage area, I only wanted to damage enemies but my ally are also damage, I use Unit Group with Condition, the condition is Owner of Picked Unit not equal to Owner of Casting Unit, And then with Damage Unit,

    • Unit Group - Pick every units in (Target point of ability being cast) with Condition (Owner of (Picked Unit)) Not equal to (Owner of (Casting Unit)) and Do Action
      • Unit - Cause (Caster(or any)) to damage (Target Point of ability being cast) with range of 200, causing (DamageVariable)
     
  6. muzzel

    muzzel

    Joined:
    Jun 27, 2008
    Messages:
    1,303
    Resources:
    2
    JASS:
    1
    Wurst:
    1
    Resources:
    2
    Dont check the owners of <Picked Unit> and <Casting Unit> for equality, instead use the condition "Player (Owner of <Picked Unit>) is enemy of Player (Owner of <Casting unit>)".
     
  7. vypur85

    vypur85

    Joined:
    Jan 27, 2014
    Messages:
    158
    Resources:
    1
    Maps:
    1
    Resources:
    1
    > And then with Damage Unit
    Well, from the trigger you didn't really damage unit per se.
    You damaged a circular area.
    Instead of using 'Unit - Damage area', use 'Unit - Damage target'.
    And then damage individual target within the unit group that you picked.

    Code (Text):

    Unit Group - Pick every unit in (Units within 512.00 of (Target point of ability being cast) matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
        Loop - Actions
            Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
     
     
  8. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    What vypur85 is true, you should never use Damage Area because of a bug with macs, I believe.
     
  9. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,979
    Resources:
    17
    Spells:
    17
    Resources:
    17
    This should be the result of your trigger:
    • Melee Initialization
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Animate Dead
      • Actions
        • Set TempLoc = (Target point of ability being cast)
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units within 200.00 of TempLoc matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
          • Loop - Actions
            • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 200.00 damage of attack type Spells and damage type Normal
        • Custom script: call RemoveLocation(udg_TempLoc)

    TempLoc is a Point variable.


    It doesn't have to do with OS or whatsoever.
    We avoid using this because we can't control over which unit that is affected by the damage, that's why we often choose Damage Target for this occasion.
     
  10. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
  11. Edge45

    Edge45

    Joined:
    May 15, 2013
    Messages:
    2,570
    Resources:
    27
    Models:
    8
    Icons:
    17
    Template:
    2
    Resources:
    27
    thanks guys for helping me, now I will try to do this