HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Modifying the SLK Files

04-27-2004, 12:32 PM#1
Loknar
I've been wondering for a little while now what the best way to give a unit specific spell immunity (eg immunity to fire, so Flame Strike, Rain of Fire, Firebolt etc don't harm it), and wondered how easy it would be to edit the .SLK files. There's more information HERE at the SA Mods forums, but here it is in brief:

1. Create 2 new columns in the AbilityData.slk file, called Spell Type and Spell Resistance.
2. If a unit has an ability with Spell Resistance = type of spell harming it, then no damage is done to the unit.
3. Any old thing can be written into the 2 columns, the game should just match them up (Type = Fire,Hero then Resistance = Type OR Hero will work, for example).

Now I'm a 100% newbie to JASS, but over at SA Mods they've been wondering about whether the Meta .SLK files need to be used etc - it's a little over my head so click HERE to see what they're discussing.

Needless to say a system like this, whether it uses SLK files, JASS or something else, would be a boon to modders out there - but can it be done, and if so, how?
04-27-2004, 01:44 PM#2
AIAndy
I am pretty sure there is no way to do such things by changing slks.
The only thing you can do is trigger that behavior. To do that I suggest making a table with every spell in it and the corresponding 4-letter-code of a spell resistance which should be a dummy ability. Use the precompiler to turn that table into JASS code (best fill gamecache with it). Then you could catch if an ability is cast on a specific unit and if the target unit has the corresponding resistance then you prevent the ability from being cast or let it make 0 damage or something. Of course that does not do anything about AOE spells. All in all such a system could be made but you'd have to make the spells work together with that system.
04-27-2004, 02:53 PM#3
demonicgnoll
could you say it in a way i would understand?
i not much of a editor
04-27-2004, 02:55 PM#4
Cubasis
MetaData slk files are not read by WC3... they are solely a data-setup that WE reads, and uses to set up the different fields in the object editor. You can neither add a column/row there, nor can you add your own field into the normal slk's and expect it to do something with it. WE atleast will complain/lock-up about it (well, atleast the last time I made this kind of error while messing with the slk's, that happened).

And there would be no way for the JASS/Engine to read those kind of values...nor know what they do, in what format they are, etc. One can't create a JASS function that directly accesses something in-game except using a pre-defined Jass "NATIVE". The natives are all defined in common.j and are coded into game.dll most likely. Thus, to get data out of a slk file like that, there'd have to be a native for us to use, which there isn't...I mean, we don't even have any real natives to get the propper damage, model, icon etc from a slk/unit.

So...all these discussions are quite dreamy, and can only be done by emulating the whole thing with JASS and the couple of natives that we get. AIAndy already gave you a hint of how you could do it.

Another thing i'm doing at the moment to succeed in this kind of stuff is to use the classifications that blizzard added in 1.15. It really depends on the map type, and if you already are using these. But in my case, I have a RPG, and a some heros have skills that affect dead units. Now, as this is a co-op RPG, I don't want people to fight over the dead units. So, one of the heros has this loot-corpse skill, and I limit it to only work on units that "he" kills...by making it only target dead ancients...and then I just sense when he kills something, and give the dead monster the ancient classification. I then also make the other heros corpse-affecting skill not affect dead ancients.

So...how could this help you?...well, just give the different units different classifications...and then code the spells with triggers, reacting different based on the classification of the target.

Anyways.

Cubasis
04-27-2004, 05:12 PM#5
demonicgnoll
whats Jass?
04-27-2004, 07:46 PM#6
Loknar
Programming language used almost exclusively (if not completely exclusively) in Warcraft 3. Just convert a trigger to custom text in the World Editor trigger editor to see some JASS code.
05-01-2004, 02:02 AM#7
Doomsberg
Now i'm most likely wrong...but...

Couldn't someone add a unit classification in, like undead, or mechanical or something else, like add in fire, and water etc. Then build some new spells like death coil which do damage/give health to different types of elements.

That way we could have fire moves giving health to fire types.

I doubt it would work but its just a thought.