Orange Custom Events

Discussion in 'JS Plugin Releases (RMMV)' started by Hudell, Oct 24, 2015.

  1. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,326
    Likes Received:
    2,988
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Orange Custom Events 1.1
    Hudell
    Introduction
    This plugin Will let you add or copy events from any map to the current map

    How to Use

    To copy an event from the same map:
    Script Call:

    Code:
    $gameMap.copyEvent(1, 15, 20, true);
    Plugin Command:
    Code:
    copy event 1 to position 15 20
    This will copy event 1 to position 15, 20. The "true" at the end indicates that the event should not be re-added automatically when the player leaves the map and comes back.
    To make the plugin save the event, change it to false on the script call or add "SAVE" at the end of the plugin command.

    To copy an event from another map:

    Script Call:
    Code:
    $gameMap.copyEventFrom(5, 1, 15, 20, true)
    Plugin Command:
    Code:
    copy event 1 from map 5 to position 15 20
    This will copy event 1 from map 5 to position 15, 20 on the current map.

    To copy an event from the same map to a random tile of a specific region:
    Script Call:
    Code:
    $gameMap.copyEventToRegion(1, 2, true);
    Plugin Command:
    Code:
    copy event 1 to region 2
    where:
    1 = Event ID;
    2 = Region Number;
    true = temporary event.

    To copy an event from another map to a random tile of a specific region:
    Script Call:
    Code:
    $gameMap.copyEventFromMapToRegion(5, 1, 2, true);
    Plugin Command:
    Code:
    copy event 1 from map 5 to region 2
    This will copy event 1 from map 5 to a random tile with region 2 on the current map.

    To fill a region with an event from the same map:
    Script Call:
    Code:
    $gameMap.spawnMapEvent(1, 2, true);
    Plugin Command:
    Code:
    spawn event 1 on region 2
    This will copy event 1 from the current map and add it to every tile with the region 2.

    To fill a region with an event from another map:
    Script Call:
    Code:
    $gameMap.spawnMapEventFrom(5, 1, 2, true);
    Plugin Command:
    Code:
    spawn event 1 from map 5 on region 2
    This will copy event 1 from map 5 and add it to every tile with the region 2 on the current map.
     
    To permanently delete a copied event, use the following plugin command:
     
    Code:
    delete this event
    Plugin
    Get it from here

    Dependencies
    None.

    FAQ
    I'll keep a small FAQ here for easy reference.

    Credit and Thanks
    - Hudell
     
    Last edited by a moderator: Nov 11, 2015
    #1
  2. Barreytor

    Barreytor Villager Member

    Messages:
    9
    Likes Received:
    12
    It looks pretty useful and exactly what I was looking for, but I've tried it and it keeps throwing an "undefined is not a function" when I try to load an event from a different map.

    Works flawlessly when copying from the same map, though. Here's hoping that issue can be fixed.
     
    #2
    Hudell likes this.
  3. lolshtar

    lolshtar Master of Magic thatknow nospell Veteran

    Messages:
    694
    Likes Received:
    101
    First Language:
    French
    Primarily Uses:
    RMMV
    will you make it possible to spawn events with regions but also to make sure the events dont stack unto each other
     
    #3
    Hudell likes this.
  4. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,326
    Likes Received:
    2,988
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Hmmm, can you pick the updated version and try again?

    If it still don't work, can you paste your script call here?

    I'm not sure I understand: You want to copy an event but instead of setting the position, you want to set a region and I should pick a random position with that region, is that it?
     
    #4
  5. lolshtar

    lolshtar Master of Magic thatknow nospell Veteran

    Messages:
    694
    Likes Received:
    101
    First Language:
    French
    Primarily Uses:
    RMMV
    that's correct
     
    Last edited by a moderator: Oct 24, 2015
    #5
    Hudell likes this.
  6. Barreytor

    Barreytor Villager Member

    Messages:
    9
    Likes Received:
    12
    Thanks, now it works as intended.

    And that idea of choosing a random position within a region sounds pretty interesting, although an option to just fill in an entire region with copies of an event would be handy, too. (For region-common-evented floors of spikes, for example)

    EDIT: Further testing (by adding more than one event that tries to run the script call to load an event from another map) made me find out that I can't have more than one event trying to create another at the same time. It crashed saying it "Cannot read property 'events' of null".

    I assume that's because the second time it's called is smashing the first one.

    I guess that could limit somewhat the functionality of the plugin. But then again, I tried to have two dozen copies of an event that replace themselves with an event from another map...

    Unsurprisingly, it worked without problems if I tried to do the same thing by copying an event from the same map.
     
    Last edited by a moderator: Oct 24, 2015
    #6
    Hudell likes this.
  7. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,326
    Likes Received:
    2,988
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Updated the script with the new feature and explained it on the main thread.

    Fixed this too. It happened because the plugin tried to copy the second event while the map data was still being loaded for the first one.
     
    #7
  8. Barreytor

    Barreytor Villager Member

    Messages:
    9
    Likes Received:
    12
    Working flawlessly and awesomely. As it is it feels as complete as it would ever need to be.
     
    #8
    Hudell likes this.
  9. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,326
    Likes Received:
    2,988
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Well, I still found something new to add to it and make it better, check the main thread :)
     
    #9
  10. Indsh

    Indsh Veteran Veteran

    Messages:
    218
    Likes Received:
    65
    Location:
    Bristol
    First Language:
    English
    Primarily Uses:
    N/A
    Hey I made a requst for this so thanks for making it anyway :) I can't get it to work but i know i missing something basic. Do I cll with plugin or script caller?

    V
     
    #10
  11. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,326
    Likes Received:
    2,988
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    I think plugin commands are easier to read :)

    You need to add MVCommons first and this plugin under it.
     
    #11
  12. Indsh

    Indsh Veteran Veteran

    Messages:
    218
    Likes Received:
    65
    Location:
    Bristol
    First Language:
    English
    Primarily Uses:
    N/A
    MVCommons was not above thank you :)
     
    #12
    Hudell likes this.
  13. lolshtar

    lolshtar Master of Magic thatknow nospell Veteran

    Messages:
    694
    Likes Received:
    101
    First Language:
    French
    Primarily Uses:
    RMMV
    edited all my spawn events with your script, everything is working flawlessly so far

    there's just one thing im missing, when l used Ace to get the event position, l was using get_character(0).x/y so the spawn would be right on the current event

    now this script call is not working anymore, do you know what should l write instead?
     
    #13
  14. Barreytor

    Barreytor Villager Member

    Messages:
    9
    Likes Received:
    12
    Oh, I had that thing, too, but found a way. You just have to call it from a script call inside a move route, and you can use "this.x / this.y" to use the event's position if you do it that way.
     
    #14
    lolshtar likes this.
  15. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,326
    Likes Received:
    2,988
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    In Javascript, that script call is:

    character(0).xinstead of

    get_character(0).xEdit: Added two new options for plugin commands:

    copy event 15 herecopy event 10 on player
    "here" will copy the event to the same position as the event that is executing

    "on player" will copy the event to the player's position.
     
    Last edited by a moderator: Oct 25, 2015
    #15
  16. Tester13

    Tester13 Villager Member

    Messages:
    10
    Likes Received:
    8
    First Language:
    English
    Hello! I'd like to ask a question about this script. It is possible to have it remove only certain events?

    Doing the following Plugin Command: "copy event 1 from map 6 on player SAVE" will successfully work. And just as intended, if I leave the map and come back, the Event remains. However, I want to remove only selected events. Since you can't actually remove events, I opted to send the event to a dumpster of sorts, where it won't ever be seen again. However, after I remove the event, if I exit the map and come back, it re-spawns. Is there any way around this?

    I know I could hide the event with a self switch, but this map constantly has many, many events at once. I want to be able to delete only certain events so that Rpg Maker won't start to lag due to all those events.
     
    #16
  17. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,326
    Likes Received:
    2,988
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Would it help you if I made the events be completely removed with the Erase command?
     
    #17
  18. Tester13

    Tester13 Villager Member

    Messages:
    10
    Likes Received:
    8
    First Language:
    English
    Yes, and if it stopped the events from re-spawning, that would be amazingly helpful! I'd be very grateful!
     
    #18
  19. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    335
    First Language:
    indonesian
    it would be better with a new plugin command instead using erase command. since people might want to erase the event temporary.
     
    #19
  20. Tester13

    Tester13 Villager Member

    Messages:
    10
    Likes Received:
    8
    First Language:
    English
    Oh, hello Estriole. I actually just came back from trying out your plugin xP

    It's exactly what I was looking for, it deletes the events I called from Hudell's script and they won't re-spawn!. Except...it causes some weird side effects. After using your "delete_this_event" command, any doors in the map this was used on will either disappear completely or fail to play animations. And using the SmartPathfinder Plugin after using "delete_this_event" will cause a 40 FPS drop on occasions.

    Thought I'd let you know in case it's a bug.

     
    #20

Share This Page