• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Three things for a map

Status
Not open for further replies.
Level 4
Joined
Jan 23, 2009
Messages
74
Hi guys its me again asking for some help...again (man i'm a noob at map making)

First off the most important of the 3,

Im trying to make a some of the spells in my map have increased effects in proportion to stats, thus each hero would have 4 abilities
the first 3 each with only one level.
then the fourth ability is a 17 level Attrubute bonus (renamed obviously)

The thing i'm going for is to make the spells have their damage increased (and if possible for certain spells, increased duration) all depending on a # * a stat
(EX: Forceful palm a spell based on shock wave would deal its initial 50 damage + intelligence*5 damage)
----------------------------------------------------------------------
The 2nd request, is help making a "throw enemy spell" similar to the one in pudge wars.
------------------------------------------------------------------------
The last question i'd like to pose is : is it possible to make a units attack the spell animation for a spell it has (ie: it would cast a certain spell, it looks like it just attacked)
 

Attachments

  • Midnight Brawl 0.01.w3x
    30.9 KB · Views: 50
Level 18
Joined
Jan 21, 2006
Messages
2,552
EpiK_Phail said:
The thing i'm going for is to make the spells have their damage increased (and if possible for certain spells, increased duration) all depending on a # * a stat
(EX: Forceful palm a spell based on shock wave would deal its initial 50 damage + intelligence*5 damage)

If you want to enhance the damage of a spell with triggers, then you pretty much have to re-create the spell using triggers. The only exception is when the spell delivers a buff, in which case you can detect the "unit takes damage" event and check for the buff.
 
The last question i'd like to pose is : is it possible to make a units attack the spell animation for a spell it has (ie: it would cast a certain spell, it looks like it just attacked)
Either go to the spell and in the field "Art - Animation Names" write the string "Attack" or, if it doesn't work, make a trigger like this:
  • Trigger1
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • Animation - Play (Triggering unit)'s attack animation
 
Level 4
Joined
Jan 23, 2009
Messages
74
ok got the throw spell, 1 last thing i cant figure out,

if you take a look at my map, there a trigger there that records kills per minute, is it possible to make an function that checks who has the highest kills per min and be able to "pick" that player for another action?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
You would loop through each players' kills per minute and find the one that is greater than all the others.

JASS:
function FindGreatestValue takes nothing returns integer
    // returns the integer index of the greatest value in an array of integers
    local integer i
    local integer max
    local integer maxIndex

    set i = 0
    set max = 0
    loop
        exitwhen (i == intArraySize)
        if (intArray[i] > max) then
            set max = intArray[i]
            set maxIndex = i
        endif
        set i = i + 1
    endloop

    return maxIndex
endfunction

In this case you have an array "intArray" and it has a recorded size, "intArraySize".
 
Level 15
Joined
Aug 31, 2009
Messages
776
GUI has a function called "Max" - it simply picks out the biggest of 2 values.

If you're using more than 2 values, then you need to loop through the process of picking each number one by one and checking to see if it is bigger than the previous.

So for example, I have a variable called "Kills" and it is an array, monitoring the kills of 12 different players. I would use a Player Variable "PlayerMostKills" to set to the player with the highest kills.

Then I would do something like this:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Actions - Loop Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kills[Foor Loop Integer A] greater than Kills[(Player Number of(PlayerMostKills)]
        • Then - Actions
          • Set PlayerMostKills = Player(For Loop Integer A)
        • Else - Actions
Now your trigger has set the player with the most kills as "PlayerMostKills" - and you can run actions for that player from there on.

This of course assumes that you are storing the kills of each player as an Array of a single variable (and if you're not - you really should).
 
Level 4
Joined
Jan 23, 2009
Messages
74
Also i wanted to make a trigger based spell based off of berserk that changed ONLY the Attack animation, would these to triggers do it correctly?

  • Flashblade1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flashing Blades
    • Actions
      • Set Flashingunit = (Triggering unit)
      • Countdown Timer - Start FlashingBlades as a One-shot timer that will expire in 15.00 seconds
  • Flashblade2
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • ((Remaining time for FlashingBlades) Greater than or equal to 1.00) and ((Flashingunit has buff Flashing Blades ) Equal to True)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of Flashingunit) Equal to (Order(attack))
        • Then - Actions
          • Animation - Change Flashingunit's animation speed to 1000.00% of its original speed
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of Flashingunit) Not equal to (Order(attack))
            • Then - Actions
              • Animation - Change Flashingunit's animation speed to 100.00% of its original speed
            • Else - Actions
              • Do nothing
 
Level 15
Joined
Aug 31, 2009
Messages
776
Change the periodic to only 0.04 seconds, as anything beyond that is a little too fast for the processor to particularly like it. You also don't need to use a Timer if you're already checking for a buff. Just pick every unit on the map, check if it has the buff, and go from there - just set the buff duration to 15 seconds and it will fit fine.

Remove those Do Nothings also. They Do Nothing, but take up processing time to... er... do nothing (seriously).
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Damage said:
Change the periodic to only 0.04 seconds, as anything beyond that is a little too fast for the processor to particularly like it.

Bah, I use 0.025 for an even 40 hertz. You can even use 0.001 with out much side-affect, but you'll want to make sure you keep an eye on how many actions you're executing every interval. It really depends what it is for too, if you're moving something then you'll for sure want to have it at a maximum of 30 hertz (1/30 seconds).
 
Level 4
Joined
Jan 23, 2009
Messages
74
This is the trigger set for the spell currently
  • Flashblade1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flashing Blades
    • Actions
      • Set Flashingunit = (Triggering unit)
  • Flashblade2
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Current order of Flashingunit) Equal to (Order(attack))) and ((Flashingunit has buff Flashing Blades ) Equal to True)
        • Then - Actions
          • Animation - Change Flashingunit's animation speed to 1000.00% of its original speed
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Current order of Flashingunit) Not equal to (Order(attack))) or ((Flashingunit has buff Flashing Blades ) Equal to False)
            • Then - Actions
              • Animation - Change Flashingunit's animation speed to 100.00% of its original speed
            • Else - Actions
Although it seems like it would work, i don't see any visible difference.

What I'm trying to do is make the unit that casts the spell (aka swordsman) execute its attack faster. By that i don't mean shortening the interval between attacks, but making the attack itself happen faster (the actual swinging/striking time of the sword).

can any body help me out with this? if u want to see it in action dl the map above this post
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
If you want to speed his attack-speed up, then you need to give him an ability that increases attack-speed. You cannot increase a unit's attack/movement speed by changing its animation scale.
 
Level 4
Joined
Jan 23, 2009
Messages
74
no i dont want its attack speed to increase, i want it to stay constant, what i want is to DECREASE the time it takes the unit to hit the opponent

for example lets say 1 attack takes 1 sec to damage the target, distributed like this:
*pulls back .0-0.2 secs*+*swing 0.2-0.8 secs+ *makes contact 0.8-1.00 secs*

I want would want the attack (more like strike time) to be 10 times faster(1000% of normal anim during attack) so if it was a 1 sec animation it would turn to:
*pulls back .0-0.02 secs*+*swing 0.02-0.08 secs+ *makes contact 0.08-.1 secs*


note: i may lower the increase to 300%, i up'd it to 1000% because while i was testing it i saw no difference
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
What you're referring to is the Animation Damage Point which can be found in the Object Editor for a specific unit. You can't change this value in-game, perhaps you should have asked that question first before assuming "animation speed" controls it. To be honest that's a pretty poor assumption.

EpiK_Phail said:
i may lower the increase to 300%, i up'd it to 1000% because while i was testing it i saw no difference

Even if you put it to 0.00 it won't make a difference, The damage will still be dealt a predetermined amount of time (in seconds) after the unit attacks.

EpiK_Phail said:
note: i may lower the increase to 300%, i up'd it to 1000% because while i was testing it i saw no difference

You could change it to 0% and it still wouldn't affect the damage point. How can you tell me you "don't want to increase its attack speed" when you're trying to change a unit's attack mechanics by changing an animation field. You might as well try to play his "Walk" animation instead of issuing a "move" order.

What you'll have to do is create duplicate units. One of the unit's will have to have a Damage Point that is 10× less than the other unit's Damage Point.
 
Level 4
Joined
Jan 23, 2009
Messages
74
Sorry to revive this thread but i don't wanna clutter the forum again for the same map,

im having a problem with my repick trigger(s), it currently bugs (i think when 2 players repick at the same timeor a player repicks repeatedly really fast, I'm not completely sure)
  • Events
    • Player - Player 1 (Red) types a chat message containing -repick as An exact match
    • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
    • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
    • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
    • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
    • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Set Oldhero = (Picked unit))
    • Dialog - Show Dialog for (Triggering player)
  • Pick
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Dialog - Change the title of Dialog to |c00889e78Choose Yo...
      • Dialog - Create a dialog button for Dialog labelled |c00889e78This Butt...
      • Set Button[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c00889e78Kunoichi,...
      • Set Button[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c00889e78Karate Us...
      • Set Button[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c00889e78Judo Prac...
      • Set Button[4] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c00889e78Qi Master...
      • Set Button[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c00889e78Swordsman...
      • Set Button[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c00889e78Kyudo Mas...
      • Set Button[7] = (Last created dialog Button)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Dialog - Show Dialog for (Picked player)
And since all the hero giving triggers are the same (save for the different heroes they give) ill save room and just include one.
  • Button7
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[7]
        • Then - Actions
          • Dialog - Hide Dialog for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Equal to (Owner of Oldhero)
            • Then - Actions
              • Unit - Replace Oldhero with a Kyudo Master using The old unit's relative life and mana
              • Hero - Set (Last replaced unit) Hero-level to (Level of Oldhero), Hide level-up graphics
              • Unit - Set level of Train Skills for (Last replaced unit) to (Level of Train Skills for Oldhero)
            • Else - Actions
              • Unit - Create 1 Kyudo Master for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
        • Else - Actions
 
Your Oldhero variable should have an array, so that it looks like this, so that it actually is MPI = Multi Player Instanceable = Can support actions of multiple players at a time:
  • Set Oldhero[Player Number of (Triggering player)] = (Picked unit)
for the first trigger and for the second trigger:
  • Unit - Replace Oldhero[Player Number of (Triggering player)] with a Kyudo Master using The old unit's relative life and mana
Finally, add this line before your Unit Group pick action:
  • Custom script: set bj_wantDestroyGroup = true
It prevents the leak from the Unit Group you just created.
Reference:
[•] http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 4
Joined
Jan 23, 2009
Messages
74
This is what you meant, am i correct?
  • repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Set Oldhero[(Player number of (Triggering player))] = (Picked unit))
      • Dialog - Show Dialog for (Triggering player)
  • Button7
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[7]
        • Then - Actions
          • Dialog - Hide Dialog for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Equal to (Owner of Oldhero[(Player number of (Triggering player))])
            • Then - Actions
              • Unit - Replace Oldhero[(Player number of (Triggering player))] with a Kyudo Master using The old unit's relative life and mana
              • Hero - Set (Last replaced unit) Hero-level to (Level of Oldhero[(Player number of (Triggering player))]), Hide level-up graphics
              • Unit - Set level of Train Skills for (Last replaced unit) to (Level of Train Skills for Oldhero[(Player number of (Triggering player))])
            • Else - Actions
              • Unit - Create 1 Kyudo Master for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
        • Else - Actions
 
Level 4
Joined
Jan 23, 2009
Messages
74
like this?
  • repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set Oldhero[(Player number of (Triggering player))] = (Picked unit)
          • Set oldhero_level[(Player number of (Triggering player))] = (Level of (Picked unit))
          • Set oldhero_Tskills[(Player number of (Triggering player))] = (Level of Train Skills for (Picked unit))
      • Dialog - Show Dialog for (Triggering player)
  • Button7
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[7]
        • Then - Actions
          • Dialog - Hide Dialog for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Equal to (Owner of Oldhero[(Player number of (Triggering player))])
            • Then - Actions
              • Unit - Replace Oldhero[(Player number of (Triggering player))] with a Kyudo Master using The old unit's relative life and mana
              • Hero - Set (Last replaced unit) Hero-level to oldhero_level[(Player number of (Triggering player))], Hide level-up graphics
              • Unit - Set level of Train Skills for (Last replaced unit) to oldhero_Tskills[(Player number of (Triggering player))]
            • Else - Actions
              • Unit - Create 1 Kyudo Master for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
        • Else - Actions
 
Status
Not open for further replies.
Top