Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Removing an innate ability from a creature

KalindorKalindor Member Posts: 51
I am making a custom kit and I want the player to obtain a one-time-use ability upon levelling up. I've successfully given them the ability in the kit's CLAB file, but am having trouble removing it. I placed an opcode 172 (remove spell) as a casting effect of the spell with the spell's filename indicated in the resource field, but it still comes back after I rest. I saw that there was a bug with 8-character-long filenames and this opcode, but my spell file's name is only 7 characters. Please let me know if you have any insight. Thanks!


  • subtledoctorsubtledoctor Member Posts: 11,211
    edited October 2015
    Make the 172 effect a global effect (in NI's parlance), not an effect within the spell ability.

    E.g. for my at-will Entangle cantrip, I have a global effect with 172 targeted at 'self' to remove itself, a global effect with 171 targeted at 'self' to add the ability again, and then a spell ability containing the normal spell effects (126, 154 etc.) targeted at 'preset target.' For a single-fire ability omit the 171 effect, of course.

    If you want to see/adapt a working spell that does this already, download my 'Might & Guile' mod and look at the Kensai ability to choose a weapon of focus: might_and_guile/kensai/d5_kenfo.spl

    Incidentally in this case filename length does *not* matter (I think), since the 172 effect will operate on the spell while it is not memorized.

  • KalindorKalindor Member Posts: 51
    That worked like a charm, thank you subtledoctor. I was not aware that the "global effects" feature existed and that it was distinct from the spell effects. Obviously there is different functionality. What kind of uses do global effects have for modding? Thanks.

  • argent77argent77 Member Posts: 2,764
    Global effects are executed immediately and therefore cannot be interrupted. For example, the Pocket Plane ability (SPIN649.SPL) uses it restore itself. It's also used in several instances to set global variables, which can be picked up in combat scripts, and so on.

Sign In or Register to comment.