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. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  4. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  5. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  6. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  7. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  8. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. 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.

Is there a percentage function in the editor?

Discussion in 'World Editor Help Zone' started by Anteep, Oct 9, 2008.

  1. Anteep

    Anteep

    Joined:
    Feb 28, 2005
    Messages:
    123
    Resources:
    3
    Maps:
    3
    Resources:
    3
    I can see that there is a "Maths - Random Percentage" function, which I don't want, but I can't see a percentage function or maybe i'm not looking right. Is there one?
     
  2. raid1000

    raid1000

    Joined:
    May 1, 2008
    Messages:
    1,017
    Resources:
    0
    Resources:
    0
    math- random number
    math- random angle
    math- random percentage
     
  3. Angry_Bovine

    Angry_Bovine

    Joined:
    Oct 7, 2007
    Messages:
    593
    Resources:
    1
    Maps:
    1
    Resources:
    1
    What exactly are you trying to change into a percentage? This can be done manually in almost all cases.
     
  4. raid1000

    raid1000

    Joined:
    May 1, 2008
    Messages:
    1,017
    Resources:
    0
    Resources:
    0
    sorry for not understanding d'ohh but random percentage doesn't have any functions but if this helps u can use it like this o_O

    • Unit - Set mana of (Triggering unit) to (Random percentage)%

    random percentage can be used in autocasting spells (%= number betwen 0 and 100)
     
    Last edited: Oct 9, 2008
  5. Anteep

    Anteep

    Joined:
    Feb 28, 2005
    Messages:
    123
    Resources:
    3
    Maps:
    3
    Resources:
    3
    What I'm doing is:
    Events
    Unit - A unit Is attacked
    Conditions
    (Unit-type of (Attacked unit)) Equal to Lumber Mill

    Now, in order to do the action I need a percentage function so I can put in 50% for example.
    I want, when the lumber mill's health drops below 50%, the player attacking it captures it.
     
  6. raid1000

    raid1000

    Joined:
    May 1, 2008
    Messages:
    1,017
    Resources:
    0
    Resources:
    0
    • Events
      • Unit - A unit Is attacked
      • Conditions
        • ((Unit-type of (Attacked unit)) Equal to lumbermill) and ((Life of (Attacked unit)) Less than or equal to 50.00)

    find the second condition under "real comparison" - "unit percentage life"
     
  7. Angry_Bovine

    Angry_Bovine

    Joined:
    Oct 7, 2007
    Messages:
    593
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Raid1000, that doesn't work as intended. Life of Attacked Unit doesn't return a percentage.

    Anteep, here's your simple solution since you've finally made it clear what you wanted to:

    ((Life of (Attacked Unit) / Max Life of (Attacked Unit)) less than or equal to 50)

    A percentage is just a number over the intended. In this case, the current over the maximum.
     
  8. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    Use integrers loop A/B?
     
  9. Anteep

    Anteep

    Joined:
    Feb 28, 2005
    Messages:
    123
    Resources:
    3
    Maps:
    3
    Resources:
    3
    Thanks all, this is the trigger I ended up doing and it works:


    Events
    Unit - A unit Is attacked
    Conditions
    ((Unit-type of (Attacked unit)) Equal to Quarry [1]) and ((Percentage life of (Attacked unit)) Less than or equal to 50.00)
    Actions
    Unit - Change ownership of (Attacked unit) to (Owner of (Attacking unit)) and Change color
    Unit - Set life of (Attacked unit) to 100.00%
     
  10. PoZoR

    PoZoR

    Joined:
    Oct 3, 2008
    Messages:
    101
    Resources:
    1
    Maps:
    1
    Resources:
    1
    in the trigger u proposed, u will need to use 0.5 instead of 50
     
  11. Angry_Bovine

    Angry_Bovine

    Joined:
    Oct 7, 2007
    Messages:
    593
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Ah, my apologies. Wasn't thinking. Yes, PoZoR is correct. Please use 0.5 instead or it will trigger every time. Percentages are out of 1... I was thinking, multiplied by 100. Thanks for clearing that up.