MZ - Cae_Tweaks - lots of little features

● ARCHIVED · READ-ONLY
Started by caethyril 72 posts Page 4 of 4 View original ↗
  1. You are, unsurprisingly, correct. A longer sound effect plays correctly so maybe the one of first animation is just being drowned.
  2. caethyril said:

    Cae_Tweaks


    v16 updated 2024-12-19 (UTC+0)​

    Terms of Use​


    Description​

    The plugin file must be named Cae_Tweaks.js.​
    This plugin contains a bunch of different things. It's mostly just me slowly making a game and coding some more stuff whenever I think "I wish I could do X". Since I'm up to v03 as of writing this, I thought I'd make a thread for it.​
    Since v09, many values can be customised via plugin parameters. The code is thoroughly commented and not obfuscated. Each feature's code is enclosed in its own block and can be independently enabled/disabled via the Plugin Manager. The help section is now extensive and should cover most queries.​
    This plugin was written for, and tested with, a front-view TPB (Time Progress Battle) system. It has not been specifically written to be compatible with other plugins, but many things should be cross-compatible.​
    Feel free to post feedback on what's already here, e.g. bug reports, problems understanding the help, or favourite features!​
    If you have a feature suggestion, consider starting a thread in Plugin Requests. :kaohi:

    Features​

    Here is the "quick reference" feature summary from the plugin's help:​
    v16 feature list
    • M01: HIT > 100% multiplies evade fail rate.
    v16 feature list
    • M02: Reinstate speed/Through on exit vehicle.
    • M03: High relative TGR => taunt opponents.
    • M04: States can <persist> after death.
    • M05: Conditional state chaining <next: X, Y>.
    • M06: Blank equip type names make duplicate slots.
    • M07: Luck effect applies to more things, e.g. hit/crit.
    • M08: Use TP as a damage shield.
    • M09: <max TP base: X> & <max TP plus: X>.
    • M10: Left/right actor selection in TPB-Wait.
    • M11: Adds Active TPB Mode in-game option.
    • M12: States add min turns on apply, up to max.
    • M13: Random encounter rate = "rate" to "mult * rate".
    • M14: Speed > 0 actions give bonus TPB charge next turn.
    • M15: "Remove State X%" removes X% of max turns.
    • M16: Enemy tag <actor: X> copies traits from actor X.
    • M17: <follow-up: A, B, C> for Skills/Items.
    • M18: "X Random" scope: <forbid repeats>, <avoid repeats>.
    • M19: "Add State: Normal Attack" effect => this is an attack.
    • M20: Casting states for Skills/Items: <cast state: X>.
    • M21: Elemental HP Regen traits: <HRG element: X>.
    • M22: Turn-based state stacks: <stack: X>.
    • M23: Gain TP -> Lose TP on opponent-scoped actions.
    • M24: Replace Guard skill: <guard skill: X>.
    • M25: Ignore weapon for certain Skills/Items: <no weapon>.
    • M26: Change speed on bush/ladder tiles.
    • M27: "Item" skill type to limit battle item usage.
    • M28: Change save slot count.
    • M29: Custom skill cost types: <cost: type ext: jsCost>.
    • M30: Per-actor formation locking: <lock formation>.
    • M31: Change follower-event collisions.
    • M32: Disable event "locking": <no lock>.
    • M33: Custom Auto Battle AI for actors/enemies.
    • M34: <boost escape: X>, <block escape [immobile]: X>.
    • M35: Custom "switch-on" battle party commands.
    • M36: Gameover screen command window.
    • M37: Cross-playthrough persistent switches/variables.
    • M38: <transform: ID> State notetag.
    • Q01: Finer volume controls.
    • Q02: Front-view battle effects on actor status window.
    • Q03: More info on status scene.
    • Q04: Skips blank messages on battle start.
    • Q05: More actor info on equip scene.
    • Q06: Pauses audio & video when game loses focus.
    • Q07: Disables WindowLayer masking.
    • Q08: Scroll down to last item, change column if needed.
    • Q09: Process text codes in any game window.
    • Q10: Suppress map fast-forward behaviour.
    • Q11: Attack animation controls.
    • Q12: Add "Quit Game" command for non-web games.
    • Q13: Support weather effects in battle.
    • Q14: New Show Text codes: \AF[n], \PF[n], \S[n], \ALIGN[0|1|2].
    • Q15: Group duplicate drops in battle rewards.
    • Q16: Adds in-game option for audio dynamic range compression.
    • Q17: Adds a help window to the options scene.
    • Q18: Enemy opacity: <ghost: X>.
    • Q19: Render at integer coordinates to avoid blurring.
    • Q20: Show remaining state/buff turns on battle icons.
    • Q21: Per-map BGS muffling: <muffleBGS>.
    • Q22: All enemies are closer to the bottom of the screen.
    • Q23: Tile/event draw offsets: <offset: X, Y>.
    • Q24: Hide MP or TP gauges with a maximum of 0.
    • Q25: Segmented gauges.
    • Q26: "Saving" indicator appears when saving.
    • Q27: Touch UI toggles immediately when option is toggled.
    • Q28: Show options on first session.
    • Q29: Pre-title static/movie splash screens.
    • Q30: Enemy gauges.
    • Q31: Adds WASD movement, moves W -> E.
    • Q32: Event hue shift/cycle: <hue: H, D>.
    • Q33: Parallel Show Text => auto/gab message.
    • Q34: TPB cast time gauge overlay.
    • Q35: Death effects: <death var: X, Y>, <death anim: X>.
    • Q36: Show Picture snapshot.png uses snapshot.
    • Q37: Orbital motion for events: <orbit: id, R, T, ro>.
    • Q38: Release touch to change destination, hold to dash.
    • Q39: Attack/Guard commands show skill names.
    • Q40: Hover-select on menus plays Cursor SE.
    • Q41: Shadowless hard/soft colour map lighting shader.
    • Q42: Skip Buy/Sell/Cancel when appropriate.
    • Q43: Adds a Game Speed in-game option.
    • Q44: Place Guard command immediately after Attack.
    • Q45: Vertical scrollbar indicators.
    • Q46: Remodels main status scene window.
    • Q47: Adds a Full Screen in-game option.
    • Q48: Custom cursor PNG(s).
    • Q49: Show Choices: align, merge, inline, hide, disable, shuffle, help.
    • Q50: Menu arrangement: move commands/help/buttons, add mini-help.
    • Q51: In-game master volume option.
    • Q52: In-game option categories.
    • Q53: Show Text hover tips using \T[phrase].
    • Q54: Change options display: replace ON/OFF, add volume gauges.
    • Q55: State overlays for enemies and/or map party.
    • D01: Prefix Troop 1 events to all other Troops.
    • D02: Line-of-sight: char1.los(char2, fov) => true|false; <los> event tag.
    • D03: Catch ConfigManager.save errors.
    • D04: Prefix Item 1 effects to all other Items & Skills.
    • D05: Set _targetIndex for enemy actions.
    • D06: Track all HP, MP, TP changes per result.
    • D07: Audio pitch can change without restarting track.
    • D08: Reset opposed "Last" data.
    • D09: Draw face from enemy image: $NAME$X-Y-S.png.
    • D10: Enemies use Attack|Guard skill when picking skill 1|2.
    • D11: Tile events contribute tile flags.
    • D12: Adds plugin commands to force battle advantage.
    • D13: Show Picture "!picture.png" pins to the map.
    • D14: Support showing left/right arrows on game windows.
    • D15: More info & clipboard-copy button on qualifying errors.
    • D16: Don't process message codes during measurement.
    • D17: Merge BGM Volume and ME Volume.
    • D18: Add members from listed troops: <add: X, X, X>.
    • D19: Allow processing multiple move commands per frame.
    • D20: Enemy Reinforcements plugin command.
    • D21: Synchronous save/load plugin commands.
    • D22: Silent onChange for specific switches/variables.
    • D23: CSPRNG for technically improved randomness.
    • D24: Precache maps, images, and/or audio.
    • D25: Auto Battle actors consider their guard skill.
    • D26: Custom core config default values.
    • D27: Move Toward/Away can use pathfinding.
    Each feature has a code, e.g. M01, for ease of reference. Detailed help on each feature can be found in the plugin's help description.​

    View/Download​

    For the v11 update, I also spent a few minutes to make some simple images for use with certain features (e.g. Q26 save icon, Q48 cursors). These can be found in the attached img.zip file. Feel free to use, edit, and/or redistribute them however you like! You can credit me for the images if you like, but it's not necessary.
    Is the lettering system based on:

    D - Design
    M - Mechanics
    Q - Quality of Life


    ???
  3. ZimXero said:
    D - Design
    M - Mechanics
    Q - Quality of Life
    Close! My initial idea was:
    • Mechanics - changes to player-facing mechanics.
    • Quality of Life - mostly just changes to in-game UI/UX.
    • Developer Tools - to make doing technically-already-doable (?) things easier.
    There's been an increasing amount of overlap/drift, though: by now it's largely arbitrary. :kaoslp:
  4. There's a lot here to learn from.
    Some times i like just checking out what others make in order to learn more.
  5. It's been a while since the last update! Just dropped v17 with some fixes and stuff:
    • M08: the Block State check (TP > 0) now refers to .tp rather than ._tp.
    • M28: added 3 plugin params:
      • "Minimum Empty Slot" - makes the empty slot (e.g. for new game) prefer lower slot IDs, rather than starting the search after the first occupied slot.
      • "Custom Save Path" - customise the local save folder path.
      • "Custom Save Subpath" - optionally add a subfolder named by game ID.
    • M33: now only clamps the final strictness value to min 0, max 100. So <ai strictness: 200> and <ai strictness: 50> would yield 100 strictness (previously 50).
    • M35: added plugin command to remove a party command by its switch ID.
    • Q05: added "Portrait Opacity" plugin param.
    • Q29: enabled new v1.9.0 feature for movie selection.
    • D02: rewrote line raster algorithm from scratch, using the basic division algorithm. Raster is now independent of trace direction (e.g. left/right) and supports corners. Added 3 plugin params:
      • "Skip LoS at Target?" - sight checks always succeed on the target tile. The "JS: Is LoS Blocked?" plugin param has also had its default value changed.
      • "Check Corners" - perform sight checks for corners through which the LoS passes.
      • "Perfect Corners" - determines which corners are selected (if any) when the LoS perfectly passes through the corner of a tile without clipping through tiles on either side.
    • D20: fixed reinforcements not acting! Also fixed an out-of-bounds error for certain setups.
    • D24: enabled new v1.9.0 feature for map ID selection.
    Added:
    • Q56: destination sprite customisation. Normally this is just a white square indicating the player's touch-to-move destination. This feature lets you use a picture, specify the blend mode, and/or customise its animation (scale, rotation, opacity, hue, tone).
  6. this is a amazing work, I try most of feature and they work really well
  7. I just realised M28 has a problem with its new Custom Save Path parameter: it doesn't read correctly, always using M28_saveDir instead of whatever you input. I'll fix it for v18 (whenever that gets released), or you can patch it early if you like by editing e.g. line 9673, e.g.
    JavaScript:
        const CUSTOM_ROOT = "";  // disable custom save path
    [Edit: v18 has been released with a fix for this.]
  8. I am using quite a few of your cae_tweaks features. I really like this plug-in because they mostly work independently and behind the scenes rather than changing the whole visual display. I have a player that I want to be unable to cause any type of damage in battles, including damage producing items. There is an item, Lightning Bolt, that is usable in battle, but I don't want her to be able to use it. I can use the Visustella plugin to achieve this, but it makes the item window just so busy and complicated and, for my target group, I just want to keep it simple. I used your M27 ("item" skill type) and it works great but not perfect. My pacifist healer is unable to select the Lightning Bolts in battle, but neither can she select any other items. Is there a way to designate just one specific item unusable in battle for one specific actor? If not, I can quite happily live with what cae_tweaks can do.

    I'd like to also say that I am so appreciative of not only this plug-in, but also all your help in the forum with engine/javascript questions. I always read your responses, no matter the subject matter, because I know I'll learn something valuable.
  9. @Lady_JJ - aw thanks! You're welcome~

    M27 isn't designed for per-item requirements, but I have a different plugin, Cae_OnUseEffects, that can do that. In case you're interested, it can be found over here:
    Amongst other things, it offers this Item/Skill notetag:

    <enable condition: SCRIPT> e.g. <enable condition: return 100 <= subject.mat;> - Replace SCRIPT with valid JavaScript. If this returns falsy, the skill/item will be disabled in-game. Local vars: item, subject (a.k.a. user).
    So, with that, you could try tagging the Lighting Bolt item like this (untested):

    <enable condition: return !user.isActor() || user.actorId() !== 23;>
    I.e. "this item is enabled iff the subject is either not an actor, or not actor ID 23". Replace 23 with the ID of your healer. (I've included the "not an actor" check just to be super safe, because actorId only exists for actors.)
  10. :kaojoy: And, it, of course, works perfectly! Thank you so much!
  11. Updated to v18!
    • M05: now correctly uses custom tag name, if defined. I also made its shouldAddNextState function externally moddable by defining it on the feature namespace, just in case.
    • M26: redesigned how it fetches the speed modifier value. It should be more compatible with other stuff now, including (for example) new feature D29. (It previously patched realMoveSpeed for each character type, now it simply defines different move speed modifier functions for each type.)
    • M28: now reads Custom Save Path plugin parameter correctly.
    • Q03: when specifying which params to show on the status scene, you can now use the identifier, e.g. "mhp" for Max HP. This is mostly to help interface with e.g. new feature M39. (Param IDs still work too.) Buff threshold "neutral" values now support JS. Neutral values and "lower is better" flags can now be customised for all param types - note that this means those updating from a previous version will need to re-enter any non-default values for that stuff.
    • Q32: hue updates now sync to map update rate and do not reset on scene change.
    • Q33: added plugin commands to show/clear auto-messages, and a plugin parameter to enable/disable automatic conversion of parallel Show Text. Also now supports showing auto-messages in battle.
    • Q41: setting the Option Default plugin parameter to false now works as intended.
    • Q43: out-of-bounds values are now handled a tiny bit more efficiently.
    • Q53: blank Navigation Key no longer crashes the game.
    • Q55: fixed a memory leak. Yay!
    • Q56: fixed angle units used for dynamic rotation. Before it was using radians for the initial angle and degrees for rotation...now it uses degrees for both.
    • D20: added "Advantage?" command argument. So your reinforcements can arrive and immediately act out.
    • D21: added "Safe Load" plugin parameter & code for it. It's enabled by default: it basically just sends you to a "loading" scene to avoid the error-prone mess of clearing and replacing map data while on the map.
    • D26: added "Mode" plugin parameter, to change when the custom defaults are applied. Don't change this unless it's not working correctly as-is.
    Added:
    • M39: allows defining custom formula overrides for core parameters, and new parameters each based on a custom formula. Mostly intended for display in the status menu via feature Q03.
    • D28: notetag for Enemies: <replace: EVAL>. Largely based on what I posted here. Replaces tagged enemies immediately before battle starts, based on the result of the eval:
      • Positive: replace with enemy ID.
      • Zero: replace with nothing, i.e. remove.
      • Negative: replace with all members of that troop.
      • Not a number, e.g. null: do nothing.
    • D29: "glue" characters together so that they move and collide as a single unit. Gluing is directional: if A is glued to B, then B is the "parent" and controls all movement. I was thinking of block-pushing puzzles, but might also be helpful for land vehicles, large enemies, overlays, etc.
  12. OK, rushed out a v19 update. Just some bits & pieces:
    • M07: added "Damage Formula" & "Variance Bias" params. The first just scales the formula result by the luck effect rate. The second (currently) shifts/scales the range of variance based on luck, e.g. at high luck (relative to your target), negative formula variance becomes impossible...and vice versa.
    • M35: added "Options Command" & "Quit Command" params - exactly what it says on the tin, in-battle access to options/quit scenes without breaking battle flow.
    • M36: added support for a "Transfer" gameover option. You can change the transfer target mid-playthrough using a plugin command.
    • M38: patched behaviour of nested transforms. E.g. if transform B is applied on top of transform A, then transform A is removed, removing transform B should then correctly revert you to your original form.
    • Q41: added support for multiple FoV angles. The FoV angle parameter is now a list: the first one (FoV ID 1) is used for the player's "natural" FoV. Previously the <light> tag accepted either 0 or 1, to specify a point or FoV source; now 0 is a point source, and other numbers indicate the respective FoV angle. With this update there is also support for inverted FoVs (light/dark swapped within radius): just specify a negative FoV in a <light> tag.
    • Q55: map state overlay redesigned to catch edge cases.
    • D29: rewrote some code for readability/efficiency.
    No new features~

    (This has been mostly ready for months, I just hadn't bothered testing the lighting stuff. :kaoslp:)