Skip to content

Conversation

trixobird
Copy link

@trixobird trixobird commented Aug 5, 2022

This PR migrates 9 of the 15 examples menionted here: https://developer.vatom.com/plugins/examples/ The two absences are Pickups and Webpack.

Although the plugin are installed, there are some issues with some of them, they have code that either is not documented in the api and/or code that does not work. I have put comments on each of them.

Copy link
Author

@trixobird trixobird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

del me

Copy link
Author

@trixobird trixobird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issues on the coin-pickup-game

static description = "A game where users can walk over coins to collect them."

/** Current number of coins collected */
score = 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The autospawn functionality does not work. More specifically:
serverTick is not documented and it does not seem to work. Tried also server_tick_enabled
onTimer() is not documented and it is never invoked.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • When serverTick is set to true in the registerComponent method, it will call the onServerTick() method every 30 seconds (we do need to document this)
  • onTimer is not an internal method, it seems to be called right here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you are right on the onTimer :)
Regarding serverTick I read about it here https://developer.vatom.com/plugins/api/objects/ (search for server_tick_enabled) The thing is neither works, I tried with serverTick: true and with server_tick_enabled: true. I enabled the functionality in the settings but it didn't work. I am probably doing some silly mistake.

static description = "A game where users can walk over coins to collect them."

/** Current number of coins collected */
score = 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spawned coins are just objects and they don't have the coin component attached. This functionaly is not documented. The relevant code seems to be:

            ['component:' + this.plugin.id + ':coin:' + 'pickup-sound']: this.getField('pickup-sound') || this.paths.absolute('collect.wav'),
            ['component:' + this.plugin.id + ':coin:' + 'score']: this.getField('score') || '',
            components: [
                { id: this.plugin.id + ':coin' }
            ]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, we need to document that structure

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be happy to document it; the only thing is that it does not work. The spawned coins are just objects and they don't have the coin component attached. Probably something changed in the API?

@trixobird trixobird requested a review from chapmankyle August 5, 2022 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants