• 🏆 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!

[Trigger] Create Dummy, Give X ability, X=X+Y

Status
Not open for further replies.
Level 12
Joined
Mar 16, 2006
Messages
992
I spent two hours last night trying to figure out what was wrong. I'm now at work and it's been bugging me. :p

This is a spell I'm currently working on for one of my heros in my map. Just trying to make a buff seemingly stack with itself, so it can be reapplied and become stronger.

I've got the dummy activation spells set to inner fire and everything seems to be solid object wise. Is there anything I could have missed? And any ways to improve my code to have no leaks/use less memory? I understand that GA_buff is not needed, I just wanted to use it temporarily while I tested the spell out.

Anyway- Below is a basic layout of what I have done.

Code:
Targets allowed, self, ally, hero, alive
GA_count[] is an array of integers, initial value 0
GA_buff is an integer, initial value 0
Code:
A unit starts casting a spell
------------------------
Spell equal to GA
------------------------
set GA_buff = level of ability of GA on unit

If GA_count[player number of Owner of Target of order being issued] >= 100
then:
Create dummy with lv 100 GA
Cast inner fire on target
Wait for GA to be cast, every .3 seconds
Kill dummy unit
GA_count[....] = 100
Display Text: You cannot go higher than 100.

If GA_count[....] < 100 & GA_count[....] >= 1
then:
Create dummy with lv (GA_count[....] + GA_buff) GA
Cast inner fire on target
Wait for GA to be cast, every .3 seconds
Kill dummy unit
GA_count[....] = GA_count[....] + GA_buff

If GA_count[....] = 0
then:
Create dummy with GA_buff
Cast inner fire on target
Wait for GA to be cast, every .3 seconds
Kill dummy unit
GA_count[....] = GA_count[....] + GA_buff
 
Level 12
Joined
Mar 16, 2006
Messages
992
hmm does the spell trigger? if not, you should add an experiation timer on the dummy instead of using kill... maybe the dummy is killed before it casts?

I've given the dummy a graphic and he actually does not get killed since he does not cast the spell.

And in more recent events, he hasn't even bothered to spawn in.

Code:
Unit casts a spell
Ability = GA
Spawn Dummy

My little dummy ABOMINATION hasn't spawned in. I don't understand it yet.
 
Level 12
Joined
Mar 16, 2006
Messages
992
Post in TRIGGER tags, not code tags.

And what is supposed to happen ?

I couldn't find out how to post trigger tags and I was at work just generalizing the code. But if you even read the code, you'd have an idea.

If the unit has buffA[x] on him, he will have a counterA[x] on him(I couldn't find HAS buff check). The script takes the current level of counterA[x] and the level of buffA[x] being cast and combines them to add as the dummy Ability level. So if he has buffed rank 5, and now buffing rank 10. He will have Rank 15 cast on him by the dummy.

Adding the illusion of a cumulative buff.

I think I just need to use a custom value of target unit to set the array and work from there.

Upon looking at code in another map, I think I found the solution. Thanks anyway
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Trigger tags are along the long (longgggggg... lol) list of tags and is written like this:

[trig.ger]your trigger[/trig.ger] - without the dots.


The "Unit has buff" condition is in boolean's units conditions (last one of the units conditions).


And reading triggers in code tags is just too annoying so I didn't really bother lol (yea im lazy).
 
Level 12
Joined
Mar 16, 2006
Messages
992
Trigger tags are along the long (longgggggg... lol) list of tags and is written like this:

[trig.ger]your trigger[/trig.ger] - without the dots.


The "Unit has buff" condition is in boolean's units conditions (last one of the units conditions).


And reading triggers in code tags is just too annoying so I didn't really bother lol (yea im lazy).

Yeah, I looked at someone elses [co.de] tag and I realized how troublesome it was for me to look at it too. I guess we're both kind of lazy.

And thanks for the Unit has buff tip. That's the one thing I hate about GUI triggering. Finding the trigger.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Trigger tags are along the long (longgggggg... lol) list of tags and is written like this:

[trig.ger]your trigger[/trig.ger] - without the dots.


The "Unit has buff" condition is in boolean's units conditions (last one of the units conditions).


And reading triggers in code tags is just too annoying so I didn't really bother lol (yea im lazy).

you can type [trigger][/trigger]

Tip: [trigger[B][I][U][/U][/I][/B]]
 
Status
Not open for further replies.
Top