LoginSignup
19
19

More than 5 years have passed since last update.

RPGツクールMV スクリプト基本編

Last updated at Posted at 2015-12-25
//乱数取得
rnd = Math.randomInt(10) + 1; //1~10の乱数
rnd = Math.floor(Math.random()*10)+1; //1~10の乱数
rnd = Math.floor(Math.random()*40)-20; //-20~20の乱数

//ゲーム変数1
$gameVariables.value(1)

//変数valueをゲーム変数nに代入
$gameVariables.setValue(n, value)

//ゲーム変数nにゲーム変数1とゲーム変数10を足した数を代入
$gameVariables.setValue(n, $gameVariables.value(1) + $gameVariables.value(10))

//スイッチ変数
$gameSwitches.value(スイッチの番号)

//if文の例(スイッチ番号がtrueなら括弧内処理)
if($gameSwitches.value(スイッチの番号){
処理
}
//if文の例(ゲーム変数2が10以内なら括弧内処理)
if($gameVariables.value(2) <=10){
処理
}

//アクター番号がパーティーにいたらtrueを返す
$gameParty.members().contains($gameActors.actor(アクター番号))
//アクターの名前取得
$gameActors.actor(アクター番号).name
//アクター番号がスキル番号をもっていたらtrue
$gameActors.actor(アクター番号).isLearnedSkill(スキル番号)
//アクター番号がスキル武器番号
$gameActors.actor(アクター番号).hasWeapon($dataWeapons[武器ID])

//キャラの向き(-1がプレイヤー 0がこのイベント 残りの数はイベント番号
//(↓2 ←4 →6 ↑8)
this.character(イベント番号).direction()

//アイテム、武器番号があったらtrue
$gameParty.hasItem($dataItems[アイテム番号])
$gameParty.hasItem($dataWeapons[武器番号], 装備も含めるtrue/false)

//プレイヤーの座標取得
this.character(-1).x
this.character(-1).y
//このイベントの座標取得
this.character(0).x
this.character(0).y
//イベントの座標取得
this.character(イベント番号).x
this.character(イベント番号).y

//地形タグの取得
$gameMap.terrainTag(x座標, y座標)
//リージョン番号取得
$gameMap.regionId(x座標, y座標)
//イベント番号取得
$gameMap.eventIdXy(x座標, y座標)

ホームページ
http://cg-tutorial-spirits.blogspot.jp/

19
19
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
19