2015/12/25

RPGツクールMVのスクリプト言語一例

//乱数取得
rnd=Math.floor(Math.random()*10)+1; //1~10の乱数

//ゲーム変数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)
拍手する