• 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.

Need help making an ability....

Status
Not open for further replies.
Level 2
Joined
Dec 18, 2011
Messages
17
I'm pretty sure this is where I'm supposed to ask....

anyway, I've recently started making WC3 maps, because I was intrigued by the ones I could download from here, and I've got the entire thing plotted out, except for a single detail....
(Note: I can do some C++ coding but I don't really know how to implement it into WC3 map editor, so right at this moment I'm just working of the trigger editor and the object editor, without any downloads except the patch included.)

The ability that I'm finding ridiculously hard to produce is an ability which gives a <quantity> of resources every <time period>...
(say giving 10 gold every 30 seconds.)

I know this is probably an extremely simple thing to create, and has probably been done before, but after about four hours of trying, I've given up....
So help would be largely appreciated.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
I'm pretty sure this is where I'm supposed to ask....

anyway, I've recently started making WC3 maps, because I was intrigued by the ones I could download from here, and I've got the entire thing plotted out, except for a single detail....
(Note: I can do some C++ coding but I don't really know how to implement it into WC3 map editor, so right at this moment I'm just working of the trigger editor and the object editor, without any downloads except the patch included.)

The ability that I'm finding ridiculously hard to produce is an ability which gives a <quantity> of resources every <time period>...
(say giving 10 gold every 30 seconds.)

I know this is probably an extremely simple thing to create, and has probably been done before, but after about four hours of trying, I've given up....
So help would be largely appreciated.

dont need ability for this :p

  • Untitled Trigger 001
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Add 10 to (Player((Integer A))) Current gold
or this if u want with pasive ability
(Hero[x] is unit variable array-example player 1 hero is Hero[1], player 2 hero is Hero[2] etc)

  • Untitled Trigger 001
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of *Your gold passive ability* for Hero[(Integer A)]) Greater than 0
            • Then - Actions
              • Player - Add 10 to (Player((Integer A))) Current gold
            • Else - Actions
 
Level 2
Joined
Dec 18, 2011
Messages
17
I'm sorry, maybe I didn't make myself clear, I said I was looking for an ABILITY that did that, I DON'T want a trigger.
If I wanted a trigger, I could have done it myself, fairly easily too.
To make myself more clear I want a unit ability which generates the required resources, so you could build more of that unit and gain more of the resources per integer.

I do hope that was a bit clearer than my last attempt, Sorry for any of your time I might have wasted.
(EDITED for spelling mistakes.)
 
Level 2
Joined
Dec 18, 2011
Messages
17
so far as i know you cant do that withour triggers sorry

I've seen it done, therefore, I know that it's possible.
The ability should be something like a repeating chest of gold ability with a cooldown of 30 or so seconds, so that it activates only every 30 seconds...
Not that I've managed to do it yet, however, I would appreciate it if someone who has actually managed to compile this sort of code would answer.

(Edited onto the end of my last post because of the rule of no double posting within 24 hours.)
I've written something which will do the job, though it's not as effective as say, the thing in the (settlersIX?) map, which generates wood and gold....
anyway, I've written something which means that I'm using my lumber as an income keeper, so whenever a <specific building> is created by <player> they gain 10 lumber, Added to the trigger of whenever the player loses one of the <specific building>'s they lose the same amount of lumber they gained when it was built. (I've also got a trigger which gives a player the players lumber in gold every 30 seconds, which effectively means I got what I want, minus one lumber access, but meh, I can go without that.)

Anyway, ShadowVzs, your post wasn't exactly what I was looking for, but despite that It's been helpful, as I hadn't figured out how to write one trigger which gave things to people at the same time... except I can't seem to access integer A. XD
Help please for this newbie mistake. (Found it..... that was quick! XD... +reping Shadowvzs... For putting the thing to follow there in the first place.:))
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
I've seen it done, therefore, I know that it's possible.
The ability should be something like a repeating chest of gold ability with a cooldown of 30 or so seconds, so that it activates only every 30 seconds...
Not that I've managed to do it yet, however, I would appreciate it if someone who has actually managed to compile this sort of code would answer.

(Edited onto the end of my last post because of the rule of no double posting within 24 hours.)
I've written something which will do the job, though it's not as effective as say, the thing in the (settlersIX?) map, which generates wood and gold....
anyway, I've written something which means that I'm using my lumber as an income keeper, so whenever a <specific building> is created by <player> they gain 10 lumber, Added to the trigger of whenever the player loses one of the <specific building>'s they lose the same amount of lumber they gained when it was built. (I've also got a trigger which gives a player the players lumber in gold every 30 seconds, which effectively means I got what I want, minus one lumber access, but meh, I can go without that.)

Anyway, ShadowVzs, your post wasn't exactly what I was looking for, but despite that It's been helpful, as I hadn't figured out how to write one trigger which gave things to people at the same time... except I can't seem to access integer A. XD
Help please for this newbie mistake. (Found it..... that was quick! XD... +reping Shadowvzs... For putting the thing to follow there in the first place.:))

actually i dont think possible without trigger coz even a item ability give gold/lumber but that something must activate, if dont have trigger u can click manually for gold and lumber

if i understand well then something like this, just with ability? i think not possible with ability also upgrades unusable coz upgrade levels cant reduce, only increase.

(about double post: u can delete your last post and copy content to new post+add ur another ideea and its like a bump :p)

  • Build
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Lumber Mill
    • Actions
      • Player - Add 10 to (Triggering player) Current lumber
  • Destroyed
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Lumber Mill
    • Actions
      • Player - Add -10 to (Triggering player) Current lumber
  • Lumber per time
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set TempUnitGroup = (Units owned by (Player((Integer A))) matching ((Unit-type of (Matching unit)) Equal to Lumber Mill))
          • Player - Add (10 x (Number of units in TempUnitGroup)) to (Player((Integer A))) Current lumber
          • Custom script: call DestroyGroup (udg_TempUnitGroup)
 
Level 7
Joined
Sep 9, 2007
Messages
253
You can make an ability to do this but you must use triggers to enhance the ability.

What you want to do is make an ability using the object editor, this ability is a DUMMY ability. It won't actually do anything but it means that your hero will be able to learn the ability and you can type a tooltip etc. The way the ability works will be using a trigger, here's how it works....

Make a new ability based off critical strike.
Make the chance 0% and the bonus damage factor 1. (this means that the critical strike ability doesn't actually do anything).
Then you will make 2 triggers to control your ability.

Trigger 1
Event, unit learns ability.
Condition, ability = Critical strike.
Action, Turn on trigger 2.

Trigger 2 (have it turned off by default, it will be turned on by trigger 1 when it is needed)
Event, every 30 seconds of game time.
Condition, .....
Action, Give player 1 (5*(level of critical strike for hero1)) gold.

There are some bugs here but they are easy to fix (eg you may need to save the hero into a variable to make it work properly, you may also want to check if the hero is alive in the conditions of trigger 2) There is more things to fix but you sound reasonably capable so I will let you play araound with it because you know your map better than I do. I can explain in more detail if needed or provide a test map. Good Luck!
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I've seen it done, therefore, I know that it's possible.

Listen to me, you have been mindF, I meant tricked :)

The map creator uses trick (as you have to upgrade/learn the ability first before the effect kicks in)

After you learn the ability, it will detect it via trigger:
  • Events
    • Unit - A unit Learns a skill
After it detects, it will put you in a trigger (Player Group) for money distribution
  • Actions
    • Player Group - Add (Triggering player) to PlayerGroupMoneyDistribution
After it adds you, wa-la !
You'll be getting X gold in X seconds (pre-set values or changeable in-game, up to creator of trigger)

Here's the addition of gold:
  • Money Distribution
    • Events
      • Time - Every X seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in PlayerGroupMoneyDistribution and do (Actions)
        • Loop - Actions
          • Player - Add X to (Picked player) Current gold
You have to remember the power of trigger.
 
Level 2
Joined
Dec 18, 2011
Messages
17
Hum, I should have put in that I got that working a while ago, but nice for all the information and all...

What I ended doing in the end was using a trigger, so I apologize for my newby comments, I just integer a players wood by ten (or twenty, depending on the building he built) whenever they build a factory type building, and integer it by -10 whenever a player loses one of them... and have a trigger that activates every thirty seconds and gives a players lumber to that player in gold, thus lumber is a players income. (I should get round to making an income variable...:\)

Yeah, I also should have defined that I wanted something akin to total annihilations resource gaining methods.
(Also, why I was tricked into thinking it could be done as an ability was because of 'Island Settlers IX', one of the mods here, which has a building which creates resources every time period, but now I think I get that that was actually triggers, and I've been acting a little over the top......XD)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
(Also, why I was tricked into thinking it could be done as an ability was because of 'Island Settlers IX', one of the mods here, which has a building which creates resources every time period, but now I think I get that that was actually triggers, and I've been acting a little over the top......XD)

anyway even u use periodic triggerm its dont make any lagg coz it a easy/light trigger and u cant worry about useing trigger.
I prefer the trigger sometimes over abilities coz more controlable/customizeable in few case and till isnt wrong something its dont make lagg until custom units/abilities make longer loading if u use many
 
Status
Not open for further replies.
Top