-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Command 2056/2057 - Clone/Destroy Map Event #3218
base: master
Are you sure you want to change the base?
New Command 2056/2057 - Clone/Destroy Map Event #3218
Conversation
Command that clones Events from any map inside the current map. Co-Authored-By: Primekick <thetrueaxer@gmail.com>
This command looks pretty straight forward and simple to review. The only optimisation I see is that it shouldn't fetch and retranslate the map again when the map ID is the same as the active map. Maybe also consider "map 0" as the current map? (otherwise you need an additional event call to grab the ID). And maybe a small test game would be good that spawns an event in two ways:
Because I have to add the Web Player Async stuff, so I have directly something for testing... |
Ok, later tonight I'll poke around to fit map0 and mapItself cases. |
Updates on DestroyMapEvent You can also replace an older event with a new one with this optional parameter
This delete event should be a separate command. It is also much harder than spawn because the semantics are unclear: what is supposed to happen with the interpreter execution (e.g. when having a parallel process running) of the deleted event when:
This must be will defined. For spawn this is obvious: refresh everything, done. Delete has multiple ways to do it. |
977c5ad
to
b87cafd
Compare
b87cafd
to
278e2e4
Compare
278e2e4
to
df36ee0
Compare
Rebased. |
…hen the event vector is altered. Renamed to CloneMapEvent
Added async suspension to CloneMapEvent and (NEW) DestoryMapEvent. Is the same technique we already use for ManiacSave/Load implementation to prevent that inconsistent data is saved. There is still commented out code because it will conflict with a more complex change by #3233 so I didn't wanted to touch this. The semantics for Delete (and Overwrite) are: When it is NOT a parallel process (= executes on the main interpreter): The deleted event will execute till the end. (this is the same as for Erase Event). When it is a parallel process: The event execution will end immediately (even when currently inside a common event call) because the interpreter that runs it is destroyed together with the event. (this differs from Erase Event where only the lowest stack frame will end immediately and the rest will happily continue) An overwritten event forgets about its execution state so it always continues from line 0. |
…t running is destroyed. Prevents triggering the sanity check about an invalid event on the main interpreter. Fix operator= of Game_CharacterDataStorage.
Battle animations can also contain (stale) references to events as noticed in #3255 Updating these references (or cancelling the animation when the event is deleted) must be also handled by the event command. |
Prevents crashes... Had to add multiple player includes as a header was removed.
… GetEvent but for lcf::rpg::Event.
Battle Animations are now correctly repointed (event overwritten) or cancelled (event deleted). |
9db3950
to
4843ce2
Compare
Command that clones Events from any map inside the current map.
The syntax always comes in pairs. The first parameter of each pair indicates whether you are using a direct value or a variable/indirect variable, through ValueOrVariable().
Syntax (TPC):