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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top