Game Builder : July 3rd, 2019 Release notes

steamcommunity.com

雑多

  • Input customization ができなかったのは気づいてなかった。確かにできるようになってる。キー配置がこうなっていたのが分かるのありがたい。
  • parented actors が collision message を受け取れなかったのは気づかなかった。親子関係作ってまでやったことなかった。

temp

Added temporary local memory (temp.) for things that don't need to be persisted (caches, frame-to-frame state, etc).

tempAPI Reference にはまだ来てないようだけど、コードからは使えるようになっている。 card に似ているが、永続化はされないし、ネットワークを超えて同期されることもない。
かなり短い期間で利用するキャッシュとして利用するってことらしい。

Temporary memory for the current card/panel instance.

This is like {@link card}, but is temporary and only kept in the local machine. It is not persisted to disk or synchronized across the network, so it's only meant for short-term things or for caching.

Unlike other kinds of memory, because this is not serialized, you can freely store objects, functions, etc, anything you want.

Your script must be ready for this memory to be cleared (that is, reset back to the empty object {}) at any time. This will happen if the actor's network ownership is transferred, and also on load.

This is also cleared on game reset, UNLIKE other memories!

Actor Clicked

f:id:dany1468:20190706082036p:plain

以下のようなクリックしたら赤く光るみたいな logic を組んだが、うまく動いた。 Windows だと Esc でマウスカーソルが出せるようになったけど、実際ゲーム中に組み込むにはどうするんだろ。

f:id:dany1468:20190706082231p:plain

編集しようとした時の初期のコードは以下。 onActorClicked が追加されている APIonCheck (いつ呼び出される?)でチェックし、存在していれば即削除してる。てことは tick でチェックしてるのかな。
Collides with Terrain だと triggeredtrue/false の制御だけやっているので、実装の違いがあるんだな。

export const PROPS = [
];

export function onCheck() {
  if (card.triggered) {
    delete card.triggered;
    return {};
  }
}

export function onActorClicked() {
  card.triggered = true;
}

export function onResetGame() {
  delete card.triggered;
}