RMMV Extension to Yanfly Doodads plugin - Rotating doodads

ZephyrAM

Regular
Regular
Joined
Oct 6, 2017
Messages
87
Reaction score
90
First Language
English
Primarily Uses
RMMV
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)
~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:
- '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:
- 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.
 
Last edited:

Vincent Chu

Writer and translator
Regular
Joined
Sep 26, 2017
Messages
177
Reaction score
548
First Language
English
Primarily Uses
RMMV
Thanks a lot for agreeing to make this plugin.
 

Tonedawg181

Tonedawg Gaming
Regular
Joined
Oct 21, 2016
Messages
79
Reaction score
35
First Language
English
Primarily Uses
RMMV
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
 
Last edited:

ZephyrAM

Regular
Regular
Joined
Oct 6, 2017
Messages
87
Reaction score
90
First Language
English
Primarily Uses
RMMV
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 ^_^
 

ZephyrAM

Regular
Regular
Joined
Oct 6, 2017
Messages
87
Reaction score
90
First Language
English
Primarily Uses
RMMV
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.
 

Tonedawg181

Tonedawg Gaming
Regular
Joined
Oct 21, 2016
Messages
79
Reaction score
35
First Language
English
Primarily Uses
RMMV
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.

 
Last edited:

ZephyrAM

Regular
Regular
Joined
Oct 6, 2017
Messages
87
Reaction score
90
First Language
English
Primarily Uses
RMMV
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.
 

miani

Regular
Regular
Joined
Oct 24, 2015
Messages
74
Reaction score
62
First Language
Portuguese
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.


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.
 
Last edited:

ZephyrAM

Regular
Regular
Joined
Oct 6, 2017
Messages
87
Reaction score
90
First Language
English
Primarily Uses
RMMV
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.
 

ZephyrAM

Regular
Regular
Joined
Oct 6, 2017
Messages
87
Reaction score
90
First Language
English
Primarily Uses
RMMV
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.
 
Last edited:

Tonedawg181

Tonedawg Gaming
Regular
Joined
Oct 21, 2016
Messages
79
Reaction score
35
First Language
English
Primarily Uses
RMMV
@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.
 

Restart

Regular
Regular
Joined
Mar 15, 2019
Messages
848
Reaction score
754
First Language
English
Primarily Uses
RMMV
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.
 

C64_Mat

System Masters
Regular
Joined
Apr 3, 2021
Messages
307
Reaction score
428
First Language
English
Primarily Uses
RMMV
This was brought to my attention today by @SigmaSuccour and is exactly what I've been looking for! Thank you so much!
 

ZephyrAM

Regular
Regular
Joined
Oct 6, 2017
Messages
87
Reaction score
90
First Language
English
Primarily Uses
RMMV
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.
 

ephesus

Regular
Regular
Joined
Dec 10, 2015
Messages
181
Reaction score
93
Primarily Uses
-Copy group of doodads and paste would be so amazing.
-A full undo redo system would be super cool

thanks for the keen plugin!
 

C64_Mat

System Masters
Regular
Joined
Apr 3, 2021
Messages
307
Reaction score
428
First Language
English
Primarily Uses
RMMV
-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.
 

Latest Threads

Latest Posts

Latest Profile Posts

Thanks to my last two calendar days, the goddess can now join your heroes' party and whack your enemies with the power of love!
1702314770604.png
How are you gonna use all those new resources from the calendars?
I hate driving in games. Imagine your character profile being an exceptional individual, yet when they drive, it makes them look dumb.
The flaming skeleton visited me in my dreams again. He demands the game be finished soon. I don't like the flaming skeleton. He took my cranberry juice. He doesnt even have a stomach it just spilled all over the floor.
My Game Jam entry is a bunch of mini games wrapped within an epic story that will rival the deepest plots of the earliest CRPGs! As a small spoiler, here is one example of a game you will be able to play. Anyone want to try Brat, Krampus, Santa?
so I had two plugin that essentially overwrite each other depending on where they are in the list. so I had to edit what was overwriting one into the other and now they both work. I REALLY need to sit down and just learn JavaScript. I hate that I know just enough to know I don't know NEARLY enough lol.

Forum statistics

Threads
136,918
Messages
1,271,459
Members
180,708
Latest member
xona
Top