Sujet n°13821
Posté par Malwolf le 31 Mai - 13:59 (2014)
Titre : [Résolu PSP4G]Paramétrer les attaques d'un Pokémon déterminé
Bonjour,

J'aimerais savoir si avec la commande pour faire un combat Pokémon déterminé il est possible de lui régler ses attaques, comme pour les dresseurs.

Par exemple je voudrais un SPECTRUM, SHINEY, Nv.50 qui connait les capacités HYPNOSE, DEVORÊVE, SOIN et MALÉDICTION.
Donc je fais "demarrer_combat("SPECTRUM", 50, true, true)" mais pour les attaques je les rajoutes ou ? Spiky

PS : Pareil pour les EV, si on veut paramétrer, where is it ?

Merci, d'avance !

Cordialement, Malwolf.

Posté par Schneitizel le 31 Mai - 14:57 (2014)
Essaye :

Code:
demarrer_combat({"ID" => 93, "NV" => 50, "MOVE" => ["HYPNOSE", "DEVORÊVE", "SOIN", "MALEDICITON"], "Shiny" => true})

Posté par Malwolf le 31 Mai - 15:09 (2014)
Merci, sa aurait été logique mais ce fut un échec voilà le Log.

Log
---------- Erreur de script : Interpreter Bis ----------
----- Type
ArgumentError

----- Message
(eval):1:in `demarrer_combat'wrong number of arguments(1 for 2)

----- Position dans Interpreter Bis
Ligne 445

----- Backtrace
Script : Interpreter Bis | Ligne : 445 | Méthode : in `command_355'
Script : Loading | Ligne : 1 | Méthode : in `command_355'
Script : Interpreter 2 | Ligne : 215 | Méthode : in `eval'
Script : Interpreter Bis | Ligne : 445 | Méthode : in `command_355'
Script : Interpreter 2 | Ligne : 215 | Méthode : in `execute_command'
Script : Interpreter 1 | Ligne : 199 | Méthode : in `update'
Script : Interpreter 1 | Ligne : 113 | Méthode : in `loop'
Script : Interpreter 1 | Ligne : 204 | Méthode : in `update'
Script : Scene_Map | Ligne : 51 | Méthode : in `alias_update'
Script : Scene_Map | Ligne : 48 | Méthode : in `loop'
Script : Scene_Map | Ligne : 67 | Méthode : in `alias_update'
Script : MAPPANEL | Ligne : 90 | Méthode : in `old_update'
Script : TempsJourNuit | Ligne : 248 | Méthode : in `update_passminimap'
Script : Minimap | Ligne : 44 | Méthode : in `update'
Script : Scene_Map | Ligne : 25 | Méthode : in `old_main'
Script : Scene_Map | Ligne : 19 | Méthode : in `loop'
Script : Scene_Map | Ligne : 30 | Méthode : in `old_main'
Script : TempsJourNuit | Ligne : 237 | Méthode : in `main_passminimap'
Script : Minimap | Ligne : 31 | Méthode : in `main'
Script : Main | Ligne : 51


Sa doit être encore une erreur de script bidon, mais les scripts et moi sa fait pas bon marché..

Encore merci, si t'arrive à me trouver une solution, cher Schneitizel.

Cordialement, Malwolf.

Posté par Dark_Ray le 31 Mai - 17:20 (2014)
A moins de faire une modification de script, tu ne peux pas démarrer un combat contre un Pokémon custom de cette manière ^^

Ce script est défini dans Interpreter :

Spoiler
def call_battle_wild(id_data, level, shiny = false, ia = false)
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
if id_data.type == Fixnum
id = id_data
elsif id_data.type == String
id = id_conversion(id_data)
end
pokemon = Pokemon.new(id, level, shiny)
pokemon.form=$game_variables[356] if $game_variables[356] != 0
$scene = Pokemon_Battle_Wild.new($pokemon_party, pokemon, ia)
@wait_count = 2
return true
end
alias demarrer_combat call_battle_wild

Posté par Schneitizel le 31 Mai - 18:47 (2014)
Le morceau de code de Doc est visiblement custom, donc dans "Intepereter", cherche :

def call_battle_wild(id_data, level, shiny = false, ia = false)

Tu auras quelques lignes ensuite, remplace :

Code:
def call_battle_wild(id_data, level, shiny = false, ia = false)
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    if id_data.type == Fixnum
      id = id_data
    elsif id_data.type == String
      id = id_conversion(id_data)
    end
    pokemon = Pokemon.new(id, level, shiny)
    $scene = Pokemon_Battle_Wild.new($pokemon_party, pokemon, ia)
    @wait_count = 2
    return true
  end
  alias demarrer_combat call_battle_wild


par

Code:
def call_battle_wild(id_data, level, shiny = false, ia = false, moves = [nil, nil, nil, nil])
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    if id_data.type == Fixnum
      id = id_data
    elsif id_data.type == String
      id = id_conversion(id_data)
    end
    pokemon = Pokemon.new(id, level, shiny)
for a in 0..3
if moves[a] != nil
pokemon.skills_set[a] = moves[a]
end
end
    $scene = Pokemon_Battle_Wild.new($pokemon_party, pokemon, ia)
    @wait_count = 2
    return true
  end
  alias demarrer_combat call_battle_wild


Et donc, tu pourras appeler ton combat, comme :

Code:
demarrer_combat("SPECTRUM", 50, true, true, ["HYPNOSE", "DEVORÊVE", "SOIN", "MALEDICITON"])


Et voila Imbécile heureux

Posté par Valken le 31 Mai - 20:01 (2014)
Pour les EV, va voir cette script : ./2088-Preciser-les-EV-et-la-nature-des-…

Posté par Malwolf le 1 Juin - 19:31 (2014)
Bonsoir,

Ouah, merci à tous pour votre participation à l'aide de mon problème.
Sa sera récompensé par une apparition dans les crédits du jeu à sa sortie sa ! Soumission

Je vais tester tout sa, je vous tiens au courant.

EDIT du 01/06/2014 à 12:10 :

Petit problème, il a pas l'air de savoir ce que c'est "HYPNOSE" comme attaque, j'ai changé l'ordre des attaques, mais c'est pareil.
Donc sa à crash, j'ai récupérer le Log, encore merci pour votre aide.

Log
---------- Erreur de script : Interpreter Bis ----------
----- Type
NoMethodError

----- Message
- ARGS - []
Section142:1439:in `temp_skill_effect_reset'undefined method `enable' for "HYPNOSE":String

----- Position dans Interpreter Bis
Ligne 445

----- Backtrace
Script : Interpreter Bis | Ligne : 445 | Méthode : in `command_355'
Script : Pokemon | Ligne : 1438 | Méthode : in `each'
Script : Pokemon | Ligne : 1438 | Méthode : in `temp_skill_effect_reset'
Script : Pokemon_Custom | Ligne : 207 | Méthode : in `skill_effect_reset'
Script : Pokemon_Battle_Wild | Ligne : 114 | Méthode : in `initialize'
Script : Interpreter | Ligne : 35 | Méthode : in `new'
Script : Interpreter | Ligne : 35 | Méthode : in `demarrer_combat'
Script : Loading | Ligne : 1 | Méthode : in `command_355'
Script : Interpreter 2 | Ligne : 215 | Méthode : in `eval'
Script : Interpreter Bis | Ligne : 445 | Méthode : in `command_355'
Script : Interpreter 2 | Ligne : 215 | Méthode : in `execute_command'
Script : Interpreter 1 | Ligne : 199 | Méthode : in `update'
Script : Interpreter 1 | Ligne : 113 | Méthode : in `loop'
Script : Interpreter 1 | Ligne : 204 | Méthode : in `update'
Script : Scene_Map | Ligne : 51 | Méthode : in `alias_update'
Script : Scene_Map | Ligne : 48 | Méthode : in `loop'
Script : Scene_Map | Ligne : 67 | Méthode : in `alias_update'
Script : MAPPANEL | Ligne : 90 | Méthode : in `old_update'
Script : TempsJourNuit | Ligne : 248 | Méthode : in `update_passminimap'
Script : Minimap | Ligne : 44 | Méthode : in `update'
Script : Scene_Map | Ligne : 25 | Méthode : in `old_main'
Script : Scene_Map | Ligne : 19 | Méthode : in `loop'
Script : Scene_Map | Ligne : 30 | Méthode : in `old_main'
Script : TempsJourNuit | Ligne : 237 | Méthode : in `main_passminimap'
Script : Minimap | Ligne : 31 | Méthode : in `main'
Script : Main | Ligne : 51



Encore merci à tous !

Cordialement, Malwolf.

Posté par Dark_Ray le 1 Juin - 20:18 (2014)
Ajoute plutôt ça dans l'Interpreter :

Spoiler
def call_battle_wild_parameter(hash, ia = false)
if hash["ID"] == nil or hash["NV"] == nil
return
end
pokemon = Pokemon.new(hash["ID"], hash["NV"], hash["SHINY"])
if hash["GR"] != nil and [0, 1, 2, "F", "G", "I"].include?(hash["GR"])
pokemon.set_gender(hash["GR"])
end
if hash["FORM"] != nil
pokemon.form = hash["FORM"]
end
if hash["MOVE"] != nil and hash["MOVE"].type == Array
i = 0
for skill in hash["MOVE"]
if skill != nil and skill != "AUCUN"
pokemon.skills_set[i] = Skill.new(Skill_Info.id(skill))
end
if skill == "AUCUN"
pokemon.skills_set[i] = nil
end
i += 1
end
pokemon.skills_set.compact!
end
if hash["OBJ"] != nil
if hash["OBJ"].type == Fixnum
pokemon.item_hold = hash["OBJ"]
elsif hash["OBJ"].type == String
pokemon.item_hold = Item.id(hash["OBJ"])
end
end
if hash["STAT"] != nil and hash["STAT"].type == Array and
hash["STAT"].length == 6
pokemon.dv_modifier(hash["STAT"])
end
$scene = Pokemon_Battle_Wild.new($pokemon_party, pokemon, ia)
@wait_count = 2
return true
end
alias demarrer_combat_param call_battle_wild_parameter


Ça te permet de générer un Pokémon sauvage avec la même méthode que le ajouter_pokemon y a que le nom qui change

demarrer_combat_param( hash )

Ou hash est de la forme :

{ "ID" => A, "NV" => B, "OBJ" => C, "MOVE" => ["ATK1", "ATK2", "ATK3", "ATK4"], "STAT" => [HP, AT, DF, VI, AS, DS], "GR" => D, "SHINY" => E, "FORM" => F }

(Seul ID et NV sont obligatoire si tu utilises cette méthode)


PS: Désolé de ne pas utiliser la balise code, mais chez moi elle bug horriblement xD

Posté par Malwolf le 1 Juin - 23:32 (2014)
Bonsoir,

Sa fonctionne du Tonnerre de Zeus ! Bouche extensible

Merci bien Doc Emmett Brown ! Falco Lombardi

Cordialement, Malwolf.