【求教】请问怎么识别玩家按下的按键呢
rpgmakermv吧
全部回复
仅看楼主
level 6
不是默认的那几个,比如我想要让玩家按下Tab键作为分歧条件,脚本应该要怎么写啊
2020年03月22日 15点03分 1
level 8
project1搜索全键盘脚本。
使用时需要用分期条件里的脚本
或者if else。
2020年03月22日 23点03分 2
level 6
解决了[酷]顺便问一下#判断是否持有物品(装备)的脚本要怎么理解
$gameActors.actor(actor_id).equips()[slot_id] == null;
*change null to id
——————
# 检查条件分支:如果[演员]有[武器]装备
# ----------------------------------------------
$game_actors[actor id].weapons.include?($data_weapons[weapon id])
right_hand = $game_actors[actor_id].equips[0]
left_hand = $game_actors[actor_id].equips[1]
#获取项目,替换你要找的装备的索引:
# 0 = right hand, 1 = left hand, 2 = head, 3 = body, 4 = accessory
# provided you're not using any scripts that change that. You can check their types with:
if right_hand.is_a?(RPG::Weapon)
# do something
elsif right_hand.is_a?(RPG::Armor)
# do something else
end
# Or get their properties with with:
right_hand.id
right_hand.name
right_hand.icon_index
right_hand.description
# etc..
# Example: if you want to check if you have a Prinny Gun equipped on your first weapon slot:
right_hand = $game_actors[actor_id].equips[0]
if !right_hand.nil? && right_hand.name.eql?("Prinny Gun")
# Do something
end
# You don't even need to keep track of the IDs, really (unless you want to, for some reason).
# If there's no way to not have a weapon equipped in your game, you can also take out the ".nil?" check.
2020年03月23日 00点03分 3
1