wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 10-05-2006, 03:52 AM   #1
WTFish
User
 
Join Date: Jan 2004
Posts: 390

WTFish is on a distinguished road (22)

Default Alternate Spell Cooldown

How can I make it so that for spells cooldowns, the cooldown is not measured in seconds, but in successful attacks? Ie. If a spell cooldown is 10 seconds, after you cast it, you have to land 10 attacks, before you can use it again.

With a trigger based cooldown system, where spells will fail if they arent cooled down, how could you make it so you know whether they are cooled down or not ? (you wont see the effect on the icon showing cooldown) Would each ability require an upgrade called Cooldown or something?

Any ideas would be appreciated.

Thanks.
WTFish is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-05-2006, 04:03 AM   #2
Mystic Prophet
User
 
Mystic Prophet's Avatar
 
Join Date: Nov 2005
Posts: 375

Mystic Prophet is on a distinguished road (16)

Send a message via AIM to Mystic Prophet Send a message via MSN to Mystic Prophet
Default

for the second part of your question. You would have to set the cooldown to 0 (making it have an infinite duration) and then use a trigger to reset the cooldown when it's conditions are met.

for the first part. simply have a trigger that detects when the unit with the spell attacks, if a spell is on cooldown. add 1 to the integer array for that particular spell and every other spell that's on cooldown for that Hero. when the value of integer spell reaches 10. reset the cooldown for that spell.

This sounds like like a fun little project to try. I'm going to have to work on it later.

Last edited by Mystic Prophet : 10-05-2006 at 10:14 PM.
Mystic Prophet is offline   Reply With Quote
Old 10-05-2006, 06:58 AM   #3
WTFish
User
 
Join Date: Jan 2004
Posts: 390

WTFish is on a distinguished road (22)

Default

Each character will only have 6 abilities, but in most games they will probably be different. Do I have to have a variable for every single different type of ability? Or... 6 integer array variables (12 array size), which represent the six abilities each players hero has.

By cooldown to 0, don't you mean cooldown to 999999 or something? So that it will never cooldown, only cooldown by triggers? Can you cooldown one specific spell? I thought you could only reset all ability cooldowns, lol.
WTFish is offline   Reply With Quote
Old 10-05-2006, 09:23 AM   #4
Jazradel
Superuser
 
Jazradel's Avatar
 
Join Date: Dec 2005
Posts: 651

Submissions (1)

Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)

Send a message via AIM to Jazradel Send a message via MSN to Jazradel
Default

You can remove the other abilities, refresh cooldowns and re-add the abilities.

And yeh, he probably means 9999 seconds.
__________________


Table:
Jump Map
Point System
Warcraft III Model Archive

W3 Model Archive should be available from https://www.mediafire.com/folder/cd5..._III_Resources, PM me if it doesn't work.
Jazradel is offline   Reply With Quote
Old 10-05-2006, 10:12 AM   #5
Mystic Prophet
User
 
Mystic Prophet's Avatar
 
Join Date: Nov 2005
Posts: 375

Mystic Prophet is on a distinguished road (16)

Send a message via AIM to Mystic Prophet Send a message via MSN to Mystic Prophet
Default

does cooldown not work the same as duration? I know if you set the duration to zero it becomes permanent. If it doesn't i suppose an insanely high ammount would work.

you could also just have 2 different abilities one with a mana cost so high no one would ever be able to cast it, and then the normal one. when you cast the normal spell it changes to the dummy abil until the triggered cooldown finishes.

And there's probably some way to simplify the variables in jass, but I can't think of any in gui. You don't want spells resetting their cooldowns everytime another spell hits the ten attack mark, so yes you'll probably need seperate variables for each, and if its for multiple players, they'll need to be arrays.

EDIT: Karawasa needs some smaller tropical tag banners for me to use as signatures :P

Last edited by Mystic Prophet : 10-05-2006 at 10:14 PM.
Mystic Prophet is offline   Reply With Quote
Old 10-09-2006, 08:29 AM   #6
WTFish
User
 
Join Date: Jan 2004
Posts: 390

WTFish is on a distinguished road (22)

Default

Umm... What event do you suggest I use to be sure someone hit with an attack? I cant use 'Generic - A unit takes damage', because that damage could come from any other source. If I use 'Attacked unit', a player can cool down their spells just by pressing the a and clicking someone, not actually hitting them.

Could I give every unit an orb of frost ability that doesn't slow, and use 'Generic - A unit aquires a buff' to detect attack (then remove buff ofc)? If that works, how can I detect which unit actually gave the other unit a buff by attacking it? Ie. how can I detect which unit actually performed the attack? This way I can make it so you can't attack your team-mates for your spells to cooldown.

Any ideas?

Thanks.

Last edited by WTFish : 10-09-2006 at 08:37 AM.
WTFish is offline   Reply With Quote
Old 10-13-2006, 05:25 AM   #7
WTFish
User
 
Join Date: Jan 2004
Posts: 390

WTFish is on a distinguished road (22)

Default

Sorry to have to bump this, but... anyone know what event I can use to detect the attack, and how I can detect which unit it was that made the attack?

Tx.
WTFish is offline   Reply With Quote
Old 10-13-2006, 05:46 AM   #8
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

EVENT_PLAYER_UNIT_ATTACKED For the player event.
EVENT_UNIT_ATTACKED for the specific unit event.

GetAttacker() works to get the attacker for both.
__________________
Rising_Dusk is offline   Reply With Quote
Old 10-13-2006, 05:50 AM   #9
WTFish
User
 
Join Date: Jan 2004
Posts: 390

WTFish is on a distinguished road (22)

Default

Doesn't that event only fire when the attack animation starts, not when the actual damage hits? Then, it will trigger if the attack is evaded, or w/e. ?
Ty for reply.
WTFish is offline   Reply With Quote
Old 10-13-2006, 08:13 AM   #10
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

For accurate attack detection, you would need a damage detect system coupled with detecting an attack-based buff to rule out spell damage, you can also do that by triggering all the spells.

Because "unit takes damage" is a specific unit event, this isn't as simple as it should be. You can, however, make use of existing damage detection systems, just look in the site's resources.

As for abilities, there's no simple way of storing data for them - basicaly, for every unit, or if each player can only have one, for every player, you have to store data for all abilities, or at least all 6 he's using (but then you need to also store which 6 he's using). You could use game-cache, or just try two arrays - store the abilities in one of them and their corresponding cooldowns in the other. Use array indexes 1-6 for player 1, 7-12 for player 2 etc. Then, when a spell is cast, search through the array until you find it, store it's cooldown and disable it, or remove it from the unit, or whatever.

You could use dummy units as techtree requirements and then add/remove (or maybe just hiding/showing works too) them from the map depending on the status of the ability. That would require you to create a dummy unit for each ability, and an additional array to store them.
__________________
Anitarf is offline   Reply With Quote
Old 10-13-2006, 10:50 AM   #11
Jazradel
Superuser
 
Jazradel's Avatar
 
Join Date: Dec 2005
Posts: 651

Submissions (1)

Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)

Send a message via AIM to Jazradel Send a message via MSN to Jazradel
Default

http://www.wc3campaigns.net/showthread.php?t=79545
http://www.wc3campaigns.net/showthread.php?t=82056 ===> The target of this link has changed for some reason. It used to link to a detection engine by shadow-something.

Both of those were attack detection systems.
__________________


Table:
Jump Map
Point System
Warcraft III Model Archive

W3 Model Archive should be available from https://www.mediafire.com/folder/cd5..._III_Resources, PM me if it doesn't work.

Last edited by Jazradel : 10-23-2006 at 11:30 PM.
Jazradel is offline   Reply With Quote
Old 10-14-2006, 09:51 PM   #12
WTFish
User
 
Join Date: Jan 2004
Posts: 390

WTFish is on a distinguished road (22)

Default

Hmm.. The top link you gave is an attack detect engine, but the second one seems to be a dummy system? Is there something I'm not understanding here? lol. On Vex's thread, he says "It has some issues like you are not able to use normal orbs or arrows anymore." Does that mean I can't have items with orb effects? Is there a workaround for it?

Thanks.
WTFish is offline   Reply With Quote
Old 10-15-2006, 01:11 AM   #13
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by WTFish
On Vex's thread, he says "It has some issues like you are not able to use normal orbs or arrows anymore." Does that mean I can't have items with orb effects? Is there a workaround for it?
Yes, there is. Use the damage detect system to trigger your own orb effects.
__________________
Anitarf is offline   Reply With Quote
Old 10-15-2006, 01:23 AM   #14
WTFish
User
 
Join Date: Jan 2004
Posts: 390

WTFish is on a distinguished road (22)

Default

Ah yes, obviously... lol. Thanks for your help.
WTFish is offline   Reply With Quote
Old 10-15-2006, 01:32 AM   #15
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
Originally Posted by Jazradel
I fail to see how the first one is an attack detection system.
Quote:
It has some issues like you are not able to use normal orbs or arrows anymore." Does that mean I can't have items with orb effects? Is there a workaround for it?

The attackdetect engine comes with a fire orb sample and an ability orb template, with those you mostly have all possible orbs covered.

On arrows I find it much easier to code the arrow spells completelly.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:24 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services