Skip to content

Scripting an in game kit change

GreenerGreener Member Posts: 430
edited April 2016 in General Modding
I'm trying to create a modified "fallen" effect for my kensai kit when the parties reputation drops below 6, with the help of Jarno Mikkola over at gibberlings3 I've come up with the following:

IF
Kit(Player1,KENSAI)
ReputationLT(Player1,6)
Global(“FallenKensai”,”GLOBAL",0)
THEN
RESPONSE #100
SetGlobal(“FallenKensai”,”GLOBAL",1)
ActionOverride(Player1,AddKit(TRUECLASS))
Wait(5)
PlaySound("REPDOWN")
END

IF
Kit(Player2,KENSAI)
ReputationLT(Player1,6)
Global(“FallenKensai”,”GLOBAL",0)
THEN
RESPONSE #100
SetGlobal(“FallenKensai”,”GLOBAL",1)
ActionOverride(Player2,AddKit(TRUECLASS))
Wait(5)
PlaySound("REPDOWN")
END

ect...

Unfortunately one custom innate ability remains and isn't removed by the kit change, and I can't figure out why that one of eleven custom abilities remains, thoughts?

Comments

  • jethrojethro Member Posts: 81
    I can't answer your question, but I will point out 2 problems that I see:

    1. The global "FallenKensai" is the same global for player 1 as for player2, which means only one of them can fall in any game.
    2. Apparently the Rep of Player1 determines if Player2 becomes fallen or not. Maybe all reputation is housed by player1 in the game, but if not this seems like an issue.
  • kjeronkjeron Member Posts: 2,367
    @Greener
    Does this custom ability have an 8-character filename?
  • GreenerGreener Member Posts: 430
    kjeron said:

    @Greener
    Does this custom ability have an 8-character filename?

    Thank you for the response, I have double checked (GA_KENSAI11.spl) it does...
  • GreenerGreener Member Posts: 430
    jethro said:

    I can't answer your question, but I will point out 2 problems that I see:

    1. The global "FallenKensai" is the same global for player 1 as for player2, which means only one of them can fall in any game.
    2. Apparently the Rep of Player1 determines if Player2 becomes fallen or not. Maybe all reputation is housed by player1 in the game, but if not this seems like an issue.

    Thank you, I will investigate
  • kjeronkjeron Member Posts: 2,367
    Greener said:

    kjeron said:

    @Greener
    Does this custom ability have an 8-character filename?

    Thank you for the response, I have double checked (GA_KENSAI11.spl) it does...
    That's the problem then, the internal code for most spell-removal effects treats 8-character file-names differently for unknown reasons - it only remove copies of the spell that have already been used up for the day.

    So if you had 5x per day of that ability, used two of them, then ran the AddKit, 2 of them would be permanently removed, while the other 3 that haven't be cast yet would remain.
  • [Deleted User][Deleted User] Posts: 0
    edited April 2016
    The user and all related content has been deleted.
  • GreenerGreener Member Posts: 430

    So in other words, just change the name of the ability to KNSAI11.SPL, or something like that with only 7 letters, and it will work fine. :wink:

    EDIT - also, you shouldn't be using stuff like "kensai11" for spell names anyway, it's just asking for trouble. Get yourself a modding prefix!!

    http://forums.blackwyrmlair.net/index.php?showtopic=113

    Or even if you don't hear back about officially getting one, at least *USE* a prefix, that isn't already listed here:
    http://www.blackwyrmlair.net/prefixes/

    For instance, there is already a modder there who is using "KE" as a prefix for all of his/her files... if a player installs your mod and one of their mods, it will create problems.

    Thank you, I've registered OR as my prefix
Sign In or Register to comment.