• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[SPELLS] List of Spells

Status
Not open for further replies.
Level 3
Joined
May 24, 2016
Messages
22
Have a list of spells that I would like to put in a map but am not good enough at coding to create:

Shadow Clone: spell that automatically duplicates any target unit (hero, building, etc.--configurable with allowed types) complete with abilities fully usable. Still counts as an illusion, still counts as summoned, is dispellable, etc. Configurable damage dealt and taken (as an illusion).

Shapechange: spell that makes the caster take the shape, hp, mana, and full abilities of the target for a time. Loses their own ability for the duration, though can change back to original form at any time.

Crushing Hand: Big force that hurts opponents and is channeled, controlled by the user moving their cursor (Follows the cursor). Can be ended earlier than normal duration by clicking.

Cloudkill: Poison gas that damages opponents; hurts the lowest hitpoint opponents first. Automatically kills creatures of less than 200 max hitpoints, moves with the caster.

Mass Sleep: sleep spell that puts lots of units in an area to sleep. However, does up to a certain hitpoint limit, selecting lowest level units first, up to the full total of hitpoints.

Notice Aura: Makes the user invisible to anyone more than a certain distance away.

Protection from Missiles: Makes the user temporarily immune to non-magic missile/artillery attacks.

Magic Missile: Like the AD&D spell. More missiles with higher levels, ability to target missiles at different targets if need be. Preferably not requiring a library.

Virus Charm: Targets a unit. That unit temporarily fights for the caster (not under their control though). Any enemy they go near has a chance to become similarly affected. The charm itself lasts for one time, while the spell lasts for another longer duration. Each unit affected can spread the charm so long as the original duration isn't up.

Pass Wall: when used allowed the caster to temporarily move through solid terrain. If stuck in terrain at end of movement, will take damage and be moved to nearest pathable space.

Lightning Bolt: Bolt of lightning that will damage all units in an area it moves across. If it encounters trees or terrain it will bounce back the other direction. It will continue for a set duration and every time it encounters trees, terrains, structures, etc., (not units) it will reverse direction, doing damage every time it crosses the unit.

Symbol: Dispellable but not attackable/destroyable symbol placed on the ground. Has effects based upon hit point totals (Configurable what hit points): death, fear, attack allies, sleep, stun. Anyone walking near it gets the effect.

Programmed Illusion: When an enemy comes near the target spot, causes illusion version to spawn just outside of visual range, then rush to attack. Illusions are a random number of random unit types (configurable which) with seperately configurable number of illusion heroes and hero types. Duration, damage dealt, and damage taken of illusions configurable

Reduce/Enlarge: Can be cast on enemy or ally. Makes the enemy smaller and reduces their maxhitpoint (but not percentage hitpoint) by a certain percent. Allies makes larger and increases the maxhitpoint (but not percentage hitpoints) by a certain percent. Returning to normal can't hurt either opponent or ally (nor heal them back to above original hitpoints).
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,031
Many of these can be approached with little trigger knowledge, and most can be made with perseverance. I would suggest you try to attempt the simplest ones yourself and treat it as an exercise with the benefit that as you get better at it your mapmaking vision will grow. Read tutorials, look at methods used by approved spells, and post questions when you have them. In the long run you'll benefit more by learning than by asking someone to do it for you.
Shadow Clone: spell that automatically duplicates any target unit (hero, building, etc.--configurable with allowed types) complete with abilities fully usable. Still counts as an illusion, still counts as summoned, is dispellable, etc. Configurable damage dealt and taken (as an illusion).
Not particularly difficult. When cast, make a new one of the unit type of the targeted unit. Give it an expiration timer, add the "summoned" classification, and add it to a unit group. Using a Damage Detection System, when a unit in this group deals damage or takes damage, modify it by the illusion % as necessary. Multiple groups for multiple levels or give the unit an invisible dummy ability that you set to the right level the spell was cast at.
Shapechange: spell that makes the caster take the shape, hp, mana, and full abilities of the target for a time. Loses their own ability for the duration, though can change back to original form at any time.
Very time-consuming to make. You'll need a reverse bear form ability for each unit the caster can turn into, and then another one to turn back into the caster from that unit. Also what happens if the caster is a hero and it morphs into a non-hero unit? If the caster is a unit rather than a hero you can use Chaos to morph it but there's not a big difference between that and reverse bear form.
Crushing Hand: Big force that hurts opponents and is channeled, controlled by the user moving their cursor (Follows the cursor). Can be ended earlier than normal duration by clicking.
This is remarkably similar to a spell in this spellpack I made. The code could be modified to achieve this with a bit of effort.
Cloudkill: Poison gas that damages opponents; hurts the lowest hitpoint opponents first. Automatically kills creatures of less than 200 max hitpoints, moves with the caster.

Mass Sleep: sleep spell that puts lots of units in an area to sleep. However, does up to a certain hitpoint limit, selecting lowest level units first, up to the full total of hitpoints.
Easily triggerable, these are pretty basic. The first will require understanding dynamic indexing.
Notice Aura: Makes the user invisible to anyone more than a certain distance away.
Extremely difficult to achieve; making units visible only for certain players is nigh impossible without desyncing some of the players. If I have vision of the area but no unit in range, I should see other units attacking that invisible unit but not the unit itself? Oof.
Protection from Missiles: Makes the user temporarily immune to non-magic missile/artillery attacks.
Simple. Add either something based on Defend or Hardened Skin to avoid ranged damage. It could also be accomplished with a DDS.
Magic Missile: Like the AD&D spell. More missiles with higher levels, ability to target missiles at different targets if need be. Preferably not requiring a library.
There's nothing wrong with requiring any libraries. Libraries are made specifically to be used to reduce the code overhead for doing things. This spell is reasonably complicated and I would probably use a missile library to achieve it. How should changing targets mid-cast work? I guess you could track the mouse location and launch at the closest enemy unit to the cursor XY.
Virus Charm: Targets a unit. That unit temporarily fights for the caster (not under their control though). Any enemy they go near has a chance to become similarly affected. The charm itself lasts for one time, while the spell lasts for another longer duration. Each unit affected can spread the charm so long as the original duration isn't up.
This description is not very clear. The charm only lasts X seconds but the spell's total duration is Y seconds; after X seconds the unit is no longer 'charmed' but until Y seconds have passed that specific unit has a chance to charm other nearby units? (Even though it is not actually charmed any more?) Or units can only charm other units while they are themselves charmed? What "fights for the caster" means is entirely dependent upon your map type, and for the unit not to be under the caster's control would require building some rudimentary AI for the charmed units. Overall moderate difficulty.
Pass Wall: when used allowed the caster to temporarily move through solid terrain. If stuck in terrain at end of movement, will take damage and be moved to nearest pathable space.
Making units able to pass through solid terrain? Not particularly difficult. Making them actually PATH through that terrain when ordered to move? Much more difficult. The best solution here would probably be to make them flying units for the duration, but I'm not sure there's a way to make flying units targeted as ground temporarily. Some messing with crow form, reverse bear morph into flying unit versions of themselves with "targeted as: ground" in the OE, and setting classifications with triggers may be required to find a solution.
Lightning Bolt: Bolt of lightning that will damage all units in an area it moves across. If it encounters trees or terrain it will bounce back the other direction. It will continue for a set duration and every time it encounters trees, terrains, structures, etc., (not units) it will reverse direction, doing damage every time it crosses the unit.
Reasonably simple, just requires dynamic indexing and something like TerrainPathability (Google thinks the site has malicious code because of the modified vB the site uses--there's no risk).
Symbol: Dispellable but not attackable/destroyable symbol placed on the ground. Has effects based upon hit point totals (Configurable what hit points): death, fear, attack allies, sleep, stun. Anyone walking near it gets the effect.
How do hit points affect the effect? It's not clear to me what you intend with this one.
Programmed Illusion: When an enemy comes near the target spot, causes illusion version to spawn just outside of visual range, then rush to attack. Illusions are a random number of random unit types (configurable which) with seperately configurable number of illusion heroes and hero types. Duration, damage dealt, and damage taken of illusions configurable
Visual range of 1 unit is easy to determine. The visual range of a group of units is much more computationally expensive. Same caveat about units appearing only for one person if that's what you intend here. Could be moderate or very difficult depending on these two factors.
Reduce/Enlarge: Can be cast on enemy or ally. Makes the enemy smaller and reduces their maxhitpoint (but not percentage hitpoint) by a certain percent. Allies makes larger and increases the maxhitpoint (but not percentage hitpoints) by a certain percent. Returning to normal can't hurt either opponent or ally (nor heal them back to above original hitpoints).
Very simple, presuming there aren't other things that can affect max HP with triggers and the same unit can't be targeted by this spell multiple times simultaneously. By "nor heal them back to above original hitpoints" do you mean "the hitpoints the unit had when the spell was cast on it" or "the max hitpoints of the unit before the spell was cast on it"? If the former, then I'm not sure this spell really makes much sense as it doesn't do much.
 
Last edited:
Level 3
Joined
May 24, 2016
Messages
22
You're in luck, I made mass sleep a long time ago!
Thanks so much--that's absolutely perfect!

Many of these can be approached with little trigger knowledge, and most can be made with perseverance. I would suggest you try to attempt the simplest ones yourself and treat it as an exercise with the benefit that as you get better at it your mapmaking vision will grow. Read tutorials, look at methods used by approved spells, and post questions when you have them. In the long run you'll benefit more by learning than by asking someone to do it for you.

Will try--as we get into Jass requirements and library/multi-system requirements, that's where I start having trouble. I can do fairly simply spells, though I'm not great at MUI.

Not particularly difficult. When cast, make a new one of the unit type of the targeted unit. Give it an expiration timer, add the "summoned" classification, and add it to a unit group. Using a Damage Detection System, when a unit in this group deals damage or takes damage, modify it by the illusion % as necessary. Multiple groups for multiple levels or give the unit an invisible dummy ability that you set to the right level the spell was cast at.

But how do I get it to still be and count as an illusion? How can I make dispel get rid of the unit? How do I get it to appear as an illusion to other players?

Very time-consuming to make. You'll need a reverse bear form ability for each unit the caster can turn into, and then another one to turn back into the caster from that unit. Also what happens if the caster is a hero and it morphs into a non-hero unit? If the caster is a unit rather than a hero you can use Chaos to morph it but there's not a big difference between that and reverse bear form.

Hmm, that's going to be a lot of bear forms. On a hero--how will it work with abilities? Like, if I have it target a unit, turn into it, how do I give it the abilities the other hero has? Since each hero has 5 abilities, does that mean I need an IF/THEN/ELSE for each hero type it could become? If it's just a bear form

This is remarkably similar to a spell in this spellpack I made. The code could be modified to achieve this with a bit of effort.

I'm not good enough at Jass to even know what I'm looking at.

Easily triggerable, these are pretty basic. The first will require understanding dynamic indexing.

Okay, will try my hand at it then. The dynamic indexing tutorial there really helps.

Extremely difficult to achieve; making units visible only for certain players is nigh impossible without desyncing some of the players. If I have vision of the area but no unit in range, I should see other units attacking that invisible unit but not the unit itself? Oof.

So not possible?

Simple. Add either something based on Defend or Hardened Skin to avoid ranged damage. It could also be accomplished with a DDS.

Did not realize Hardened skin partitioned out ranged from melee. Can I simply use locals and a wait to do this? Or does this need indexing too?

There's nothing wrong with requiring any libraries. Libraries are made specifically to be used to reduce the code overhead for doing things. This spell is reasonably complicated and I would probably use a missile library to achieve it. How should changing targets mid-cast work? I guess you could track the mouse location and launch at the closest enemy unit to the cursor XY.

I just said preferably no libraries because I do not understand libraries anywhere near well to do them myself. But I'm willing to try working with them.

As to changing targets--basically click on target. Original target will always get at least 1 missile. Number of missiles increases with level. Clicking on enemies in range during the duration of the spell will cause the target to be changed to the clicked enemy.

This description is not very clear. The charm only lasts X seconds but the spell's total duration is Y seconds; after X seconds the unit is no longer 'charmed' but until Y seconds have passed that specific unit has a chance to charm other nearby units? (Even though it is not actually charmed any more?) Or units can only charm other units while they are themselves charmed? What "fights for the caster" means is entirely dependent upon your map type, and for the unit not to be under the caster's control would require building some rudimentary AI for the charmed units. Overall moderate difficulty.

Apologies, I'l try to be clearer. So basically, the virus lasts a set duration Y. The charm lasts X. Any unit that comes within say 125 range of a unit charmed by the spell has a Z% chance to be charmed themselves. While a unit is affected by the charm, they maintain that charm units in range effect, up until the duration Y is up. However, the charm X will continue for its full duration regardless when the unit was charmed. So, a unit is originally charmed for 20 seconds. The spell has a duration of 60. It charms another unit by walking near it. After the 20 second charm is up, it won't be infected, and so can't spread the charm, unless it gets reinfected. But each person infected can spread it. Now, say a unit charms another at second 59 of the 60 second duration. That newly charmed unit can only infect others for 1 second, but will stay charmed for 20 seconds. And in this case, charmed means will act as an ally (fight enemies of the caster, follow and protect). Is that clearer?

Making units able to pass through solid terrain? Not particularly difficult. Making them actually PATH through that terrain when ordered to move? Much more difficult. The best solution here would probably be to make them flying units for the duration, but I'm not sure there's a way to make flying units targeted as ground temporarily. Some messing with crow form, reverse bear morph into flying unit versions of themselves with "targeted as: ground" in the OE, and setting classifications with triggers may be required to find a solution.

Hmm, so temporary flying works. How would I go about institution the duration and damage at the end of the duration it the unit is still in unpathable terrain?

Reasonably simple, just requires dynamic indexing and something like TerrainPathability (Google thinks the site has malicious code because of the modified vB the site uses--there's no risk).

I can try, but might depend on how my attempt at the first index spella bove goes.

How do hit points affect the effect? It's not clear to me what you intend with this one.
Hit point total determines the effect. So a unit at 100 hp might instantly die. At 200 be forced to flee. At 300 attack allies. At 400 sleep. At 500 be stunned. At 700 nothing. E.g. With the HP requirements for each varying by level.

Visual range of 1 unit is easy to determine. The visual range of a group of units is much more computationally expensive. Same caveat about units appearing only for one person if that's what you intend here. Could be moderate or very difficult depending on these two factors.
Illusion would only trigger once, but would have to be made out of visual range of enemies of the caster (or at least of non-AI enemies). All can see the illusions.

Very simple, presuming there aren't other things that can affect max HP with triggers and the same unit can't be targeted by this spell multiple times simultaneously. By "nor heal them back to above original hitpoints" do you mean "the hitpoints the unit had when the spell was cast on it" or "the max hitpoints of the unit before the spell was cast on it"? If the former, then I'm not sure this spell really makes much sense as it doesn't do much.

No, same unit can't be targeted multiple times. And not heal them above, as in, a unit cannot be returned to more than they had at original cast. But it's for this. So, let's say a unit with 1000 HP is reduced 10x to 100 hp. They take 40 damage. When returned to normal size, that 40 damage is equivalent 400 damage and so they are now at 600 health. Now let's say that same unit had 600 at the cast. They go to 60, and get holy light back to full 100. When the spell ends, they go back to 600, because it maxes back to the original health at the cast.

For enlarged allies. They have 100 and get 10x to 1000. If they take 100 damage, that becomes only 10 damage when they return to normal. But if they had 90/100, they get enlarged to 900/1000, not 900/900. When they return to normal, they cannot have more than 90/100 hp.

What it does is effectively multiple/reduce damage, but it also affects healing and life costs.--so that a healing ward healing for 1% health has more effect on enlarged allies and less on reduced enemies (during the spell duration that is), and that hitpoint costs in spells are more damaging for enemies and less for allies.

Which, the other thing, not sure how, but it would be good if i could be affected by spell-steal.
 
Extremely difficult to achieve; making units visible only for certain players is nigh impossible without desyncing some of the players. If I have vision of the area but no unit in range, I should see other units attacking that invisible unit but not the unit itself? Oof.
So not possible?
It can be done by creating a dummy unit with the ability reveal invisible units for an unused player slot, and constantly settings the dummy units location to the location of the invisible unit. Whenever a players unit gets within range of the unit with the aura they get shared vision over the units of the player the dummy unit belongs to. When they no longer have any units within range you simply revoke their shared vision.

I haven't tested it but it should work fine in theory.


EDIT; Attaching a working example.

When you click test map just type "move" without the brackets to make the crypt lord move to the Paladin. You will then see a crypt lord attacking the air :p


It looks a bit weird if both the crypt lord and the mage is near the Paladin simultaneously, but that's because the dummy unit is changed to Neutral passive every time a unit that doesn't belong to player 1 red is picked, which means every 0.05 seconds. Find a better way to change the team of the dummy unit to avoid this. I'm too tired to continue on this.
 

Attachments

  • Invisibility Stuff.w3x
    19.4 KB · Views: 45
Last edited:
Level 3
Joined
May 24, 2016
Messages
22
@Pyrogasm I started to work on them (and especially indexing--was doing another spell of my own to test out if I understood). But, I'm a medical student and school started back, so it's been put on the backburner :(
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
But how do I get it to still be and count as an illusion? How can I make dispel get rid of the unit? How do I get it to appear as an illusion to other players?
You can modify the damage it deals and takes using a DDS, and I believe giving it the summoned classification will make dispel/purge work on it. You can locally tint the illusion blue for allies of the caster, and enemies will still see it as normal color.
Hmm, that's going to be a lot of bear forms. On a hero--how will it work with abilities? Like, if I have it target a unit, turn into it, how do I give it the abilities the other hero has? Since each hero has 5 abilities, does that mean I need an IF/THEN/ELSE for each hero type it could become? If it's just a bear form
When it morphs into the target it will automatically gain all the abilities that unit has, that's just how morph abilities work. It will lose any ability not shared between the two units that hasn't had UnitMakeAbilityPermanent called on it (no GUI equivalent action), but they will come back when it morphs back (unless they were added with triggers before the morph and haven't been Permanent'd). I believe all of its skill points will be reset when it morphs so you'd have to set levels of abilities with a trigger when it morphs. For morphing into non-hero units you would have to make a hero-ified copy of that unit in the OE and morph into that unit. Instead of a huge If tree, the easiest thing to do would be to build a set of parallel arrays like MorphTarget[1] = Raccoon, MorphInto[1] = HeroToRaccoon, MorphBack[1] = RaccoonToHero. Then you search down the list and look for a match in MorphTarget. You could also store this info in hashtable which would remove the need to search.
So not possible?
Aside from what Feelsgoodman tried above, I think the only way this could be achieved would be to give the unit permanent invisibility and then give every other unit on the map a true sight ability so they can see that unit if it's within range. This obviously only works if this ability is the only invisibility effect in your map.
Did not realize Hardened skin partitioned out ranged from melee. Can I simply use locals and a wait to do this? Or does this need indexing too?
HS and Def can't differentiate between magic/non-magic though, so if you want that DDS is the only way. You could either add the unit to a group, wait, and then remove it when the duration is up... or give the spell some sort of buff, add the unit to a group, and remove it from the group when it would take damage but doesn't have the buff any more.
Apologies, I'l try to be clearer. So basically, the virus lasts a set duration Y. The charm lasts X. Any unit that comes within say 125 range of a unit charmed by the spell has a Z% chance to be charmed themselves. While a unit is affected by the charm, they maintain that charm units in range effect, up until the duration Y is up. However, the charm X will continue for its full duration regardless when the unit was charmed. So, a unit is originally charmed for 20 seconds. The spell has a duration of 60. It charms another unit by walking near it. After the 20 second charm is up, it won't be infected, and so can't spread the charm, unless it gets reinfected. But each person infected can spread it. Now, say a unit charms another at second 59 of the 60 second duration. That newly charmed unit can only infect others for 1 second, but will stay charmed for 20 seconds. And in this case, charmed means will act as an ally (fight enemies of the caster, follow and protect). Is that clearer?
Yes I understand. An unused player slot that you temporarily transfer ownership of the units to would probably be the best way to achieve this, otherwise you'll have to build some AI logic and constantly keep micromanaging the charmed units with triggers. Z% chance to be charm... per second? per every time it crosses the range threshold? per what? I would say this is not particularly complicated actually and can be achieved in a dynamic indexing format, but I would suggest knowledge of hashtables will make it easier to store data about the cast.
Hmm, so temporary flying works. How would I go about institution the duration and damage at the end of the duration it the unit is still in unpathable terrain?
You can use TerrainPathability - Wc3C.net to check if it's in unwalkable terrain. Duration is either by locals + wait or a stack of dynamically indexed units + a low duration timer.
Hit point total determines the effect. So a unit at 100 hp might instantly die. At 200 be forced to flee. At 300 attack allies. At 400 sleep. At 500 be stunned. At 700 nothing. E.g. With the HP requirements for each varying by level.
This is very simple, then. Just check HP value on cast and perform different effects based on which condition it satisfies.
Illusion would only trigger once, but would have to be made out of visual range of enemies of the caster (or at least of non-AI enemies). All can see the illusions.
Off the top of my head I'm not sure of an algorithm to find a point that's outside visual range other than randomizing points and checking the distance to each unit until you get one that works, then moving that point as close to the center-mass of the unit group until it is no longer outside each vision radius. Presumably there is some math thing out there to do this, but I'm not aware of it (yet).
No, same unit can't be targeted multiple times. And not heal them above, as in, a unit cannot be returned to more than they had at original cast. But it's for this. So, let's say a unit with 1000 HP is reduced 10x to 100 hp. They take 40 damage. When returned to normal size, that 40 damage is equivalent 400 damage and so they are now at 600 health. Now let's say that same unit had 600 at the cast. They go to 60, and get holy light back to full 100. When the spell ends, they go back to 600, because it maxes back to the original health at the cast.

For enlarged allies. They have 100 and get 10x to 1000. If they take 100 damage, that becomes only 10 damage when they return to normal. But if they had 90/100, they get enlarged to 900/1000, not 900/900. When they return to normal, they cannot have more than 90/100 hp.

What it does is effectively multiple/reduce damage, but it also affects healing and life costs.--so that a healing ward healing for 1% health has more effect on enlarged allies and less on reduced enemies (during the spell duration that is), and that hitpoint costs in spells are more damaging for enemies and less for allies.

Which, the other thing, not sure how, but it would be good if i could be affected by spell-steal.
Storing this data in a hashtable (recommended) or again parallel arrays that you search through for a match is the way to get this to work. Once you have starting hp and starting max hp stored the spell becomes pretty trivial. Spell steal, uhh, kinda makes that harder. You'll have to catch that spell being stolen and apply its affects at a reduced duration to the new target, so this requires you to store duration as well as determine that it was the spell stolen when SS was cast. I'm not sure on the specifics of which unit has which buff when when SS is cast, but by checking buffs at Begins Casting, Starts the Effect, and Stops Casting you could probably determine when it was this spell.
 
Level 3
Joined
May 24, 2016
Messages
22
First of all, thanks again Pyro.


And I have finally gotten back to working on stuff now that the semester is over (started back at the triggering yesterday). Began looking back into dynamic indexing and started simple. So, hopefully I can begin to understand a little of how to do it. I understand enough that I think I can work on the Cloudkill idea. To clarify though--basically we'll index the caster, and every so many seconds trigger the damage. It can check in a radius for matching units, etc. The thing that isn't clear to me is, can I index timers such that the indexing allows various to casts to damage on their own specified time sets. So like, if A casts it at 0.05 seconds, B at 0.1, they don't both get the first damage at the exact same time. Which, i mean, it may just be fair that the time difference is so low, but still...

I took a look at FeelGoods' map. And it does work. The problem is, with a single dummy, it makes weird control issues. So, I'd have to make a dummy for each occupied player slot, force it to follow, and give control of that dummy back and forth based on player nearby. Not necessarily hard. Gotta work out doing it, though. I'm thinking I could just create the dummy and index it to decrease map size, then de-index it when the conditions aren't met to reduce leak. But...that seems like possibly too complex. The other, less difficult issue, is setting the distance for seeing it to decrease with level of the aura ability. But it all becomes a little more complex trying to make it MUI. Again, maybe by indexing all of it, creating a dummy, user a periodic check event with a loop to kill the dummy if number of units owned by the owner of the dummy in the area is less than 2? Thoughts? This one's been racking my brain.

And also, I'll get back to you more on the others--especially the virus charm idea. Right now still working through Dynamic Indexing so I can at least say I took the first set of advice to heart. (On a related side note, in my first attempt at DI I added lines of codes to remove leaks, remove dummies, etc. during the indexing--is that appropriate or does DI not really leak?)
 
Last edited:
Level 3
Joined
May 24, 2016
Messages
22
Okay, okay. Been giving that one a little more thought. I'
So here's my ideas, not sure it works, but want to get some feedback before I invest time into it.

First off--the group inclusion needs to use the unit learn for the ability. Whenever a unit learns the ability/is born and has it, it gets added to a group of units with the ability. In order to prevent double check, obviously it needs a loop to check if it already belongs by using a loop (so each unit in the group is assigned to an index), it loops through and checks if it equal, and if so, just resets the level of the ability for that index number. If it isn't already in the index it gets added as a new slot. And, if one of those units die, it gets removed from the group and the index is dialed down. Then, whenever a unit enters into range of a unit with the ability if it's the only unit in range of a unit with the ability, it creates a dummy with true sight for the viewing player, within an array player slot by unit index. The array will identify player number and group unit number for the dummies. Now, I'm not entirely sure how to check for any unit within the unit group. But, the basic idea.

Here's where it gets dicey and I need to check if it will work. So the loop trigger runs every couple seconds. It loops to check the number of units for each player within range of the viewed unit. If the number of units for that player is 0, it kills the dummy slotted to that ability unit for that player. Then, if 0, it adds 0 to a running total. If greater, it adds 1 to a running total. If the running total ends up 0, it kills all the dummies, then turns off the trigger.

Cons to this method: possibly heavy leaks if a lot of units with the ability and with potential for 26 dummies allocated to each unit with the ability (Since we don't count the player owning the unit with the ability). Heavy resources usage.

But, I'm not sure if there's another way....

Just thinking this through since, as it's only going to be my like fourth or fifth spell using dynamic indexing, I'm not even sure I have the basic concept for the logic correct.

EDIT: Just noticed a major flaw. This requires a multi-dimensional array, which isn't possible. Hmm...is there a workaround?
 
Last edited:
Status
Not open for further replies.
Top