• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Change Unit chance

Status
Not open for further replies.
Level 5
Joined
Jun 21, 2011
Messages
119
Hellow The Hiveworkshop i need help with a trigger, spell and unit.

Main idea of the action is cast Cannibalizme by Ghoul and give him 1 : 10 chance to change him into another unit, for example Abomination.

Som1 could help?:ogre_love:
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
  • Cannibalism
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cannibalism
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 10) Equal to 1
        • Then - Actions
          • Set Temp_Point = (Position of (Triggering unit))
          • Unit - Replace (Triggering unit) with a Abomination using The old unit's relative life and mana
          • Custom script: call RemoveLocation(udg_Temp_Point)
        • Else - Actions
@Spinnaker: thanks for correcting me, I didn't read properly. But why don't you type carefully? What is "ghul" and "cats"?
 
Last edited:
Level 26
Joined
Mar 19, 2008
Messages
3,140
Mr_Bean.. Why do you not read carefully. I see: 'when ghul cats cannibalize' - forgive me if meaning of such sentence has changed in past few days..

Make use of action 'Unit - Replace unit' instead of creating new one. Note that your trigger always summons restored unit.
If you have problems creating this trigger, feel free to ask for help.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
give him 1 : 10

Did you guys read this ?

Mr Bean's trigger seems like 100% chance ?

  • (Random integer number between 1 and 1) Equal to 1
It should be (at least within this range)

  • (Random integer number between 1 and 10 Equal to 1
This will result in 10% chance as the ratio is 1:10
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
For enumerating numbers, you should use Less than or equal to, like 5% chance like this

  • (Random integer number between 1 and 100) Less than or equal to 5
This trigger will pick random number between 1 to 5 (making it 5%)

If you use Equal to in this case, it will only become 1% of the time because it only picks number 5 out of 100.

Less than or equal to, next time for random chances, okay.

But if it's 1 to 10, it's okay to use Equal to 1 because 1 from 10 looks like 10% as we can divide it 1/10 = 0.1 = 10%

Careful use of Math and Computer Programming.
 
Status
Not open for further replies.
Top