Skip to content

Instantly share code, notes, and snippets.

@triacontane
Last active May 29, 2018 14:42
Show Gist options
  • Select an option

  • Save triacontane/5079e4ac747d5678522b12c74fbb4b38 to your computer and use it in GitHub Desktop.

Select an option

Save triacontane/5079e4ac747d5678522b12c74fbb4b38 to your computer and use it in GitHub Desktop.
モジュール変数
$aaaaa = 3
module Kinoko
VALUE1 = 1 # モジュール変数の定義 : OK
VALUE2 = $game_variables[3] # モジュール変数にゲーム変数を設定 : エラー($game_variablesが未定義なので)
VALUE4 = $aaaaa # モジュール変数にグローバル変数を設定 : OK(ただし、$aaaaaに値を再代入してもVALUE4の値に変化なし)
VALUE5 = 0
end
# イベントコマンドの「スクリプト」から実行
Kinoko::VALUE1 = 2 # 定義している変数の変更 : OK
Kinoko::VALUE3 = 3 # 定義していない変数の変更 : OK
Kinoko::VALUE5 = $game_variables[3] # ゲーム変数を設定 : OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment