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. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

How to make this passive give damage per Intelligence?

Discussion in 'World Editor Help Zone' started by IRoILaurentiu, Jun 19, 2018.

  1. IRoILaurentiu

    IRoILaurentiu

    Joined:
    Mar 28, 2018
    Messages:
    87
    Resources:
    0
    Resources:
    0
    upload_2018-6-19_17-47-49.png
     

    Attached Files:

  2. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,656
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    Cannot be done with that method.

    You need to trigger the chain lightning manually and deal damage with triggers to add intellect scaling.
     
  3. IRoILaurentiu

    IRoILaurentiu

    Joined:
    Mar 28, 2018
    Messages:
    87
    Resources:
    0
    Resources:
    0
  4. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    Perhaps easier would be to download a damage detection system that can detect spell damage and add the bonus there.
     
  5. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,656
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    A damage detection system cannot see the difference between damage dealt from different sources.
    You can check if damage is magical but you cannot check if it is done by a spell, or a specific spell even.

    I would say it is too complicated to bother, chain spells are best left untouched.
     
  6. Wark

    Wark

    Joined:
    Oct 12, 2016
    Messages:
    738
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Make the dummy unit have a chain lighting that levels up as well. Set the level of the chain lightning in the trigger to a level based on intelligence of the attacking unit.
    HOWEVER, I recommend going up in multiples of 5 or 10, so you don't get absurd object editor lag. (over 10 - 15 levels for any ability starts increasing loading times significantly)
    For example: Intelligence / X = level for the passive chain lightning

    Just make a formula to compensate for the damage increments you want.
     
  7. Glint

    Glint

    Joined:
    Dec 28, 2014
    Messages:
    68
    Resources:
    1
    Maps:
    1
    Resources:
    1
    What you could do is either implement your own damage detection or download a damage detection like Kaijyuu suggested.

    Here's my example:

    Chain Strike Attack

    • Chain Strike Attack
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • (Level of Chain Strike for (Attacking unit)) Greater than 0
        • (Random integer number between 1 and 100) Less than or equal to ChainStrike_ChancePerLevel[(Level of Chain Strike for (Attacking unit))]
      • Actions
        • Set TempPoint = (Position of (Attacking unit))
        • Set ChainStrike_Attacker[(Player number of (Owner of (Attacking unit)))] = (Attacking unit)
        • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
        • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        • Unit - Add Chain Lightning (Dummy) to (Last created unit)
        • Unit - Set level of Chain Lightning (Dummy) for (Last created unit) to (Level of Chain Strike for (Attacking unit))
        • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Triggering unit)
        • Custom script: call RemoveLocation(udg_TempPoint)



    With a unit attacks, store the attacker unit in a variable and cast the dummy Chain Lightning.

    Damage Detection

    • Damage Detection Init
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
          • Loop - Actions
            • Set DamageDetection_Unit = (Picked unit)
            • Trigger - Run Damage Detection Register <gen> (ignoring conditions)

    • Damage Detection Enter
      • Events
        • Unit - A unit enters (Entire map)
      • Conditions
        • (Unit-type of (Triggering unit)) Not equal to Dummy
      • Actions
        • Set DamageDetection_Unit = (Triggering unit)
        • Trigger - Run Damage Detection Register <gen> (ignoring conditions)


    • Damage Detection Register
      • Events
      • Conditions
      • Actions
        • Trigger - Add to Chain Strike Damage <gen> the event (Unit - DamageDetection_Unit Takes damage)



    This is my lazy implementation of a damage detection system. (It leaks) It registers every unit in the map (except dummies) and add them to the Chain Strike Damage's event.

    Chain Strike Damage
    • Chain Strike Damage
      • Events
      • Conditions
        • (Level of Chain Lightning (Dummy) for (Damage source)) Greater than 0
      • Actions
        • Set ChainStrike_PlayerId = (Player number of (Owner of (Damage source)))
        • Set ChainStrike_Intellegence = (Real((Intelligence of ChainStrike_Attacker[ChainStrike_PlayerId] (Include bonuses))))
        • Unit - Cause ChainStrike_Attacker[ChainStrike_PlayerId] to damage (Triggering unit), dealing ChainStrike_Intellegence damage of attack type Spells and damage type Normal
        • Floating Text - Create floating text that reads (+ + (String((Integer(ChainStrike_Intellegence))))) above (Triggering unit) with Z offset 0.00, using font size 11.00, color (25.00%, 0.00%, 100.00%), and 0.00% transparency
        • Floating Text - Change (Last created floating text): Disable permanence
        • Floating Text - Set the velocity of (Last created floating text) to 128.00 towards 90.00 degrees
        • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
        • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds



    Registered units from the damage detection when takes damage from a unit with Chain Lightning (Dummy) will take additional damage based on the Intelligence of the attacker.

    If you encountered performance issues with the damage detection in this example, I strongly recommend you to replace it with Bribe's damage detection system.

    I added a sample map in the attachment.
     

    Attached Files:

    Last edited: Jun 20, 2018
  8. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,656
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    Wont that cause an infinite loop?
     
  9. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
    [​IMG]



    Need to turn off the trigger before damage is done.

    • Chain Strike Attack
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • (Level of Chain Strike for (Attacking unit)) Greater than 0
        • (Random integer number between 1 and 100) Less than or equal to ChainStrike_ChancePerLevel[(Level of Chain Strike for (Attacking unit))]
      • Actions
        • Trigger - Turn off (This Trigger) <<< HERE
        • Set TempPoint = (Position of (Attacking unit))
        • Set ChainStrike_Attacker[(Player number of (Owner of (Attacking unit)))] = (Attacking unit)
        • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
        • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        • Unit - Add Chain Lightning (Dummy) to (Last created unit)
        • Unit - Set level of Chain Lightning (Dummy) for (Last created unit) to (Level of Chain Strike for (Attacking unit))
        • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Triggering unit)
        • Custom script: call RemoveLocation(udg_TempPoint)
        • Trigger - Turn on (This Trigger) <<< AND HERE


    regards
    -Ned
     
  10. Glint

    Glint

    Joined:
    Dec 28, 2014
    Messages:
    68
    Resources:
    1
    Maps:
    1
    Resources:
    1
    It doesn't. The event of the Chain Strike Damage trigger only activates if the damage source is a dummy unit with a Chain Lightning (Dummy) ability, not the attacker. The Damage Target trigger uses the attacker coming from the Chain Strike Attack as the damage source to prevent the infinite loop. During my test, I found out it is a bad idea to use the dummy as the damage source for Damage Target.

    I think turning the trigger off and on for the Chain Strike Attack trigger is not necessary. From what I know, "A unit Is attacked" only activates if the unit uses auto attacks. Functions like Damage Target does not trigger "A unit Is attacked" unless it uses the "(Unit) takes damage" event. And like what I mentioned to Chaosy, Chain Strike Damage's event only activates for dummy units with Chain Lightning (Dummy) ability, so it is safe to say it this one will not also cause an infinite loop.
     
  11. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I'm an idiot. I've copied the wrong trigger.
    Meant to copy over the "Chain Strike Damage", not "Chain Strike Attack"
    Oh, well...

    regards
    -Ned
     
  12. Glint

    Glint

    Joined:
    Dec 28, 2014
    Messages:
    68
    Resources:
    1
    Maps:
    1
    Resources:
    1
    It's fine. I think your idea is an alternative solution to fix the infinite loop in the Chain Strike Damage trigger when using the dummy unit as the damage source for the Damage Target function.