Orange Custom Events

● ARCHIVED · READ-ONLY
Started by Hudell 188 posts Page 8 of 10 View original ↗
  1. I'm trying to remove all the spawned events, that were copied from another map, from a map as a way of resetting the map to spawn new events. I'm using the script function: $gameSystem.clearCustomEvents(1); which I was told would have this desired effect. It doesn't seem to be working though. Is this not a feature of this plugin? Can I not wipe a map clean of copied events? Am I doing something wrong?
  2. BonnieLass said:
    I'm trying to remove all the spawned events, that were copied from another map, from a map as a way of resetting the map to spawn new events. I'm using the script function: $gameSystem.clearCustomEvents(1); which I was told would have this desired effect. It doesn't seem to be working though. Is this not a feature of this plugin? Can I not wipe a map clean of copied events? Am I doing something wrong?



    clearCustomEvents remove the events that are saved, but it doesn't erase them from the current map until you reload it.


    At the moment there's no script call to remove the spawned events.
  3. That information actually fixes my problem. All I needed to do was do a quick transfer out of map and then back into the map to make it reload and erase the events. Thanks Hudell!
  4. I can't for the life of me figure out where the copied event data is being stored.


    I'm using the Script to copy events from one map to fill a region in another map, the events copy over successfully but when I click on the newly copied events I have a script running that parses the note tag.


    $dataMap.events[this._eventId].note


    Unfortunately the event is undefined now, "cannot read property 'note' of undefined". Where is the data being stored for the copied event? How would I access it? I saw someone else mention this problem but they figured it out themselves and no solution was posted
  5. Hmmm.. the following line should work with both normal and copied events:

    Code:
    $gameMap.event(this._eventId).event().note
  6. Hudell said:
    Hmmm.. the following line should work with both normal and copied events:



    $gameMap.event(this._eventId).event().note



    Thanks a ton Huddel, that was part of the problem, I should have explored $gameMap more thoroughly.


    I still got a error trying to read note of undefined after implementing this change but then I found that if I disable Terrax lighting it works fine - weird that they would conflict like that.  I don't even have any lights on the map I was testing with. Looks like I may need to switch to your Orange Lighting plugin - I assume that's more compatible  :)  ... or it could be my own implementation of note tag scripting


    EDIT: It does seem your own lighting implementation works better, or at least it doesn't cause a crash when I try to parse notes on my copied events.
  7. Hi Hudell!


    I love this plugin, but I have the same problem of BonnieLass.


    For my game I need to call several events, which are deleted later.
    The problem: it's like if the events aren't deleted (with "Erase Event" command), but remain on the map and increase lag, although the events are actually deleted.
    The problem is solved when I change map.
    I consider pretty ugly to do quick transfer out of map and then back into the map to make it reload and erase the events.
    So I ask: is there a Call Script to call the processes of the "change map" (without transfer) and then simulate the transfer back into the map?


    Thanks for the support :)


    EDIT: Yeah!!! I did it!!!!!


    Script call:


    $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
    $gamePlayer.requestMapReload();


    to refresh the map! :D
  8. Hello. I'm getting the following error: "Cannot read property 'id' of undefined.

    I believe the suspect of the problem is: ◆Control Variables:#0074 Battle Event ID = $dataMap.events[this._eventId].id

    I copied the event using: ◆Plugin Command:copy event 23 from map 27 to position 34 8

    When I activate the (copied) event normally from map 27, I do not get that error. However, when I activate the copied event on the map I copied it to, I get the id error above. Not sure if there's a simple fix or I've given insufficient info.
  9. You can't use the $dataMap object for copied events. Change that first line to this:


    #0074 Battle Event ID = this._eventId
  10. Thank you. I've encountered a new, different error with another event.
    Error: "TypeError Cannot read property 'note' of null"



    ** Compatibility issue with a script from further testing.
    Scipt: TerraxLighting v1.3.1 (Creates an extra layer that darkens a map and adds lightsources)

    Scenario: There are only two events on a map (ID 78). One is just using a Text Message box and the other the same, but has conditional checks across different pages. On a map that the player starts off on, I run ◆Plugin Command:copy event X from map 78 to position 10 10


    (X being 1 or 2 for either of the events) via an autorun event and it copies the event.

    However, when I interact with the copied event, I get the TypeError above. If I manually copy the events across and interact with them on the starting map, the events operate normally. Interestingly, I noticed interacting with the copied events (via your script) was successful after interacting with the manually copied event. When I closed the playtest, removed the manually copied event and went back into playtest, I get the TypeError problem again.

    During my experiments though, my pc got a blue screen (as I turned off the playtest) and I've been unable to replicate that interesting observation above (It gives the same TypeError message even if there's a manually copied version of the copied event on the map).
  11. Updating Terrax Lighting to 1.4.2 or higher should fix that.
  12. Thanks again. I'm thinking of using your script to help me allow an event to exist at different locations, with different interactions, depending on the time. 

    I skimmed through the thread and realised there are some commands not included in the first post, such as "with ID" which designates an ID number you can better control, which I plan to do. I'm trying to delete an event with a certain ID number.
     


    ◆Plugin Command:copy event 1 from map 78 to position 7 7 with ID 507
    This works and the event can identify itself as ID 507



    ◆Script:$gameSystem.removeCustomEvent(29, 507);
    This does nothing. The event still remains there.

    Plugin commands "delete event 507" and "delete event with ID 507" do nothing (not sure how to do it via plugins, but I think script call would be more efficient for me anyway)
  13. The $gameSystem.removeCustomEvent method removes the saved event so it won't be loaded again, but it doesn't remove an event that is already on the map.


    To remove the event from the current map, use this:


    $gameMap.eraseEvent(507);


    This also works for regular events, even without my plugin.
  14. Thanks! I'm making progress with what I hope to do. Came across some problems, but figured them out eventually. I think I've found a bug though.

    So when I load playtest, the starting map has an autorun event that copies two events, event 1 and 2 from map 78.

    First, I copied them to regions 46 and 47 respectively on the starting map.
    event 2 is copied instead of event 1, so there are two event 2s. Leaving and returning to this starting map causes the correct copying to happen (event 1 and 2 appears).

    Second, I copied them each to different positions on the starting map as a work around.
    event 1 and 2 are copied over, but when I interact with event 2, it identifies itself twice (so it copied twice) as ID 65 and 67 [event 1 reads as ID 66]. Leaving and returning to this starting map causes the correct copying to happen once again (one each of events 1 and 2).

    At the moment, I do not foresee this being a problem for me cause I'm not sure of a scenario where a player of mines would start on a map with an autorun copy generator. But I thought it may have been a potential bug you would want to know.
    (Actually, would be cool if I can spawn to regions and label them with an ID. "spawn ... with ID X" didn't work for me.)
  15. You can't spawn with an ID because you can't have two events with the same ID. Can you paste here the script calls or plugin commands that you used?
  16. Hudell said:
    You can't spawn with an ID because you can't have two events with the same ID. Can you paste here the script calls or plugin commands that you used?


    ◆If:Debug Var I ≠ Current Map ID
      ◆Plugin Command:copy event 1 from map 78 to position 6 9
      ◆Plugin Command:copy event 2 from map 78 to position 7 9
      ◆Control Variables:#0259 Debug Var I = Current Map ID
      ◆
    :End

    (I don't think the IF loop would affect one copy and not the other, but I still had that coding left over from experimenting before. I might remove it.)
    The spawn version:

      ◆Plugin Command:spawn event 1 from map 78 on region 47
      ◆Plugin Command:spawn event 2 from map 78 on region 46

     
  17. That conditional branch actually prevents the event from being copied twice if you're using an autorun event to copy.


    Not sure why it's copying the same event twice, I'll have to debug it to be sure.
  18. Hudell said:
    That conditional branch actually prevents the event from being copied twice if you're using an autorun event to copy.


    Not sure why it's copying the same event twice, I'll have to debug it to be sure.


    I am terribly sorry for the trouble. Your script is fine. I had an extra autorun event (that specified one event) turned on by error.
  19. Hello!
    It seems like this plugin is what I'm looking for, and wanting to ask some quick questions that wasn't on the main post.

    1- Is there a command to spawn an event on another event from one map to the other?

    2- Is there a command to spawn events based on variables as the location?

    3- When using the spawn command on a random tile with a certain region ID, does the events go on top of each other, or it doesn't spawn to places with blocked tiles or an event already occupying it?

    I hope I could be clear enough on what I'm asking, and thank you! :D
  20. @Hudell, can I have a request? Can you please make it to transfer also comment box textes from copied events (from another map)?