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

[Spell] Serious problem with Raise Dead spell

Status
Not open for further replies.
Level 20
Joined
Nov 20, 2005
Messages
1,178
Why? Why? and i mean why??
I got enemy necros ready to raise dead with their spell already "auto-cast on", but they won't raise any corpse!
In order to test whenever i manage to solve this problem i place a necros in my army and use it by randomly killing one of my troops: IT DOES! The spell works normally and the skeleton is summoned, but the SAME necro owned by the enemy NEVER raises anything, even if i tell him to do it! WHY???
I'm out of ideas. How do i solve this?
 
Level 11
Joined
Jun 2, 2013
Messages
613
Essentially, from what I understand from that link is, the AI will only cast it if they are in combat. So even ordering them via trigger may not work if they aren't in combat.

To test, try to put a neutral hostile unit and corpse near them and see if they will cast raise dead then.

On another note, you may could increase the range of the raise dead spell to see if that helps.
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
I was thinking of one last thing to do: using a dummy flying friendly dead raising unit invulnerable, unselectable and with 0 scout radius, which follows the necro everywhere it goes and is ready to cast when unit nearby dies, making also the necro to play a cast-animation just to give the impression. This is weird as hell, i never expected to find this kind of bug.
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
I don't know how you got this problem. You can use this trigger to force the necromancer to use Raise Dead:

  • Unit - Order Necromancer to Undead Necromancer - Raise Dead
This can be done like that:
Unit - Issue Order With No Target ---> Click on Stop ---> Select Undead Necromancer - Raise Dead

To enable the autocast, use this:

  • Unit - Order Necromancer to Undead Necromancer - Activate Raise Dead
You can do in the same way as the function above.
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
I don't know how you got this problem. You can use this trigger to force the necromancer to use Raise Dead:

  • Unit - Order Necromancer to Undead Necromancer - Raise Dead
This can be done like that:
Unit - Issue Order With No Target ---> Click on Stop ---> Select Undead Necromancer - Raise Dead

To enable the autocast, use this:

  • Unit - Order Necromancer to Undead Necromancer - Activate Raise Dead
You can do in the same way as the function above.

Both things i tried in the first place, unsuccessfully. Ok, failed as well with the dummy unit, now the only thing that's left for me to do is creating skeletons from corpses directly via triggers when a caster is within X range.
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
nope, everything is custom, from head down to shoes.
Oh sorry, by the way, i did it.
Each necro created by enemy was assigned to a distinct variable of unitgroup.
Whenever a unit dies i made a trigger so that the system checks if there is a necro in one of each variables AND if he's got at least the amount of mana required to cast raise dead.
If the conditions are satisfied, after 2 seconds the dying unit is replaced with a skeleton, using birth animation and raise dead special effect, just to give the impression, and the necro whose satisfied the conditions will lose the mana required.
If the necro assigned to his unitgroup dies then it gets cleared and replaced whenever a new one is trained.
It works perfectly. I guess is the only way i can do this, UNLESS someone may tell me how to create a condition which requires a unit(necros) to be in range of a dying unit(more credible in this case).
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
Easy. It's a real called Math - Distance Between Points. Through a real comparison, you check that the position of the necro to the distance of the dying unit is less than or equal to 600 (but of course by using point variables to remove location leaks).

Thanks, i will try later(but veeeeery later) since now i have already copy'n pasted all triggers through my campaign. +rep to you for this precious hint.
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
Hey shadow, your system works fine, but it seems that the function, present in the trigger via if/then/else, ignores the main triggers' conditions, which were satisfied before i wrote that new function down. Editor bug? Any way to fix it? This really was gold, damn it.
 

Attachments

  • triggers.jpg
    triggers.jpg
    254.5 KB · Views: 297

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Hey shadow, your system works fine, but it seems that the function, present in the trigger via if/then/else, ignores the main triggers' conditions, which were satisfied before i wrote that new function down. Editor bug? Any way to fix it? This really was gold, damn it.
The trigger conditions will always be evaluated before the actions. If they return false then the actions never even run. Hence if anything in the action block runs it means the trigger conditions must have returned true. As such what you are saying does not make any sense.

You can look at the resulting JASS code (which the GUI produces when you save) to see what happens more clearly.

Not all player slots have tactical AI for their abilities. Neutral Hostile has it on by default. Players only have it if they are set to computer (open or left does not count). I think Neutral Passive and other Neutral players do not run Tactical AI but I am unsure.
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
Thank you Dr for the answer. The reason i'm saying that is because regardless of the condition "triggering unit is undead equal to false", the function will still raise skeletons from dying skeletons.

EDIT: i now think why this is happening. Maybe "Or - Any conditions are true" as a condition overrides "triggering unit is undead equal to false", which is included in it? I shall try with "And - All conditions are true".

EDIT: I confirm now that everything just works F-A-N-T-A-S-T-I-C-L-Y! I'm so happy!!
 
Last edited:
Level 12
Joined
May 22, 2015
Messages
1,051
Thank you Dr for the answer. The reason i'm saying that is because regardless of the condition "triggering unit is undead equal to false", the function will still raise skeletons from dying skeletons.

EDIT: i now think why this is happening. Maybe "Or - Any conditions are true" as a condition overrides "triggering unit is undead equal to false", which is included in it? I shall try with "And - All conditions are true".

EDIT: I confirm now that everything just works F-A-N-T-A-S-T-I-C-L-Y! I'm so happy!!

Or - Any conditions are true

This means that all of them would have to be false in order for it to not pass. This means that the unit would have to be: Summoned, Undead, A structure, Mechanical - all at the same time - in order for the trigger to not run. You probably want that to be "And". The default is "And", so you can just take them out of the "Or" and it will work where the unit has to not be any of those classifications.
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
Or - Any conditions are true

This means that all of them would have to be false in order for it to not pass. This means that the unit would have to be: Summoned, Undead, A structure, Mechanical - all at the same time - in order for the trigger to not run. You probably want that to be "And". The default is "And", so you can just take them out of the "Or" and it will work where the unit has to not be any of those classifications.

That's what i said and did, in fact.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Sorry, I was just trying to explain what was happening here:
Maybe "Or - Any conditions are true" as a condition overrides "triggering unit is undead equal to false"
It is not overriding "triggering unit is undead equal to false", it is just evaluating the condition differently than how you want it to. I was just trying to help make it clear why it didn't work.
 
Level 12
Joined
May 22, 2015
Messages
1,051
I was more pointing out the reasoning :p It felt like you didn't understand what "Or - Any conditions are true" was doing. I don't know if that was the case. Not trying to be rude.
 
Status
Not open for further replies.
Top