Light RPG forum
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.



 
AccueilPortailRechercherDernières imagesS'enregistrerConnexion
Le Deal du moment : -39%
Pack Home Cinéma Magnat Monitor : Ampli DENON ...
Voir le deal
1190 €

 

 Raccourci vers les items

Aller en bas 
AuteurMessage
Arkalion
Seigneur de la lumière
Seigneur de la lumière
Arkalion


Masculin Nombre de messages : 260
Age : 32
Localisation : Canada/Québec/...chez moi
Date d'inscription : 26/04/2006

Raccourci vers les items Empty
MessageSujet: Raccourci vers les items   Raccourci vers les items EmptySam 3 Juin - 9:54

Raccourci vers objets

Auteur: Evil-Ro


Info: Une petite fenêtre s'affichera sur le bord de votre écran, affichant les objets posséder dans votre inventaire. En appuyant sur 1, 2, ou 3, un des objet seras utiliser automatiquement depuis la carte, parfait pour un jeu a la Zelda.

Screen: Raccourci vers les items Screenpots2sw


Dernière édition par le Dim 11 Juin - 9:44, édité 2 fois
Revenir en haut Aller en bas
https://lightrpg.forumpro.fr
Arkalion
Seigneur de la lumière
Seigneur de la lumière
Arkalion


Masculin Nombre de messages : 260
Age : 32
Localisation : Canada/Québec/...chez moi
Date d'inscription : 26/04/2006

Raccourci vers les items Empty
MessageSujet: Re: Raccourci vers les items   Raccourci vers les items EmptySam 3 Juin - 9:55

Scripte:
Remplacez "Scene_Map" par ce script :

Citation :
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------

class Scene_Map
# ------------------------------------
def main
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
@pots = Window_Itemshow.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@message_window.dispose
@pots.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
end
# ------------------------------------
def update
loop do
$game_map.update
$game_system.map_interpreter.update
$game_player.update
$game_system.update
$game_screen.update
unless $game_temp.player_transferring
break
end
transfer_player
if $game_temp.transition_processing
break
end
end
@spriteset.update
@message_window.update
@pots.update
if $game_temp.gameover
$scene = Scene_Gameover.new
return
end
if $game_temp.to_title
$scene = Scene_Title.new
return
end
if $game_temp.transition_processing
$game_temp.transition_processing = false
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
if $game_temp.message_window_showing
return
end
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
$game_temp.battle_calling = true
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
n = rand($game_map.encounter_list.size)
$game_temp.battle_troop_id = $game_map.encounter_list[n]
end
end
if Input.trigger?(Input::B)
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
if $DEBUG and Input.press?(Input::F9)
$game_temp.debug_calling = true
end
unless $game_player.moving?
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
# ------------------------------------
def call_battle
$game_temp.battle_calling = false
$game_temp.menu_calling = false
$game_temp.menu_beep = false
$game_player.make_encounter_count
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)
$game_player.straighten
$scene = Scene_Battle.new
end
# ------------------------------------
def call_shop
$game_temp.shop_calling = false
$game_player.straighten
$scene = Scene_Shop.new
end
# ------------------------------------
def call_name
$game_temp.name_calling = false
$game_player.straighten
$scene = Scene_Name.new
end
# ------------------------------------
def call_menu
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Menu.new
end
# ------------------------------------
def call_save
$game_player.straighten
$scene = Scene_Save.new
end
# ------------------------------------
def call_debug
$game_temp.debug_calling = false
$game_system.se_play($data_system.decision_se)
$game_player.straighten
$scene = Scene_Debug.new
end
# ------------------------------------
def transfer_player
$game_temp.player_transferring = false
if $game_map.map_id != $game_temp.player_new_map_id
$game_map.setup($game_temp.player_new_map_id)
end
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
case $game_temp.player_new_direction
when 2
$game_player.turn_down
when 4
$game_player.turn_left
when 6
$game_player.turn_right
when 8
$game_player.turn_up
end
$game_player.straighten
$game_map.update
@spriteset.dispose
@spriteset = Spriteset_Map.new
if $game_temp.transition_processing
$game_temp.transition_processing = false
Graphics.transition(20)
end
$game_map.autoplay
Graphics.frame_reset
Input.update
end
end
Revenir en haut Aller en bas
https://lightrpg.forumpro.fr
Arkalion
Seigneur de la lumière
Seigneur de la lumière
Arkalion


Masculin Nombre de messages : 260
Age : 32
Localisation : Canada/Québec/...chez moi
Date d'inscription : 26/04/2006

Raccourci vers les items Empty
MessageSujet: Re: Raccourci vers les items   Raccourci vers les items EmptySam 3 Juin - 9:57

Ensuite, collez celui ci au dessus de Main (en le nommant Raccourci (ou comme vous voulez)):

Citation :

class Game_Party
attr_reader :items
end

#------------------------------------------------------------------------------
# Window_Itemshow
# By: Evil_RO
# Fixed and Edited By: Ace of Spades
#------------------------------------------------------------------------------

class Window_Itemshow < Window_Base

$Item_1 = 001
$Item_2 = 004
$Item_3 = 007
Actor = 0
#--------------------------------------------------------------------------
# - Inicio de Objetos...
#--------------------------------------------------------------------------
def initialize
super(0, 360, 120, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 12

update
end
#--------------------------------------------------------------------------
# - Actualizacion
#--------------------------------------------------------------------------
def update

self.contents.clear
x = 0
y = 2

if $game_party.items.include?($Item_1)


draw_item_name($data_items[$data_items[$Item_1].id], x, y)

self.contents.draw_text(x, y+10, 30, 20, $game_party.item_number($Item_1).to_s)

end
if $game_party.items.include?($Item_2)

draw_item_name($data_items[$data_items[$Item_2].id], x, y+25)

self.contents.draw_text(x, y+35, 30, 20, $game_party.item_number($Item_2).to_s)

end
if $game_party.items.include?($Item_3)

draw_item_name($data_items[$data_items[$Item_3].id], x, y+50)

self.contents.draw_text(x, y+60, 30, 20, $game_party.item_number($Item_3).to_s)
end


if Input.get_numbers == "1" && @hit1 != true
if $game_party.item_can_use?($data_items[$Item_1].id)
$game_party.actors[Actor].item_effect($data_items[$Item_1])
$game_system.se_play($data_items[$Item_1].menu_se)
if $data_items[$Item_1].common_event_id > 0
$game_temp.common_event_id = $data_items[$Item_1].common_event_id
end
if $data_items[$Item_1].consumable
$game_party.lose_item($data_items[$Item_1].id, 1)
end
else $game_system.se_play($data_system.buzzer_se)
end
@hit1 = true
elsif Input.get_numbers != "1"
@hit1 = false
end

if Input.get_numbers == "2" && @hit2 != true
if $game_party.item_can_use?($data_items[$Item_2].id)
$game_party.actors[Actor].item_effect($data_items[$Item_2])
$game_system.se_play($data_items[$Item_2].menu_se)
if $data_items[$Item_2].common_event_id > 0
$game_temp.common_event_id = $data_items[$Item_2].common_event_id
end
if $data_items[$Item_2].consumable
$game_party.lose_item($data_items[$Item_2].id, 1)
end
else $game_system.se_play($data_system.buzzer_se)
end
@hit2 = true
elsif Input.get_numbers != "2"
@hit2 = false
end

if Input.get_numbers == "3" && @hit3 != true
if $game_party.item_can_use?($data_items[$Item_3].id)
$game_party.actors[Actor].item_effect($data_items[$Item_3])
$game_system.se_play($data_items[$Item_3].menu_se)
if $data_items[$Item_3].common_event_id > 0
$game_temp.common_event_id = $data_items[$Item_3].common_event_id
end
if $data_items[$Item_3].consumable
$game_party.lose_item($data_items[$Item_3].id, 1)
end
else $game_system.se_play($data_system.buzzer_se)
end
@hit3 = true
elsif Input.get_numbers != "3"
@hit3 = false
end

end
end

#Fixes Made By Ace of Spades:
###########################################################
#Added: To change items, simply use call script: $Item_1 = New Item ID #
#Added: Buzzer sound effect when no more items. #
#Added: Now works with items that call common events. #
#Fixed: The hot key can't be held to use items. #
#Fixed: Nonconsumable items aren't lost when used. #
#Fixed: Now plays the item's specific sound effect when used instead of confirm sound effect. #
#########################################################
Revenir en haut Aller en bas
https://lightrpg.forumpro.fr
Arkalion
Seigneur de la lumière
Seigneur de la lumière
Arkalion


Masculin Nombre de messages : 260
Age : 32
Localisation : Canada/Québec/...chez moi
Date d'inscription : 26/04/2006

Raccourci vers les items Empty
MessageSujet: Re: Raccourci vers les items   Raccourci vers les items EmptySam 3 Juin - 9:58

Puis un 3eme, a mettre en dessous de "Scene_Debug" :



Citation :
#=============================================
# ** Keyboard Input Module
#============================================
# Near Fantastica
# Version 5
# 29.11.05
#============================================
# The Keyboard Input Module is designed to function as the default Input module
# dose. It is better then other methods keyboard input because as a key is
# tested it is not removed form the list. so you can test the same key multiple
# times the same loop.
#============================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Keyboard Input", "Near Fantastica", 5, "29.11.05")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Keyboard Input") == true

module Keyboard
#--------------------------------------------------------------------------
@keys = []
@pressed = []
Mouse_Left = 1
Mouse_Right = 2
Back= 8
Tab = 9
Enter = 13
Shift = 16
Ctrl = 17
Alt = 18
Esc = 27
Space = 32
Numberkeys = {}
Numberkeys[0] = 48
Numberkeys[1] = 49
Numberkeys[2] = 50
Numberkeys[3] = 51
Numberkeys[4] = 52
Numberkeys[5] = 53
Numberkeys[6] = 54
Numberkeys[7] = 55
Numberkeys[8] = 56
Numberkeys[9] = 57
Numberpad = {}
Numberpad[0] = 45
Numberpad[1] = 35
Numberpad[2] = 40
Numberpad[3] = 34
Numberpad[4] = 37
Numberpad[5] = 12
Numberpad[6] = 39
Numberpad[7] = 36
Numberpad[8] = 38
Numberpad[9] = 33
Letters = {}
Letters["A"] = 65
Letters["B"] = 66
Letters["C"] = 67
Letters["D"] = 68
Letters["E"] = 69
Letters["F"] = 70
Letters["G"] = 71
Letters["H"] = 72
Letters["I"] = 73
Letters["J"] = 74
Letters["K"] = 75
Letters["L"] = 76
Letters["M"] = 77
Letters["N"] = 78
Letters["O"] = 79
Letters["P"] = 80
Letters["Q"] = 81
Letters["R"] = 82
Letters["S"] = 83
Letters["T"] = 84
Letters["U"] = 85
Letters["V"] = 86
Letters["W"] = 87
Letters["X"] = 88
Letters["Y"] = 89
Letters["Z"] = 90
Fkeys = {}
Fkeys[1] = 112
Fkeys[2] = 113
Fkeys[3] = 114
Fkeys[4] = 115
Fkeys[5] = 116
Fkeys[6] = 117
Fkeys[7] = 118
Fkeys[8] = 119
Fkeys[9] = 120
Fkeys[10] = 121
Fkeys[11] = 122
Fkeys[12] = 123
Collon = 186
Equal = 187
Comma = 188
Underscore = 189
Dot = 190
Backslash = 191
Lb = 219
Rb = 221
Quote = 222
State = Win32API.new("user32","GetKeyState",['i'],'i')
Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
#--------------------------------------------------------------------------
def Keyboard.getstate(key)
return true unless State.call(key).between?(0, 1)
return false
end
#--------------------------------------------------------------------------
def Keyboard.testkey(key)
Key.call(key) & 0x01 == 1
end
#--------------------------------------------------------------------------
def Keyboard.update
@keys = []
@keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left)
@keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right)
@keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back)
@keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab)
@keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter)
@keys.push(Keyboard::Shift) if Keyboard.testkey(Keyboard::Shift)
@keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl)
@keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt)
@keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc)
@keys.push(Keyboard::Space) if Keyboard.testkey(Keyboard::Space)
for key in Keyboard::Numberkeys.values
@keys.push(key) if Keyboard.testkey(key)
end
for key in Keyboard::Numberpad.values
@keys.push(key) if Keyboard.testkey(key)
end
for key in Keyboard::Letters.values
@keys.push(key) if Keyboard.testkey(key)
end
for key in Keyboard::Fkeys.values
@keys.push(key) if Keyboard.testkey(key)
end
@keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon)
@keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal)
@keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma)
@keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore)
@keys.push(Keyboard::Dot) if Keyboard.testkey(Keyboard::Dot)
@keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash)
@keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb)
@keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb)
@keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote)
@pressed = []
@pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left)
@pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right)
@pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back)
@pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab)
@pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter)
@pressed.push(Keyboard::Shift) if Keyboard.getstate(Keyboard::Shift)
@pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl)
@pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt)
@pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc)
@pressed.push(Keyboard::Space) if Keyboard.getstate(Keyboard::Space)
for key in Keyboard::Numberkeys.values
@pressed.push(key) if Keyboard.getstate(key)
end
for key in Keyboard::Numberpad.values
@pressed.push(key) if Keyboard.getstate(key)
end
for key in Keyboard::Letters.values
@pressed.push(key) if Keyboard.getstate(key)
end
for key in Keyboard::Fkeys.values
@pressed.push(key) if Keyboard.getstate(key)
end
@pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon)
@pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal)
@pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma)
@pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore)
@pressed.push(Keyboard::Dot) if Keyboard.getstate(Keyboard::Dot)
@pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash)
@pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb)
@pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb)
@pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote)
end
#--------------------------------------------------------------------------
def Keyboard.trigger?(key)
return true if @keys.include?(key)
return false
end
#--------------------------------------------------------------------------
def Keyboard.pressed?(key)
return true if @pressed.include?(key)
return false
end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
Revenir en haut Aller en bas
https://lightrpg.forumpro.fr
Contenu sponsorisé





Raccourci vers les items Empty
MessageSujet: Re: Raccourci vers les items   Raccourci vers les items Empty

Revenir en haut Aller en bas
 
Raccourci vers les items
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Light RPG forum :: Rpg Maker :: Scriptes-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser