Extension to Yanfly Doodads plugin - Rotating doodads

ZephyrAM

Veteran
Veteran
Joined
Oct 6, 2017
Messages
75
Reaction score
75
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
Veteran
Joined
Sep 26, 2017
Messages
178
Reaction score
548
First Language
English
Primarily Uses
RMMV
Thanks a lot for agreeing to make this plugin.
 

Tonedawg181

Tonedawg Gaming
Veteran
Joined
Oct 21, 2016
Messages
67
Reaction score
22
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

Veteran
Veteran
Joined
Oct 6, 2017
Messages
75
Reaction score
75
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

Veteran
Veteran
Joined
Oct 6, 2017
Messages
75
Reaction score
75
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
Veteran
Joined
Oct 21, 2016
Messages
67
Reaction score
22
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

Veteran
Veteran
Joined
Oct 6, 2017
Messages
75
Reaction score
75
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

Veteran
Veteran
Joined
Oct 24, 2015
Messages
74
Reaction score
61
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

Veteran
Veteran
Joined
Oct 6, 2017
Messages
75
Reaction score
75
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

Veteran
Veteran
Joined
Oct 6, 2017
Messages
75
Reaction score
75
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
Veteran
Joined
Oct 21, 2016
Messages
67
Reaction score
22
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

Veteran
Veteran
Joined
Mar 15, 2019
Messages
848
Reaction score
707
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

Still alive! Totally did not finish in time for the Jam (boy that's late) but tl;dr of the last half a year is Work term -> Covid Lockdown -> Sick... again -> Full time Employment. Game stuff has been on hiatus but got a new graphics tablet so hopefully updates again soon. =D
Going on hiatus. Won't be back until mid October.:LZSoops:
Just read the English lyrics for Despacito. Ramen aint innocent no more! :kaodes:
Well today was blown away with nothing to show for it. I made a new character to my game who I was going to have a protection mechanic where he protects my main character randomly unless it's a critical, and no matter what, to check if an attack received will be critical, means checking the apply method. This means rewriting the entire method and I refused to do that.

Forum statistics

Threads
115,316
Messages
1,088,888
Members
149,961
Latest member
MrSunshine
Top