Menu
 

[MUA1] Tutorial on Special Affecters

Started by Outsider, December 01, 2014, 11:58PM

Previous topic - Next topic
December 01, 2014, 11:58PM Last Edit: August 09, 2022, 07:27AM by Outsider
What's good? It's the mysterious Outsider, back to give you a crash course on how to use an innovative feature called a special affecter. I use these all the time in my creations. Take notes.

HISTORY
First discovered with :wolverine: Wolverine and his rage mode (the first special affecter), this feature gave Logan access to enhanced powers, that made him stand out from everyone else. From there, some modders such as myself wondered how this system could be featured in other mods...

DEFINITION
A special affecter is a requirement that can be placed in various ways. It is meant to lock down special features of a character unless said requirement has been met.

LECTURE
The special affecter is used in the powerstyle file of your mod. There are two parts of this feature. I call it the set-up and the requirement. First, let's discuss the set-up (or for fun, the bada-bing.) It looks like this...
         affecter {
         affect_type = sum ;
         attribute = special ;
         level = 1 ;
         }

This goes in the powerup sections of boosts. See where it says "special?" You can use two special affecters in the same file, but only one of them can be named whatever you want. Wolverine called his "enraged," and it looks like this...
   FightMove {
   animenum = ea_idle1 ;
   name = rage_node ;
      trigger {
      life = %wolv_rage_time ;
      name = powerup ;
      tag = 1 ;
      time = -1 ;
         special_fx {
         bolt = Bip01 Pelvis ;
         effect = char/wolv/rage_aura ;
         fxlevel = 1 ;
         how_used = primary ;
         never_cycle = true ;
         }

         affecter {
         attribute = enraged ;
         level = 1 ;
         }


      }

      chain {
      action = idle ;
      result = idle ;
      }

   }

See? That's where it goes. So, I tend to place the set-up inside boosts that you can access at any time. You can change the special requirement by placing the set-up elsewhere. I'll use my recent mod of Groot to show you an example. With Groot (among others), one of his boosts turns him into a giant. I placed a special affecter there so that when the player activates that boost, and they become a giant, certain features are now accessible to them. For Groot, it looks like this...
   FightMove {
   aicanuse = false ;
   aitype = buffself ;
   animenum = ea_power6 ;
   icon = 5 ;
   is_power = true ;
   lockangles = true ;
   name = power6 ;
   priority = 5 ;
      require {
      cat = skill ;
      item = groot_p6 ;
      level = 1 ;
      }

      trigger {
      bolt = Bip01 L Hand ;
      effect = char/warbird/p7_power ;
      fxlevel = 1 ;
      name = effect_sound ;
      sound = char/groot_m/p6_power ;
      time = 0.25 ;
      }

      trigger {
      bolt = Bip01 R Hand ;
      effect = char/warbird/p7_power ;
      fxlevel = 1 ;
      name = effect ;
      time = 0.25 ;
      }

      trigger {
      life = %groot_p6_lif ;
      name = powerup ;
      powerusage = %groot_p6_pwr ;
      time = 0.5 ;
         affecter {
         affect_type = scale ;
         attribute = def_damage ;
         level = %groot_p6_def ;
         }

         affecter {
         affect_type = scale ;
         attribute = atk_damage ;
         level = %groot_p6_dmg ;
         }

         affecter {
         attribute = scale_factor ;
         level = 1.0 ;
         }

         affecter {
         affect_type = sum ;
         attribute = sprout ;
         level = 1 ;
         }


         affecter {
         affect_type = scale ;
         attribute = move ;
         level = 0.75 ;
         }

         affecter {
         affect_type = scale ;
         attribute = no_iceshell ;
         level = 0 ;
         }

      }

      chain {
      action = Idle ;
      result = idle ;
      }

   }
In Groot's case, I called it "Sprout." The effect is the same no matter what number it is. Anyway, the code above tells the game "When the player activates this boost, he/she has met the special requirement."

That now brings me to the second part of the special affecter, the requirement (or for fun, the bada-boom). It looks like this...
      require {
      cat = affecter ;
      item = special ;
      level = 1 ;
      }

Notice the first thing it says is "require?" That leads back to the definition. It's a special requirement set to lock down features until the player's done something to fulfill that requirement. Again, the word "special" is only important if you want to use two special affecters. But for just one, it doesn't matter -- just rename it to whatever you renamed the set-up as.
So, as not to confuse you, let's stick with the Groot example. When the player has activated the boost (fulfilling the special requirement), everything under the special affecter becomes accessible. In Groot's case, as a giant, I made it so that the idle position (which is him doing nothing in the game), instead of the default attack buttons, I've placed special powers he normally wouldn't have access to. Look at this...
   FightMove {
   animenum = ea_idle1 ;
   handler = ch_idle ;
   lockchaining = false ;
   name = idle ;
   noncombat = true ;
      require {
      cat = affecter ;
      item = sprout ;
      level = 1 ;
      }


      chain {
      action = walk ;
      result = walk ;
      }

      chain {
      action = run ;
      result = run ;
      }

      chain {
      action = sprint ;
      result = sprint ;
      }

      chain {
      action = strafeleft ;
      result = strafeleft ;
      }

      chain {
      action = straferight ;
      result = straferight ;
      }

      chain {
      action = advance ;
      result = advance ;
      }

      chain {
      action = retreat ;
      result = retreat ;
      }

      chain {
      action = guard ;
      result = guarddecide ;
      }

      chain {
      action = attack ;
      result = attacktrip2 ;
      }

      chain {
      action = smash ;
      result = giantpunch ;
      }

      chain {
      action = groundattack ;
      result = groundattack ;
      }

      chain {
      action = move ;
      result = jump ;
      }

      chain {
      action = special ;
      result = boredloop ;
      }

      chain {
      action = powers ;
      result = powers ;
      }

      chain {
      action = blocking ;
      result = blocking ;
      }

   }

Notice that the requirement is there? Now when Groot becomes a giant, his idle is different. By pressing attack, he can now just trip an enemy without doing a combo. And if he presses smash, instead of doing the default knockdown, he will do a giantpunch (which you can set up as a power). Any "FightMove" with that same requirement becomes active, such as that giantpunch. But when the boost's time has elapsed, he loses those abilities and returns to default idle position.
Another example? I mentioned Wolverine earlier. All of his rage powers have the requirement "enraged" under it, like this...
      require {
      cat = affecter ;
      item = enraged ;
      level = 1 ;
      }

Now, I won't go into Wolverine's rage system in this tutorial just yet. It's a bit complicated, and I don't want to confuse anyone. It's good to practice the basics first. Anyway, this is telling the computer, "When the player's rage meter becomes full, Wolverine is enraged and the special requirement has been met." Then you had access to his all of rage powers. But when it's gone, you don't have access to them anymore.

LIMIT
As mentioned before, you should definitely note is that you can only use TWO special affecters in the powerstyle file of each mod, and one of them MUST stay named as "special." Basically, you can use one stayed as "special," and one that can renamed to whatever you want. When I was creating Black Knight, I attempted to use three renamed special affecters (one for each of his three swords) in his powerstyle file, renaming and renumbering each of them differently. But, in the game, they still took it as one. You can't rename more than one -- it won't work. With the two, you can place one of them to a talents file (i.e. ability), and the other to a powerstyle file. Want to see what I mean? Look below.

CREATIVE MODDING
So that you've learned what it does and where it goes, you probably want to ask me: What if you want to use the special affecter in other ways? What if you don't want it to have a time limit? Is it possible to connect it to certain skin/outfit? Bada-bing, bada-boom. No problem. I'll use my Lara Croft mod as an example. With Miss Tomb Raider, I wanted her evil doppleganger to have different features from the regular. So at her talents file, I put this...
   talent {
   descname = Lara's Shadow ;
   description = The Doppelganger moves 15% faster, inflicts 7% more melee $DMG, has ^Might, +9 $DR, and has access to Eitr Blast. ;
   icon = 10 ;
   icon_texture = textures/ui/talent_icons.png ;
   name = lara_shadow ;
   skin = 4 ;
   type = ability ;
      level {
      count = 9 ;
         powerup {
         life = -1 ;
            affecter {
            affect_type = scale ;
            attribute = move ;
            level = 1.15 ;
            }

            affecter {
            attribute = defense_rating ;
            level = 9 ;
            }

            affecter {
            attribute = might_heaviness ;
            level = 2 ;
            }

            affecter {
            attribute = might_structure ;
            level = 1 ;
            }

            affecter {
            affect_type = sum ;
            attribute = shadow ;
            level = 8 ;
            }


            affecter {
            affect_type = scale ;
            attribute = atk_damage ;
            level = 1.07 ;
            scope_non_powers = true ;
            }

         }

      }

   }
The special affecter here is called "shadow." Notice that I placed it to a certain skin? I didn't know that was possible, but I discovered it. (I think it only worked because I put it down as an ability) "Skin = 4" means that the fifth skin in her herostat is connected. (They count 0 as the first skin.) So, here I am telling the game, "When the player picks Lara's 5th skin - the evil doppleganger, the special requirement has been met." Now the powerup you see above that is set just for that skin is now forever active as long as you're playing with that costume.
But while that special affecter was set-up in the talents file, the requirement can be in the powerstyle file and it won't clash -- the game won't think it's the same one. Lara uses a 2nd special affecter that was set-up in the powerstyle file, which happens when her Mjolnir boost is activated. (Yes, Lara Croft held Mjolnir - Thor's hammer in the video game Tomb Raider: Underworld.) It looks like this...
   FightMove {
   animenum = ea_levelup ;
   icon = 8 ;
   is_power = true ;
   lockangles = true ;
   name = power8 ;
   priority = 5 ;
      require {
      cat = skill ;
      item = lara_p8 ;
      level = 1 ;
      }

      trigger {
      bolt = Bip01 R Hand ;
      bolt2 = Bip01 L Hand ;
      effect = char/thor/p3_charge ;
      fxlevel = 2 ;
      name = effect_sound ;
      sound = char/lara_m/p3_impact ;
      time = 0.25 ;
      }

      trigger {
      name = hammer_bolton ;
      time = 0.2 ;
      }

      trigger {
      bolt = Bip01 Pelvis ;
      effect = char/lara/thor_flash ;
      fxlevel = 2 ;
      name = effect ;
      time = 0.25 ;
      }

      trigger {
      life = %lara_p8_life ;
      name = powerup ;
      powerusage = %lara_p8_pwr ;
      time = 0.25 ;
         affecter {
         affect_type = sum ;
         attribute = special ;
         level = 5 ;
         }


         special_fx {
         bolt = Bip01 L Hand ;
         effect = char/lara/thor_flash ;
         fxlevel = 1 ;
         name = effect ;
         time = 0.25 ;
         }

         special_fx {
         bolt = Bip01 R Hand ;
         effect = char/lara/thor_flash ;
         fxlevel = 1 ;
         name = effect ;
         time = 0.25 ;
         }

         special_fx {
         bolt = Bip01 Pelvis ;
         effect = char/lara/thor_flash ;
         fxlevel = 1 ;
         name = effect ;
         time = 0.25 ;
         }

         affecter {
         affect_type = scale ;
         attribute = def_damage ;
         level = %lara_p8_dmg ;
         }

         affecter {
         affect_type = scale ;
         attribute = def_damage_scope ;
         damagetype = dmg_electricity ;
         level = 0 ;
         }

         powerup {
         class = add_attack ;
         damagepercent = %lara_p8_pct ;
         damagetype = dmg_electricity ;
         life = -1 ;
            affecter {
            attribute = powerup_scope ;
               scope {
               scope_attack = punch ;
               }

               scope {
               scope_attack = kick ;
               }

            }

         }

      }

      chain {
      action = idle ;
      result = idle ;
      }

   }

As you can see, I just kept that one "special," which is how I was able to use two. But now, any FightMove that is under the "special" requirement will be accessible, but STILL not the anything under the "shadow" requirement, as I set it where you must play as Lara's evil doppleganger to unlock that. As I explained eariler with Black Knight, you can't have two or more renamed set-ups in the same file -- the game will think it's the same one.




NEW DISCOVERY: Remember the "level = 1" part? A member here named Bloodymares discovered that the level number means something as well. The game looks for a minimum rather than the number itself. So, if you set one power with the requirement level = 1, and another power at level = 7, the level 1 cannot access any move higher than 1, while moves at level 7 can access all moves at 7 and lower. The higher the level number, the more you can access.

He also discovered that special affecters can be made with other powerups, such as "item = invisible." If a character is invisible, they can then access any powers or skills that have that the same requirement. This can be done with other in-game terms, but some are tricky to perform it on. I have not tested these myself to confirm, however.


 

I may go into detail on Wolverine's rage system another time. But for now, bada-bing, bada-boom. Done. Hope this tutorial helps.


Thank you, this is an excellent tutorial which should be very useful to more in-depth modders as well as basic tinkerers!

Can you still clarify one thing to me? You write about the limit of one special affecter per file, which you encountered while working on the Black Knight and the special affecters of his three swords. You say you can put one affecter in the talent, one in the powerstyle, for -two- different affecters. But you got Black Knight's -three- swords to work, right? Or do those sword powers work differently?

Quote from: Hobgoblin on December 02, 2014, 03:14AM
Thank you, this is an excellent tutorial which should be very useful to more in-depth modders as well as basic tinkerers!

Can you still clarify one thing to me? You write about the limit of one special affecter per file, which you encountered while working on the Black Knight and the special affecters of his three swords. You say you can put one affecter in the talent, one in the powerstyle, for -two- different affecters. But you got Black Knight's -three- swords to work, right? Or do those sword powers work differently?

It works differently. Black Knight doesn't use a special affecter, as I couldn't get more than one to work on the same file. With that mod, I had to create a system of alternating powerups. When one permanent boost (one sword) is used, the other two sword powerups are cancelled out. I usually have to create different systems to get mods to do what I want -- provides a challenge.


Very nice, so just to clarify a few things. Can I use this to add in effects or whatever to basic moves when a boost is active? Is it possible to use it so that two boosts could access the same visual powerup, while having their own unique mechanics? And can I use this to block talents like flight or might and only have them activate while the boost is active?

Quote from: Techon 7 on December 02, 2014, 01:12PM
Very nice, so just to clarify a few things. Can I use this to add in effects or whatever to basic moves when a boost is active?

Yes, you can. Besides the normal powerup effects, if you want to add effects to a basic move (i.e popup attack) or add exclusive powers to it, all you have to do is add the special requirement to it, and place it in the powerstyle file -- separate from fightstyle_default.

Quote from: Techon 7 on December 02, 2014, 01:12PM
Is it possible to use it so that two boosts could access the same visual powerup, while having their own unique mechanics?

Yes, it is. You just have to place one set-up as an ability, thus having two special affecters. Then you can place both requirements on the visual powerups, but only one on the different features. I haven't tried two requirements on the same move, but feel free to experiment. It shouldn't be a problem, though.

Quote from: Techon 7 on December 02, 2014, 01:12PM
And can I use this to block talents like flight or might and only have them activate while the boost is active?

Yes, you can. I've done it with Lara Croft. Normally, she doesn't have might. But I've made it so that her evil doppleganger does. Take a look at the text in bold below. Add the bold text below to any boost for a non-might character to have might. As for Flight, I haven't tried that, but I believe if you (1) take the flight part off of the bottom section of the herostat, (2) add flight to the boost powerup, and (3) place a special requirement on the double jump move in the powerstyle file, it should lock down the flight until the special requirement has been met.

talent {
   descname = Lara's Shadow ;
   description = The Doppelganger moves 15% faster, inflicts 7% more melee $DMG, has ^Might, +9 $DR, and has access to Eitr Blast. ;
   icon = 10 ;
   icon_texture = textures/ui/talent_icons.png ;
   name = lara_shadow ;
   skin = 4 ;
   type = ability ;
      level {
      count = 9 ;
         powerup {
         life = -1 ;
            affecter {
            affect_type = scale ;
            attribute = move ;
            level = 1.15 ;
            }

            affecter {
            attribute = defense_rating ;
            level = 9 ;
            }

            affecter {
            attribute = might_heaviness ;
            level = 2 ;
            }


            affecter {
            attribute = might_structure ;
            level = 1 ;
            }


            affecter {
            affect_type = sum ;
            attribute = shadow ;
            level = 8 ;
            }

            affecter {
            affect_type = scale ;
            attribute = atk_damage ;
            level = 1.07 ;
            scope_non_powers = true ;
            }

         }

      }

   }


Quote from: Outsider on December 03, 2014, 07:11PM
Yes, it is. You just have to place one set-up as an ability, thus having two special affecters. Then you can place both requirements on the visual powerups, but only one on the different features. I haven't tried two requirements on the same move, but feel free to experiment. It shouldn't be a problem, though.

Thanks for clarifying.  What I think I meant to describe was can I just reference the visual effect one time, while the two boosts that use it each have their own traits? (I.E. one boost buffs defense while the other buffs damage)
So both boosts trigger the same visual affecter, but the boosts themselves determine what's buffed.


Quote from: Techon 7 on December 03, 2014, 11:08PM
Thanks for clarifying.  What I think I meant to describe was can I just reference the visual effect one time, while the two boosts that use it each have their own traits? (I.E. one boost buffs defense while the other buffs damage)
So both boosts trigger the same visual affecter, but the boosts themselves determine what's buffed.

I believe that's possible too, though a special affecter isn't needed for that. Under Storm's powerstyle file for example, you'll see a visual effect called "electrified." Although that's meant for if someone gets hit by Storm's electricity, it's still a visual effect that's only described once. From there, only a single line is placed.
   event {
   inherit = powerup ;
   life = 2 ;
   name = electrified ;
   no_stack = true ;
      special_fx {
      bolt = Bip01 L Hand ;
      bolt2 = Bip01 Neck ;
      effect = char/storm/special_electrified ;
      fxlevel = 1 ;
      how_used = primary ;
      never_cycle = true ;
      }

      special_fx {
      bolt = Bip01 R Hand ;
      bolt2 = Bip01 Neck ;
      effect = char/storm/special_electrified ;
      fxlevel = 1 ;
      how_used = primary ;
      never_cycle = true ;
      }

      special_fx {
      bolt = Bip01 L Toe0 ;
      bolt2 = Bip01 Pelvis ;
      effect = char/storm/special_electrified ;
      fxlevel = 1 ;
      how_used = primary ;
      never_cycle = true ;
      }

      special_fx {
      bolt = Bip01 R Toe0 ;
      bolt2 = Bip01 Pelvis ;
      effect = char/storm/special_electrified ;
      fxlevel = 1 ;
      how_used = primary ;
      never_cycle = true ;
      }

   }

So in that same way, you can place the visual effects you want, length of time, etc, and name it whatever you want. Place it anywhere in the powerstyle file. Then at the boosts, just add this...
      trigger {
      name = electrified ;
      time = -1 ;
      }

Both boosts should then have the same visual effects while the boosts maintain what differs them.


That might work, but the visual I'm planning would need some way so that the effect that displays with attack_light is different than jump. So I think the special affecter might be the way to go. Thanks for the tutorial! I hope it helps with some of my projects.

Not a problem.

DISCOVERY FOUND: I just found out that you can create TWO special affecters in they powerstyle file, as long as one of them ISN'T renamed. (In other words, one of them must remain called "special.") That explains why Lara Croft worked, and I just used this method on boosting Arcade. Going to edit the tutorial now.


My latest discovery: You can use almost any "normal" affecter in the same way to set up requirements for special moves. If your character turns invisible, you can use requirement with "item" = "invisible" and it'll work without any confusion with a special affecter. Even tested successfully with such affecters as "defense_ratings" and "def_trip". defense_ratings is a tricky one, because its level is upgradable in the passives, but it can be used as a requirement unlocker if your mod doesn't use Defense for a passive. The obscure "def_trip" or def_pain" can be safely used though if you need to have more affecters to set up special fightmoves.

Additionally, you can still use multiple special affecters as long as you realize that the one with higher-level value will access the fightmoves with lower-level requirements. Can be used for a custom progression, where a powerup with a higher level of special affecter unlocks more features that are locked away from low-level affecters. So if you have a fightmove with requirement "item = special", "level = 5", then affecter that sets "attribute = special", "level = 1" won't access that fightmove, but it will unlock the fightmove with level 1 requirement. And vice versa, attribute with level = 5 will access all fightmoves with level below 5 as well. Some fightmove chains can be coded in a way so each fightmove is locked behind a one-level higher affecter, and you'd need to level-up something else or activate a certain boost to access the full "combo".