Skip to content
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 - Spawn Map Event #3218

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jetrotal
Copy link
Contributor

@jetrotal jetrotal commented May 7, 2024

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):

@raw 2056,
     "",
      0, 1,        // Source Map's ID.
      0, 2,        // Source Event's ID
      0, 3,        // Target's x coordinate
      0, 4,        // Target's y coordinate
      0, 5,        // Target's Event's ID [Optional] 
                   // 👆 if a value is defined, it will replace an existing event.

Command that clones Events from any map inside the current map.

Co-Authored-By: Primekick <thetrueaxer@gmail.com>
@Ghabry
Copy link
Member

Ghabry commented May 7, 2024

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:

  • From the current map
  • From a different map

Because I have to add the Web Player Async stuff, so I have directly something for testing...

@jetrotal
Copy link
Contributor Author

jetrotal commented May 7, 2024

Ok, later tonight I'll poke around to fit map0 and mapItself cases.
Would be useful to also have a "destroy Event" command.

@Ghabry
Copy link
Member

Ghabry commented May 8, 2024

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:

  • event deletes itself
  • event deletes other event

This must be will defined.

For spawn this is obvious: refresh everything, done. Delete has multiple ways to do it.

@jetrotal
Copy link
Contributor Author

jetrotal commented May 8, 2024

Project for testing, both from map itself and outside map:
image

SpawnEventDemo.zip

Updates on DestroyMapEvent

You can also replace an older event with a new one with this optional parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants