Difficulty with spell immunity.

ThranDeuL

New Member
Reaction score
1
First of all, i use the regular warcraft 3 world editor and have not much experience with the spell immunity ability.

What i do know is that it is a spell you cannot edit in the editor at all, for instance i can't change it to tolerate some spells and some not.

Now what the problem is, is that the ability does not function anymore.
In a map ive been working long on, i've given a unit the ability "spell immunity" but it still gets affected by ALL spells.
It does not matter what type of spell immunity i give to him (neutral hostile or the one from the night elf abilities).

To test things out a little bit, i created a new normal map and gave a unit spell immunity. Then copy pasted an ability of my other map to this one and tested if i could use it on him.
The result was that the unit was immune for the ability.

So this is the deal:
Somehow all the "Spell immunity" abilities got messed up within the editor but only on this certain map.
My question is the following; how do i reset the spell immunity ability?
Because i certainly dont want to recreate a map ive been working on for over a year.
I would appreciate it if anyone could tell me how to do this?

(Correct me if ive posted something wrong)

Edit: Forgot to mention there are no triggers where i changed something with spell immunity.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Did you try copy-pasting the Spell Immunity that works from your other map into your 1 year old map?
 

Sim

Forum Administrator
Staff member
Reaction score
534
Look in Advanced - Gameplay constants.

In the Gameplay - Magic immunes resist...

What are the 4 options displaying?
 

NeuroToxin

New Member
Reaction score
46
Did you use triggers? if you didnt, and its not working, try something like this
You just have to make a buff for the spell immunity
Trigger:
  • Events
    • Unit - A unit starts the effect of an ability
    • Conditions
    • Target Unit of (Ability Being Cast) has buff Immune == to true
    • Actions
    • Order triggering unit to stop
 

ThranDeuL

New Member
Reaction score
1
Look in Advanced - Gameplay constants.

In the Gameplay - Magic immunes resist...

What are the 4 options displaying?

Well the text is grey so supposedly unedited but this is what it says:

Magic immune resist damage - True
Magic immune resist leach - False
Magic immune resist thorns - False
Magic immune resist Ultimates - False
 

ThranDeuL

New Member
Reaction score
1
Did you use triggers? if you didnt, and its not working, try something like this
You just have to make a buff for the spell immunity
Trigger:
  • Events
    • Unit - A unit starts the effect of an ability
    • Conditions
    • Target Unit of (Ability Being Cast) has buff Immune == to true
    • Actions
    • Order triggering unit to stop

First of all, ensnare and non magic abilities still work on units with the immune ability. So i will have to if,then,else them all out, and that are alot of abilities.

If there is no other way out i might eventually do that, but for now ill see if there is another awnser.
 

Sim

Forum Administrator
Staff member
Reaction score
534
> First of all, ensnare and non magic abilities still work on units with the immune ability. So i will have to if,then,else them all out, and that are alot of abilities.

Hmm, that is unless you want it otherwise. :rolleyes:

The gameplay constants display default values, that means your spell immunity abilities might have been corrupted, somehow.
 

ThranDeuL

New Member
Reaction score
1
> First of all, ensnare and non magic abilities still work on units with the immune ability. So i will have to if,then,else them all out, and that are alot of abilities.

Hmm, that is unless you want it otherwise. :rolleyes:

The gameplay constants display default values, that means your spell immunity abilities might have been corrupted, somehow.

Yes that was my initial point, but im not as experienced with corrupted abilities wich you cant change within the object editor, like spell immunity and locust.

I have no idea how to reset abilities like these to their defaults, i dont even know if there is a way to do that.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well, worth a try: Right-click on the abilities and click "Reset to default". :banghead:

If you can't, create a custom one off it and reset it to default.
 

ThranDeuL

New Member
Reaction score
1
Well, worth a try: Right-click on the abilities and click "Reset to default". :banghead:

If you can't, create a custom one off it and reset it to default.

Have done this loads of times, will do one time more for the sake of it.
But i think the game data is corrupted somehow and not the ability itself.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Try doing this then:

JASS:


Then try casting a spell on the unit.

EDIT: If you don't know how to work with JASS, use the "Custom script" Action and copy-paste this, changing whichUnit for GetTriggerUnit() or something.
 

ThranDeuL

New Member
Reaction score
1
Okay i will post the problem, maybe there is someway around it.

You know the types of maps, tree tag, sheep tag and such, where you have a worker unit that creates buildings and that unit is chased by a much more powerfull unit.

Well that unit has certain abilities i dont want him to use on the worker because they are way to powerfull, instead i want them to use them on other buildings or units that that building produces.

So the first thought was: give the worker unit spell immunity. The ability has worked before. But after a long pause of map making i reopened the map and started working on it again and now its broken.

If there is any other way to make a unit unable to be targeted by certain spells (leaving out that i will have to manually make it unable by using triggers, cause that is a hell of alot of work for 500 abilities) i would gladly use it.
 

ThranDeuL

New Member
Reaction score
1
Try doing this then:

JASS:


Then try casting a spell on the unit.

EDIT: If you don't know how to work with JASS, use the "Custom script" Action and copy-paste this, changing whichUnit for GetTriggerUnit() or something.

Im not really familiar with Custom script nor JASS so i dont understand it much. With a bit of logic i can see that i will have to put the raw name of the unit somewhere. I tried using it like this:
GetTriggerUnit(namex)
Getnamex()

But on neither scenarios did the trigger function.
So i just tried it plane and simple like you originially said like this:

"call UnitAddType(GetTriggerUnit(), UNIT_TYPE_MAGIC_IMMUNE)"
on a initialization event in a trigger with a custom script action.

It had no efect if used the custom script exactly like that.
So what did i miss? Do i input the name somewhere else or is it something entirely different?
 

Sim

Forum Administrator
Staff member
Reaction score
534
> It had no efect if i the custom script is exactly like that.

It shouldn't have either.

For testing purposes, place a builder/worker on the map.

Now, in the trigger editor, find any function that selects precisely that builder, convert the trigger to custom script, and save its raw reference somewhere. (Should be in the form gg_unit_xxxxx)

Now, place that custom script in the Map Initialization trigger, and replace "whichUnit" with the raw code reference.
 

ThranDeuL

New Member
Reaction score
1
> It had no efect if i the custom script is exactly like that.

It shouldn't have either.

For testing purposes, place a builder/worker on the map.

Now, in the trigger editor, find any function that selects precisely that builder, convert the trigger to custom script, and save its raw reference somewhere. (Should be in the form gg_unit_xxxxx)

Now, place that custom script in the Map Initialization trigger, and replace "whichUnit" with the raw code reference.

Okay i understand, im gonna test it now.
If it works, what is the code for last created unit?

Edit: The Custom script is this: call KillUnit( gg_unit_h01Q_0307 )
Now should i put i also put space between ( ) 's or not?
So in short:
call UnitAddType( gg_unit_h01Q_0307 , UNIT_TYPE_MAGIC_IMMUNE)
call UnitAddType(gg_unit_h01Q_0307, UNIT_TYPE_MAGIC_IMMUNE)
call UnitAddType( gg_unit_h01Q_0307, UNIT_TYPE_MAGIC_IMMUNE )
 

Sim

Forum Administrator
Staff member
Reaction score
534
bj_lastCreatedUnit

Actually, you're better off just creating the unit in the trigger editor at map initialization, using the code I provided with bj_lastCreatedUnit, and then try casting a spell on it.

Simpler. :)
 

ThranDeuL

New Member
Reaction score
1
Nope, no changes so far
Trigger:
  • Test
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Create 1 Peasant for Player 10 (Light Blue) at (Center of Region <gen>) facing Default building facing degrees
      • Custom script: call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_MAGIC_IMMUNE)



doesnt work.
 

Sim

Forum Administrator
Staff member
Reaction score
534
You actually created it at map init and then tried an ability on it?

Just to be sure, show me the trigger.

Well, seems like there's really nothing working. The whole magic immunity is likely corrupted. : /

How many different abilities can the builders and workers get casted at?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top