Tile Changer (Copy Tiles and Change Tiles)

● ARCHIVED · READ-ONLY
Started by Shaz 112 posts Page 6 of 6 View original ↗
  1. Ninja777 said:
    I know its not working because I'm using a lighting script that changes based on region ID
    that could be a wrong assumption - what if the lighting script only loads the region ID on entering a map, never checing them again? The tilechanger would then correctly change the region ID but the lighting script would ignore that change.
    and there are a few other cases where it is the lighting script that has the problem.

    so at minimum you would have to give a link to the website of the lighting script for Shaz to check for compatibility issues.
  2. Hi @Shaz, thanks for the great plugin!
    However I encountered a bug when trying to test run specific events (Running "Test" from the context menu in an event).
    The game gets stuck on the "Now Loading..." screen.

    I have actually found the cause of the bug and fixed it though it might require looking more into it:
    Code:
    var _Shaz_TC_DataManager_isMapLoaded = DataManager.isMapLoaded;
    DataManager.isMapLoaded = function() {
        return _Shaz_TC_DataManager_isMapLoaded.call(this) && $dataMap.extraMapCount === 0;
    };

    This code gets stuck in a loop when calling `Scene_Map.prototype.isReady` because $dataMap.extraMapCount never exists when testing events because the mapId equals -1 and things don't get initialized the same in this edge case.
    So $dataMap.extraMapCount === 0 is always false and we never get out of this condition when actually the map is indeed ready.

    I fixed it by adding a check if the property exists resulting in:
    Code:
    var _Shaz_TC_DataManager_isMapLoaded = DataManager.isMapLoaded;
    DataManager.isMapLoaded = function() {
        return _Shaz_TC_DataManager_isMapLoaded.call(this) && (!$dataMap.extraMapCount || $dataMap.extraMapCount === 0);
    };

    Took me a while to find the cause of the "Now Loading..." screen getting stuck but I finally found it.

    Thanks again.
  3. unknown2u said:
    (!$dataMap.extraMapCount || $dataMap.extraMapCount === 0);
    Just to point it out, the two parts of this are unnecessary. 0 is a false value in C-based languages, so simply saying !$dataMap.extraMapCount covers that entire thing.

    As far as your problem - once you start using plugins, the convenient shortcuts in the editor shouldn't be relied upon. That is to say, the Battle Test in troops and the Test button in events shouldn't be presumed to work correctly once you have installed plugins that modify those things. That's because those shortcuts don't use the full process that the actual game does to load all plugins.

    You may have gotten a workaround in this instance, but I suggest it's a better habit to just test things in the actual game.
  4. @ATT_Turan
    1. Right `!$dataMap.extraMapCount` is enough, though I personally like to write explicit code, especially when `!$dataMap.extraMapCount` could mean "null", "undefined", "false" and "0" and I have seen a lot of developers abuse or misuse this. Sometimes the flexibility of JavaScript is its downfall - from experience.

    2. I strongly disagree with you on the other comment.
    I write lots of plugins and changes to the game and unless I intend to, I should not break anything in the basic functionality of the game or engine - That's called a bug. Again, unless whoever wrote it explicitly stated that "X" will stop working when using the plugin. And I did actually check if it was written somewhere in the release notes.

    3. I came across "event testing" by chance a few weeks ago so I decided to give it a go and found it is not working.
    That's when I decided to find out why. Not saying I'm going to use it, but I would never assume that a plugin would break anything or make it unusable, again, unless stated explicitly.

    But I guess all are matters of opinion and practices (I'm not very involved in the plugins development community).
  5. unknown2u said:
    but I would never assume that a plugin would break anything or make it unusable, again, unless stated explicitly.
    unfortunately that assumes that every plugin is written by an experiened programmer who knows exactly what they're doing. And even those like Yanfly who are experienced don't always take the entire engine into account when programming something.
  6. unknown2u said:
    2. I strongly disagree with you on the other comment.
    I write lots of plugins and changes to the game and unless I intend to, I should not break anything in the basic functionality of the game or engine - That's called a bug. Again, unless whoever wrote it explicitly stated that "X" will stop working when using the plugin. And I did actually check if it was written somewhere in the release notes.
    I think you misunderstand what I said - there is nothing you can disagree with :stickytongue:

    Plugins cannot affect anything in the editor, only in the running game - this is fact.

    The various "test" buttons in the editor (for events and battle test) do not do the full loading process of the plugin database - this is fact.

    Therefore, some modifications via plugins will not work or be reflected properly when using the editor's test functionality. This is nothing to do with the plugin being written incorrectly, it's the way MV was built. It's unavoidable.

    This is most commonly seen in the battle test, where effects loaded via plugin notetags may or may not work as expected, but it's true for any quick testing in the editor.

    You're probably correct that it would be the most professional practice for the plugin authors to say "Using this may cause these buttons in the editor to not work as expected," but I think it's such a widespread issue that most of us are in the habit of not using those tests.
  7. @Andar @ATT_Turan
    As I mentioned I'm not much into the plugin writing community so if that's the case I guess it goes without saying that one should assume stuff just stops working as expected.

    And that's why I disagreed :) - Stuff shouldn't break when you write new code to a functioning system.
  8. Hi guys.
    If you are interested (and if the author Shaz is ok with it) I partially rewrote the code of the script to make it works under MZ.
    I know it works using Fossil script, but my main problem was the passability, which wouldn't transfer along with the tiles, so I rewrote some parts to make the it works, mean it properly use the original tileset passability and not the one active for the current map.
    Let me know if you guys want it.
  9. I had not seen @Azerak's post before this, but if anyone wants to use this plugin in MZ without Fossil, I've ported it with Shaz's permission. Aside from edits made for compatibility, the main changes are that the ported version uses MZ's plugin commands and the map notes are slightly different.

    You can find the MZ version here: https://forums.rpgmakerweb.com/inde...nger-shazs-plugin-for-mv-ported-to-mz.162070/

    Thanks to @Shaz for this awesome plugin!
  10. Hello,

    i'm sorry but I really have trouble understanding how to use the plugin.
    (Everything explained in the capture)

    Where do I go wrong please?

    Thanks in advance.
  11. Tohisu said:
    Hello,

    i'm sorry but I really have trouble understanding how to use the plugin.
    (Everything explained in the capture)

    Where do I go wrong please?

    Thanks in advance.
    I think the command must be CopyTiles 14 4 'test' 3 3 14 11 with the '' symbols.
  12. Aerosys said:
    I think the command must be CopyTiles 14 4 'test' 3 3 14 11 with the '' symbols.
    It was indeed this, thank you.
    Which is weird since I check several previous posts and I couldn't see the ''.