HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Custom Spell Combination

01-10-2006, 12:40 AM#1
Volte
I'm looking to making a custom ability, and I have been tinkering around with different attempts for a good while now. I'm trying to make a reversed Siphon Mana (which I managed to get by turning it on in Advanced -> Gameplay Constants)

Now the kicker is trying to make it work like Spirit Link, I'd like to make a chain link of mana sharing between the targeted units. However I'd also like a link to stay attached to the caster, which naturally i'd get from the Siphon Mana ability.

I know I am new here, but hopefully you can overlook this prejudice sign towards dedication on my part. I'd really like to get this working as its a vital addition to the story-line. It has a lot to do with strategic mana manipulation, and as you can imagine, this would open many doors.

Thanks so much for your time Guru's, I hope to be seeing much of you as a helper and a learner.
01-10-2006, 12:48 AM#2
Earth-Fury
will this be a hero ability, or a unti ability? multi-instanceable? (this is important to make a working sugestion :))
01-10-2006, 01:02 AM#3
Vexorian
And the answer will most likelly involve triggers, so I am moving the thread
01-10-2006, 01:24 AM#4
Volte
Heh, thought it would be triggers, but its always shady. I've been working with trigger solutions for it but to no avail. Anyway.

It's gonna be a unit ability, as for multi-instanceable, I'm not sure what that applies to. Thanks for the quick replies.
01-10-2006, 01:26 AM#5
AnarkiNet
multi-instanceable means that the spell would be able to be cast multiple times simultaneously, perhaps by several units at once. If you are only going to have one hero with this spell, and that hero may only be picked by one player, then the spell wont be multi-instanceable. Single-instanceable spells are generally much easier to create as far as triggers go :)
01-10-2006, 01:33 AM#6
Volte
Oh, well then it will need to be Multi-Instanceable.
01-10-2006, 02:05 AM#7
Earth-Fury
simulated 2 dimensional arrays which allow for multiple units owned by multiple players.... not an easy thing to accomplish.

what you will need to do (for the spell, not to make it multi-instanceable) is:
place units in a unit group (friendly untis around the target of the spell), then pick 1 at random. spawn a dummy unit at the location of the target of the initial spell. make it cast an art ability (no effect, only art) on the randomy chosen unit. rinse and repeat this untill you have units collected in a chain... now, as for actually draining the mana in a systematic fasion, i have no bloody clue... >_<

you COULD give the units a hidden syphon ability (as opposed to spawning a dummy unit) but then if one unit where to stop using the ability, then it would mess up the chain emensly. (eg: you have 5 units cained, an the 3rd unit walks away. you end up wit a broken chain..) so it would be best to do it with triggers... now how you can do that in a multi-instanceable fasion... i dont know...

of course, you could pause units in the chain, but then any unit in the chain of mana syponing would be unable to do anything.

this is a brain buster >_< ill think more about this... >_< (how much i wish WC3 had 2D arrays and so, so much more >_<)
01-10-2006, 03:25 AM#8
Volte
Sure is, I just saw something in Candy Wars, that slightly resembled it, so I'll take a look at that and gather some more ideas. Thanks for your help, keep thinking :D
01-14-2006, 05:12 AM#9
Volte
Arg I can't figure this out. Can someone help me please? I really need to make a chain link of mana sharing. I don't want my hand to be held, I just need a shove in the right direction.
01-14-2006, 10:32 AM#10
Peekaboo
What your asking for is incredibly complicated :o, but, it sounds cool so i'll give it a shot

How exactly do you want it to work? Do you want all the units in the chain to be able to move? or the first one to channel? Does it last for a duration or until one of them stops channeling? etc

Also, where does the mana go? Does it go to the caster, from the caster, or from all the units with higher than average mana (is it meant to share out their mana until it's equal?)

If you want to try and make it yourself, the way I would do it is by having *alot* of arrays. You'll need 4+ arrays for the mana siphon special effect, one big array with a big enough array size for every unit potentially able to cast it, then some more arrays for each unit in the chain...yeh it's going to be hard :/

By the way, the reason you need so many arrays is so that more than one unit can cast it at a time, if two units cast it at once, all of the variables needed for the first unit cast all go into array slot [1], all those for the second unit go into [2]. If 50 units are casting it at once, you'll need an array with 50 elements
01-14-2006, 10:54 AM#11
Jacek
That would be freaking lots of arrays... JASS would be better solution here because of locals
01-14-2006, 02:07 PM#12
Anitarf
Well, this is a complicated idea. Let's see, you would need a unit group variable array, holding all pairs/groups of linked units. Whenever new units were linked together, you would look for a free array index and store te new group there including these units, then you would check if any of them are already in any other groups and then either merge groups (new link merges with the old), or remove the unit from the older groups (new link overrides the old). Whenever a unit is dispelled, check if it's in any of these groups and remove it from them, same when a unit dies. If a group is left with a single or no units, destroy it so the array index can be reused.

Now for the ability effect. Whenever a unit would cast a spell, you would have to check if it's in any of the unit groups and if it is, get the spell's mana cost (not sure if there's a function for that, you might need to store the mana cost for all spells to some variable arrayssomewhere and get it from there) and then divert some of the mana from other units in the group to the casting unit, thus distributing the mana cost of the spell over the group.
02-24-2006, 09:45 AM#13
Volte
Hey! Sorry for my hiatus. Thanks for all the awesome replies (I know I might be rezing an old thread). I'm going to continue working on this some more, learning some JASS lately, so I'll keep you guys posted on what I come up with. If you have any other ideas, feel free to dump 'em here. We'll discuss further :)

Thanks again.