• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Some Questions

Status
Not open for further replies.
Level 10
Joined
Jun 6, 2007
Messages
392
I'm making a campaign and here are some things that have caused me problems. I already posted these questions on thehelper forums, but I didn't get answers.:

1. How can I Limit heroes' skill points to 1 per 3 levels (max hero level in my campaign is 100)

2. The campaign will consist of many linked maps (like in tft orc campaign), how can I store quest progress into a game cache? Do I havo to change it into boolean values?

3. I'd like to make an ability that increases spell damage by percentage, so is there any way to check the amount of spell damage dealt?

Thanks for any help.
 
Level 10
Joined
Jun 6, 2007
Messages
392
Thanks for your answer. I guess i'll trigger it then.

Edit: and another thing that came into my mind when i was making a spesific spell: The spell is like circular shockwave. How can I make it damage units that are hit by the spell? I already tried using unit groups but they cause a lot of lag.
 
Level 9
Joined
Aug 7, 2009
Messages
380
There's a solution. Set a variable (pick units in area) you wanna damage, Pick units in last variable, and create a dummy, then add it a thunder bolt spell (or something) with no projectile, duration to 0.01 if use thunder bolt (0.00 will make unit stun until die), order it to thunder bolt picked unit. You'll need to add Generic expiration last created unit (if not, the dummy'll still there). Good luck!
 
Level 10
Joined
Jun 6, 2007
Messages
392
Thank you. Though, it doesn't solve the problem. I still have to use unit group, and that for some reason causes lag. And if it's unclear what I'm trying to do, I'll clarify it a little: I want to know how I can pick units whose range from point is e.g greater than 500 and less than 550.
 
Level 9
Joined
Aug 7, 2009
Messages
380
Variables needed:
TempGroup: Unit Group
TempLoc: Point
TempDummy: Unit
TempUnit: Unit

  • Spell
  • Events:
    • Unit - A unit Starts the effect of an ability
  • Conditions:
    • (Ability being cast) equal to [your spell]
  • Actions:
    • Set TempUnit = (Triggering unit)
    • Set TempLoc = (Target point of ability being cast)
    • Set TempGroup = (Units Within [Your range] of TempLoc Matching [Your choise])
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • Unit - Create 1 [Dummy] for (Owner of TempUnit) at TempLoc facing Default building facing degrees
        • Set TempDummy = (Last Created Unit)
        • Unit - Add a [second] Generic expiration to TempDummy
        • Unit - Add Storm Bolt to TempDummy
        • Unit - Order TempDummy to Moutain King - Storm Bolt (Picked Unit)
First Tutorial, :thumbs_up: luck
 
Last edited:
  • Set Point1 = (Position of (Triggering unit))
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 550.00 of Point1 matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit)) Equal to True) and (((Matching unit) is alive) Equal to True) and (((Matching unit) is a structure) Equal to False)) and do (Actions)
    • Loop - Actions
      • //Actions here
  • Custom script: call RemoveLocation (udg_Point1)
2) http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/game-caches-6273/
You can also get an MPQ Editor, from the Tools section, e.g. Power MPQ and find the Rexxar's campaign. Open it and check how the triggers are done. That tutorial is pretty decent though.

3) No, but if you trigger your damage the spells of yours deal, you can easily amplify it by triggers as well. So, you can make a check. Let's say your custom "Wave Strike" causes (100 + 20 * (Level of (Ability being cast) for (Triggering unit))).
Now, let's say that your spell damage increasing ability is level 2 and you want it to amplify damage dealt by 20%.
  • Tr
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Wave Strike
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Level of Spell Bonus Damage for (Triggering unit)) Greater than 0
      • Then - Actions
        • Set NonEnhancedDamage = ((100 + (20 x (Level of (Ability being cast) for (Triggering unit)))
        • Set BonusDamage = (Level of (Ability being cast for (Triggering unit)) x 0.10)
        • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (NonEnhancedDamage + (NonEnhancedDamage x BonusDamage)) of Attack type Spells and Damage type Normal
Something like this.

Notes:
• Banish can amplify magical damage.
• You can use a Spell Damage Reduction ability to remove partial magic reduction from the enemy units, the hero is about to deal magic damage to.
 
Level 5
Joined
Feb 24, 2009
Messages
110
Variables needed:
TempGroup: Unit Group
TempLoc: Point
TempDummy: Unit
TempUnit: Unit

  • Event: Unit Start effect of ... blah blah
  • Conditions:
    • Ability being cast equal to [your spell]
  • Actions:
    • Set TempUnit = Triggering unit
    • Set TempLoc = Target point of ability being cast
    • Set TempGroup = Units Within [Your range] of TempLoc Matching [Your choise]
    • Unit Group - Pick every unit in TempGroup and do actions
      • Loop - Actions
      • Unit - Create 1 [Dummy] for Owner of TempUnit at TempLoc...
      • Set TempDummy = Last Created Unit
      • Unit - Add [second] Generic expiration to TempDummy
      • Unit - Add [Stun ability] to TempDummy
      • Unit - Order TempDummy Moutain King - Storm Bolt (Picked Unit)
First Tutorial, :thumbs_up: luck

Sorry, Could you please tell me how to find that loop trigger? I can't happen to find it.
 
Level 9
Joined
Aug 7, 2009
Messages
380
Too lazy to write whole trigger exactly ^^. OK, Fixed. If you wanna your spell damage increase each level, just set your spell level = your dummy's stun spell (should based on Storm Bolt) level. So, the Dummy's stun spell will be your spell damage. ^^
 
Level 10
Joined
Jun 6, 2007
Messages
392
@striker21: That triggers picks units in max range, but it doesn't exclude units under minimum range. In other words, in my example it would pick all units within 550 range, but it's supposed to pick units in 500-550 range.

@Pharaoh_: 2. I have read multiple tutorials about game caches and I know how to use them, but the problem is that there is no "store quest" function. It only seems possible to save real, integer, unit, boolean and maybe some other stuff (don't have WE open atm). I guess i'll open rexxar map and see how it's done. Thanks.
 
Level 10
Joined
Jun 6, 2007
Messages
392
I did it this way: I set TempGroup to units in 550 range of TempPoint and TempGroup2 to units in 500 range. --> Pick all units in TempGroup and do actions
if picked unit is in TempGroup2 is equal to false, then damage picked unit etc...
However there's one problem: doing it this way causes huge lag.
 
Level 10
Joined
Jun 6, 2007
Messages
392
I got it work, the reason for lag was that I had accidentally placed this part inside a loop. However, it doesn't deal damage. I tried it with player is ally = false condition, and that way it damaged all units. What's wrong with conditions?
  • Set TempGroup = (Units within (75.00 + (50.00 x (TempReal + 1.00))) of TempPoint matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))
  • Set TempGroup2 = (Units within (25.00 + (50.00 x (TempReal + 1.00))) of TempPoint matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is in TempGroup2) Equal to False
        • Then - Actions
          • Unit - Cause TempUnit to damage (Picked unit), dealing Damage damage of attack type Spells and damage type Magic
        • Else - Actions
  • Custom script: call DestroyGroup(udg_TempGroup2)
  • Custom script: call DestroyGroup(udg_TempGroup)
@watermelon_1234: I didn't know it was possible to use mod function in trigger editor. Thanks!
 
Level 9
Joined
Aug 7, 2009
Messages
380
1) This way your units can be damaged by one caster at a time. It's not fully MUI. You need to add the units to a local unit group, not a global group, like TempGroup2 is.

2) It shouldn't cause lag, you are doing something wrong. Post the triggers.

Yep. Maybe there's something cause problem, I use it in lots of my area spell ^^, just add some remove leaks at the end of trigger. Lag? not at all :gg:
 
Level 9
Joined
Aug 7, 2009
Messages
380
I got it work, the reason for lag was that I had accidentally placed this part inside a loop. However, it doesn't deal damage. I tried it with player is ally = false condition, and that way it damaged all units. What's wrong with conditions?
  • Set TempGroup = (Units within (75.00 + (50.00 x (TempReal + 1.00))) of TempPoint matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))
  • Set TempGroup2 = (Units within (25.00 + (50.00 x (TempReal + 1.00))) of TempPoint matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is in TempGroup2) Equal to False
        • Then - Actions
          • Unit - Cause TempUnit to damage (Picked unit), dealing Damage damage of attack type Spells and damage type Magic
        • Else - Actions
  • Custom script: call DestroyGroup(udg_TempGroup2)
  • Custom script: call DestroyGroup(udg_TempGroup)
@watermelon_1234: I didn't know it was possible to use mod function in trigger editor. Thanks!

Oh yeah... I see the problem. In the If - Conditions, you should add something like this:
  • Actions:
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is in TempGroup2) Equal to False
          • ((Picked unit) belongs to an ally of ((Owner of (triggering unit))) equal to False
By this conditions, you won't have to matching unit. Good luck
 
Status
Not open for further replies.
Top