Why and where does this leak? +rep

TheDarkBoy

New Member
Reaction score
3
I have made a trigger that removes and adds a spell book. It works fine besides that the spell book doesnt contains all the spells or misplaces them.
Fire Magicians Spell Book[level1] Contains the ability "Molten Shield (Level 1)"
Fire Magicians Spell Book[level4] Contains the abilities "Molten Shield (Level 1)", "Pillar of Fire"
Fire Magicians Spell Book[level5] Contains the abilities "Molten Shield (Level 2)", "Pillar of Fire"
Fire Magicians Spell Book[level8] Contains the abilities "Molten Shield (Level 2)", "Pillar of Fire", "Flaming Wrath"
Fire Magicians Spell Book[level10] Contains the abilities "Molten Shield (Level 3)", "Pillar of Fire", "Flaming Wrath"
Fire Magicians Spell Book[level12] Contains the abilities "Molten Shield (Level 3)", "Pillar of Fire", "Flaming Wrath", "Meteor"
Code:
Fire Magicians Spell Book
    Events
        Unit - A unit Gains a level
    Conditions
        (Unit-type of (Triggering unit)) Equal to Fire Magician
        ((Triggering unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (Leveling Hero)) Equal to 4
            Then - Actions
                Unit - Remove Fire Magician Spell Book (Level 1) from (Triggering unit)
                Unit - Add Fire Magician Spell Book (Level 4) to (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (Leveling Hero)) Equal to 5
            Then - Actions
                Unit - Remove Fire Magician Spell Book (Level 4) from (Triggering unit)
                Unit - Add Fire Magician Spell Book (Level 5) to (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (Leveling Hero)) Equal to 8
            Then - Actions
                Unit - Remove Fire Magician Spell Book (Level 5) from (Triggering unit)
                Unit - Add Fire Magician Spell Book (Level 8) to (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (Leveling Hero)) Equal to 10
            Then - Actions
                Unit - Remove Fire Magician Spell Book (Level 8) from (Triggering unit)
                Unit - Add Fire Magician Spell Book (Level 10) to (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (Leveling Hero)) Equal to 12
            Then - Actions
                Unit - Remove Fire Magician Spell Book (Level 10) from (Triggering unit)
                Unit - Add Fire Magician Spell Book (Level 12) to (Triggering unit)
            Else - Actions
Not sure why this is leaking, but of some reason it is. Any ideas? (I have tried to change the button positions and spell types) Thanks.
EDIT: Thank you xAnaMorphine for the trigger :)
 

Kazuga

Let the game begin...
Reaction score
110
It doesn't leak. All you do is add/remove abilities to the triggering unit. Leaks is lost data of for example: Locations, unit groups, units, special effects. Locations is the most common leak. (Also known as points.)
 

Tyman2007

Ya Rly >.
Reaction score
74
umm.. just use 1 spell book with all spells and use player - disable/enable ability

Might decrease size considering there's only 1 spellbook instead of 6. Also make sure that the data - minimum spells are the amount of spells you have in the spellbook.

Spellbooks pick random spells inside the book, it has a minimum, if there's 12 spells there's a chance that all 12 can be there, if the minimum is 12 then all spells would be there.

I found this out while creating my RPG.
 

TheDarkBoy

New Member
Reaction score
3
It doesn't leak. All you do is add/remove abilities to the triggering unit. Leaks is lost data of for example: Locations, unit groups, units, special effects. Locations is the most common leak. (Also known as points.)

Okaay... then it fails somewhere and i have no idea where. it should work, but it doesnt.
 

TheDarkBoy

New Member
Reaction score
3
umm.. just use 1 spell book with all spells and use player - disable/enable ability

Might decrease size considering there's only 1 spellbook instead of 6. Also make sure that the data - minimum spells are the amount of spells you have in the spellbook.

Spellbooks pick random spells inside the book, it has a minimum, if there's 12 spells there's a chance that all 12 can be there, if the minimum is 12 then all spells would be there.

I found this out while creating my RPG.

That may just do the trick :). Thanks alot.
But. Where can i find "Player - Disable/Enable Ability". Is it a trigger, or is it something i have to edit in the spell book as an ability?
EDIT: Thanks again for your comment. Instead of disabling and such, i just changed the max and minimum number of spells, as you said. And it worked! Thank you so much!! :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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