MV - Extension to Yanfly Doodads plugin - Rotating doodads

● ARCHIVED · READ-ONLY
Started by ZephyrAM 17 posts View original ↗
  1. This was a requested plugin I put together and now it needs testing! It, of course, requires Yanfly's Grid Free Doodads plugin and everything that plugin requires, and it allows you to rotate the doodads as you're placing them on the map, by as little as 1 degree at a time.

    This is an extension, so much of the code comes from Yanfly, especially the bits I couldn't alias. Along with that, if Yanfly updated the base plugin, it's 'possible' this extension could break it if not changed. Let me know if you have any issues!

    No terms of use restrictions.

    Note: In order to use the default numpad controls, you 'must' have your Numlock on. Keycodes change if Numlock is off.

    ZephAM_YEPDoodadExt.js

    Update: (Version 0.6 newest)
    Updates
    ~version 0.6~
    - Fixed 'cannot read property length of null' error showing up on map change

    ~version 0.5~
    - Added 'Undo' to Doodad Placement. Ctrl + Z will remove the last placed Doodad. Repeated uses will continue removing Doodads back through the placement order.
    - Fixed Rotation changing in Edit mode.
    - Fixed 'Z' key placing duplicate Doodads.

    ~version 0.2~
    - Added doodad flip/mirror. Removed due to scaling conflict and processing speed concerns.

    Planned Improvements:
    Plans
    - 'Redo' feature to replace doodads removed with 'Undo'. Current progress only replaces last 'added' Doodad, not last removed with 'Undo'.
    - Method to mirror/flip doodads without conflicting with Scale X/Scale Y. Avoid slowdown issues: does scale.x *= -1 bear the problem, or only setTransform()?

    Issues found:
    Issues
    - After placing a doodad, if you back through the menus to Edit Doodads, select a placed one and use Change Position, any alterations to the rotation at that point don't save. Resolved
    - On changing maps, the game crashes to a 'cannot read property length of null' error. Resolved.
  2. Thanks a lot for agreeing to make this plugin.
  3. this could potentially solve an issue with trying to use doodads with mode 7 :D i'll have results shortly and post an edit.

    edit: long story short.... it doesnt work with mode 7 lol
  4. Tonedawg181 said:
    this could potentially solve an issue with trying to use doodads with mode 7 :D i'll have results shortly and post an edit.

    edit: long story short.... it doesnt work with mode 7 lol

    Using the Ultra Mode 7 plugin I take it?

    That could definitely complicate things. I'll look at it, but no guarantee's ^_^
  5. Okay, so I see the problem with Mode 7. The doodad's aren't 'anchoring' to the layer system that Mode 7 uses - likely something to do with the Z axis, quasi-3D stuff Mode 7 introduces.

    Trying to find the link, but not sure I can. You may want to bring the issue up with the author of one or both of those plugins, see if they can fix the issue. If they can make make the two work together, making the rotating work shouldn't be a problem.
  6. hmmmmmmmm so i started using your plugin again for my normal game (forget about the ultra mode 7 post, thats been a scrapped idea forever now) but now im having an issue where if i enter any map that i created after using doodads in-game "save and close option" i get a TypeError that says cannot read property 'length' of null.

  7. I feel like I remember running into that issue... just to double check, you have the newest version, yes? Should be 0.5

    I'll look into it again though. That should be an easy to reproduce bug, so I'll see what's going on.
  8. Tonedawg181 said:
    hmmmmmmmm so i started using your plugin again for my normal game (forget about the ultra mode 7 post, thats been a scrapped idea forever now) but now im having an issue where if i enter any map that i created after using doodads in-game "save and close option" i get a TypeError that says cannot read property 'length' of null.



    Disable this extension, run the game in the maps you recently created and choose the "clear doodads" option, then save and exit. Activate this extension again in Plugin Manager and everything will work fine. Unfortunately this is a problem that occurs every time you create a new map in the project.


    ZephyrAM said:
    I feel like I remember running into that issue... just to double check, you have the newest version, yes? Should be 0.5

    I'll look into it again though. That should be an easy to reproduce bug, so I'll see what's going on.

    It would be very nice if you could fix that issue. Do you have any plans of adding new features? I think it would be nice if I have an option to duplicate a doodad, another interesting option would be to show a tile grid. Other interesting add on would be to just click and select doodads directly in the map, and move then in a new place.
  9. So Copy and Move options. Maybe... it's been a long time since I've messed with this plugin, which is obviously mostly Yanfly's base code. I'll dig back into it and see if it seems like those are possible.

    Can't guarantee anytime soon (Neverwinter Nights is absorbing my soul right now) but I will get back to it - and will definitely fix that issue at least.
  10. Still looking into extra features, but I wanted to get the working version updated and available. New version (0.6) is up and ready to go. Sorry for the wait!

    Edit:
    Okay, so it quickly became clear that Copy/Move options won't work without using their own UI section - such as the current Edit Doodad option that already exists and let you move them. The problem with just clicking to move/copy a doodad while you're placing them is detection.

    While code could be written to check for a doodad at the pointer location, that could quickly become a lag issue once you get more doodad's placed. Imagine hundreds or thousands of checks every frame as it searches the doodad array for one with a matching area position. It's best to stick with the method Yanfly developed I'm afraid.
  11. @ZephyrAM and @miani thank you guys for the reply's to the issue, sorry im late to respond, i dont check the forums as much as I used to.
  12. ZephyrAM said:
    While code could be written to check for a doodad at the pointer location, that could quickly become a lag issue once you get more doodad's placed. Imagine hundreds or thousands of checks every frame as it searches the doodad array for one with a matching area position. It's best to stick with the method Yanfly developed I'm afraid.
    Each layer of the doodad list is already sorted by y-location by default, which means you can use a binary search to find doodads close to the cursor's y coordinate practically for free.

    From there, you've got a short list of candidates to select the closest x-distance from.

    If running that every frame is still too slow, run the check whenever rightmouse is clicked (highlighting what its best guess is), and confirm it with leftmouse.

    Even if it isn't 100% perfect, you'll end up having selected a doodad with a very close y-coordinate to the one you want, which means you're in the right section of the big doodad list, which saves having to scroll through them at a rate of 15 per page.
  13. This was brought to my attention today by @SigmaSuccour and is exactly what I've been looking for! Thank you so much!
  14. Glad it's still useful ^_^

    I haven't touched this in ages, but I've been working with a team on another MV project for awhile, and gotten a bit more practice with the system. Let me know if any problems crop up, I'm still around.
  15. -Copy group of doodads and paste would be so amazing.
    -A full undo redo system would be super cool

    thanks for the keen plugin!
  16. ephesus said:
    -Copy group of doodads and paste would be so amazing.
    -A full undo redo system would be super cool

    thanks for the keen plugin!
    Agree. Being able to select multiple doodads and move / resize / recolour in batches would be great. For example, I recently resized a map, and had to edit 38 doodads manually.