Are some spells hardcoded for range?

Status
Not open for further replies.
Level 4
Joined
Mar 2, 2023
Messages
28
So far for all my testing and experimenting, including aquisition range, attack range, and of course spell cast range, it seems so.

It is not hard to test in game, and from what I see, Flame Strike (I modified it, hence increased cast range also) is definitely shorter than unit attack range.

Also in my custom campaing, I have modified (made as additional custom ability) Frost Armor (available only to one single semi-hero unit), at first I noticed it as unit was not casting Frost Armor (auto-cast) at my army in fight as I hoped for. Than I played a lot with mentined things, but no luck. It seems like there is some limit so no matter how much range I set.
Only solution so far seemed to manually move unit closer to melee combat (in that case it will be auto-cast all time, if needed), or decrease unit attack range a lot so it come closer to front line (but that kill purpose of unit and makes no sense for specific reasons).

Is that hardcoded or I miss/mistake something?

Tnx <3
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I believe the AI is coded to use most spells during combat when units are in combat range (acquisition range). This value is pretty much the same on every unit so you probably shouldn't expect things like a Lich with autocast Frost Armor to traverse across the entire map to Frost Armor something. If you increase Lich's acquisition range and possibly attack range as well you may see better results (edit: you said you tried this, so nevermind). That being said, I can't confirm or deny this, and there's a good chance that the game does indeed have some constant Area of Effect or Range value that determines which units to target Frost Armor with.

You could always try to come up with your own AI system for these spells, although that may conflict with the game's standard AI system.

Speaking of AI systems, here's a GUI system I made for detecting when a Generic unit acquires a target. You could use this system to detect when one of your units enters combat (acquires a target) and then proceed to check for an Ability or Unit-Type in the Conditions and tell the Acquiring unit to do just about anything you want. For example, search for an Ally unit within 1000 range and tell the Hero to cast Frost Armor on said Ally. You could even filter for things like "Highest hp unit" to make Frost Armor have priority for these types of units.

I can't promise that the system is bug free or performant as I've only played around with the test map for an hour or so, but it seems to get the job done. If someone else would like to improve the system (my Jass skills are very poor) that would be great. I have a feeling that it might have memory leaks (I'll look into it myself soon).
 

Attachments

  • GAS Acquire System 1.w3m
    23.5 KB · Views: 6
Last edited:
Level 4
Joined
Mar 2, 2023
Messages
28
Thank you!

I saved this and I will explore more. At moment my level of modding skill is such that I don't fully understand how I would set it (but I did not try for serious as I did had a lot other stuff to finish). It is awesome as you describe so definitely I will have it on schedule (I will do it more for reason of learning, it is not that important in my campaing as only one semi-hero unit have it, and she is not going to appear in every mission, nor her Frost Armor, despite it is very good Spell, is any turning point).

For now I adjusted settings of unit and custom Frost Armor in my campaing best I could, it works. It is just that auto-cast range limit is indeed there (I tested it a lot), manually cast range works just fine as you set it.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Here's something more tailored towards your exact needs. I've created triggers which periodically check for allied unit's within 2000.00 range of Lich and tell him to Frost Armor them. This radius can be customized of course.

You would copy and paste the triggers into your map, update a few fields that may have changed in the transferring process, and you're done.

So for example your Frost Armor ability may be different from mine so you would need to update that in the triggers. It's only referenced a couple of times. Same goes for the Lich unit that I'm referencing, it should be changed to your semi-Hero unit instead.
 

Attachments

  • Lich Frost Armor Advanced Autocast.w3m
    21.6 KB · Views: 3
Last edited:
Level 4
Joined
Mar 2, 2023
Messages
28
Thank you a lot! I will try to make best use of this. I will report once I test it fully (or if I don't get it fully to work as we planned I will check with you). 👍
 
Level 4
Joined
Mar 2, 2023
Messages
28
@Uncle

I was testing this a lot last night, here is my report.

For whatever reason, at first it did not work despite I payed high attention to adjust your trigger with every detail needed (my spell, unit, etc). And I did check it multiple times.
Or there was something missing, or I missed something which would be no suprise as I'm still novice.

Than, I created new trigger, using parts of yours, which is, lets say lot more simplified. This may be far from perfect but I will tell you how I did it. As Event it starts as "unit attacked owned by player (me)".
Than there is number of conditions where I used a lot from your trigger, in addition to some of my (I also solved that she is not casting it over and over to attacked unit, with check does attacked unit already have Frost Armor buff). It ends with only one Action, and that is same as in your trigger - Order "my specific unit" to use Frost Armor on attacked unit.

And it worked. Soon I add mentined check does attacked unit already have buff, check mana of caster. Than I started playing with aquistion range, range, spell cast range (frost armor) and distance range set in trigger to check for attacked unit. Playing with that I managed to make it working pretty well.
Now she is definitely covering army around with frost armor wayyyyyyyy better than it was with normal auto-cast (which is limited for some AI reason to I think around 600).

Only bad thing is this, once she cast by this trigger Frost Armor, her previous attack move with group is canceled. And it have logic, it would be same for any unit, if you manually (and by trigger, it is actually manually cast, not auto-cast) cast spell like that, unit would stop previous movement. This is not perfect thing as if group is ordered into some area, she will stop and stay behind. I have no idea was this solved in your trigger, as I could not make your trigger to work.

Also I have to report. Trigger to toggle with "frostarmoron and frostarmoroff" works without issue. It is Lich Frost Armor Advanced trigger one which I could not get to work.

Another thing to report, about conditions in your trigger (I moved them to my), is check CurrentOrder of "my unit" Not Equal to Order(move), (smart), (patrol).

Move works fine, if she is ordered to move she will ignore all of that and won't cast frost armor.
I have no idea what "smart" order is ???
Patrol doesn't work (but it is not problem) simply. If she is on patrol, it is same as if she is on Attack move to some point around - she will cast Frost Armor (if needed).

If you think we need to check your trigger, or one which I created later which works for me (if anything like her resuming previous attack move command could really work), let me know. We can check it together and I would test it further.

----------------------------------

I was working on this whole night, it took time really until I get some good results which works. But today, I see that strings in my custom campaign (which include lot of maps) are lost and become TRIGSTR_(whatever number). It did not effect any text in quest, hint etc messages in triggers, but affected every custom unit, spell, buff, upgrade, anything I modified. And I did a lot (only for units I have exactly 70 custom spells). This is very custmised campaign. Well not everything is lost, I can manually rewrite all it again, at cost of one day or even two.

I did take a look around and found also some other users run into this problem, but I did not found that anyone have ultimate solution, nor anyone knows what is exact reason to cause this. People say backup, and probably that is best advice for me from now on. For backup, is it enough to copy/paste my campaign to some other place on PC ? It it is, that it would be ok for me, as when I work I work for long, so I would rather copy paste 15 times instead of working ton of work again because of not regulary updated backup.

Just to ask for any case? Could this playing with trigger caused this? As I remember, when I worked on it yesteday, I was looking also at custom abilities and there was no TRIGSTR_. It seems to appeared today. So I doubt it have anything with trigger, but let me know if you suspect it, I need to know in case I make some mistake, so I can avoid it in future.
Also, I was notified today that update for WC3R is needed, and I did it. It solved nothing about this. I suspect also that update maybe, can be reason for this string mess.

Looking forward to your opinion and suggestions. Thx
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I would have to see your triggers to know what you did wrong when trying to import my triggers. You either missed something, have another trigger that's interfering, or the issue lies deeper and is related to the weird string stuff. You could also post the map here or in a PM if you don't mind sharing it with me.

Also, I have zero experience with custom campaigns or any errors like you've mentioned, but I'm sure others have experienced the same thing and have made similar threads on the topic which you could check out. Try googling "Hiveworkshop X" where X is the issue, I find the best results that way.

The trigger I provided was nothing out of the ordinary so I'd rule that out. Perhaps the very act of creating a trigger was the cause, regardless of what the trigger did, I can't say anything for certain.
 
Last edited:
Status
Not open for further replies.
Top