Worldedit Le site sur l'éditeur de warcraft 3 !
Voir le sujet précédent :: Voir le sujet suivant
Auteur
Message
louisdespi Floodeur prématuré Inscrit le: 21 Oct 2007 Messages: 437 Sujets: 70
Posté le: 30/10/07 15:29 Sujet du message: script .ai intelligence artificielle
Bonjour à tous, je pose se topic pour savoir si quelqu'un d'entre vous a deja un peu travaillé dans le war3.mpq/war3x.mpq au niveau des scripts. Exemple : Scripts\elf.ai ou encore Scripts\h06_purple.ai , tous ces scripts sont des intelligences artificielles utilisées dans les cartes melées ou dans les campagnes donc voila si quelqu'un s'y connait merci de me répondre je suis passionné par les intelligences artificielles.
Merci d'avance. _________________
Dernière édition par louisdespi le 11/07/09 15:24; édité 2 fois
Revenir en haut
louisdespi Floodeur prématuré Inscrit le: 21 Oct 2007 Messages: 437 Sujets: 70
Posté le: 30/10/07 16:09 Sujet du message:
moi perso j'ai quand même réussi une fois a changer le nombres de goules créée dans la dernière campagne des elfes de la nuit rien que en changeant se script sinon merci de venir repondre _________________
Revenir en haut
louisdespi Floodeur prématuré Inscrit le: 21 Oct 2007 Messages: 437 Sujets: 70
Posté le: 30/10/07 16:13 Sujet du message:
Secret:
Jass: //============================================================================
// Night Elf 07 -- any player -- AI Script
//============================================================================
globals
constant integer NORMAL_WAVE_DUR = 75 // seconds
constant integer HARD_WAVE_DUR = 75
constant integer NORM_ALLOW_TREES = 0
constant integer NORM_TREE_FACTOR = 5
constant integer NORM_BASE_BONUS = 0
constant integer NORM_BONUS_CAP = 10
constant integer HARD_ALLOW_TREES = 0
constant integer HARD_TREE_FACTOR = 4
constant integer HARD_BASE_BONUS = 1
constant integer HARD_BONUS_CAP = 10
constant integer PIT_STOP_WAVE = 0
constant integer BASIC_WAVE1 = 1
constant integer BASIC_WAVE2 = 2
constant integer AIR_WAVE = 3
constant integer ANTI_AIR_WAVE = 4
constant integer ANTIMAGIC_WAVE = 5
constant integer SIEGE_WAVE = 6
constant integer POSSESS_WAVE = 7
constant integer SKELETON_WAVE = 8
constant integer PLAGUE_WAVE = 9
constant integer BURNING_WAVE = 10
constant integer F_U1_WAVE = 11
constant integer F_U2_WAVE = 12
constant integer F_U3_WAVE = 13
constant integer CMD_SET_X1 = 1
constant integer CMD_SET_Y1 = 2
constant integer CMD_SET_SEQUENCE = 3
constant integer CMD_SET_TARGET = 4
constant integer CMD_STOP = 5
constant integer CMD_SET_X2 = 6
constant integer CMD_SET_Y2 = 7
constant integer BANSHEE_POSSESS = 'uC00'
constant integer BANSHEE_CURSE = 'uC01'
constant integer BANSHEE_ANTIMAGIC = 'uC02'
//constant integer NECRO_CRIPPLE = 'uC03'
//constant integer NECRO_RAISE = 'uC04'
//constant integer NECRO_UNHOLY = 'uC05'
//constant integer ? = 'uC06'
//constant integer ? = 'uC07'
constant integer BUILD_INFERNAL = 'nC08'
//constant integer ? = 'uC09'
//constant integer ? = 'uC10'
//constant integer ? = 'uC11'
constant integer GHOULZ = 'uC12'
player USER = Player (1)
integer stage_x1 = 0
integer stage_y1 = 0
integer stage_x2 = 0
integer stage_y2 = 0
boolean need_stage2 = true
boolean at_stage1 = false
boolean aborting = false
boolean send_lich = false
boolean send_lord = false
boolean send_azga = false
integer wave_count = 0
integer wave_restart = 0
integer strength = 0
integer target = 0
integer harvest_ghouls = 0
integer array wave_type
integer array wave_sleep
integer array wave_hero
endglobals
//============================================================================
// add_wave
//============================================================================
function add_wave takes integer whero , integer wtype returns nothing
set wave_hero [wave_count ] = whero
set wave_type [wave_count ] = wtype
if difficulty == HARD then
set wave_sleep [wave_count ] = HARD_WAVE_DUR
else
set wave_sleep [wave_count ] = NORMAL_WAVE_DUR
endif
set wave_count = wave_count + 1
endfunction
//============================================================================
// pit_stop
//============================================================================
function pit_stop takes integer ensecs , integer hsecs returns nothing
set wave_hero [wave_count ] = 0
set wave_type [wave_count ] = PIT_STOP_WAVE
if difficulty==HARD then
set wave_sleep [wave_count ] = hsecs
else
set wave_sleep [wave_count ] = ensecs
endif
set wave_count = wave_count + 1
endfunction
//============================================================================
// loop_waves
//============================================================================
function loop_waves takes nothing returns nothing
set wave_restart = wave_count
endfunction
//============================================================================
// setup_waves
//============================================================================
function setup_waves takes integer sequence returns nothing
call TraceI ("***** setup_waves (group %d) *****\n" ,sequence )
set wave_count = 0
//------------------------------------------------------------------------
if sequence == 1 then // Jaina
//------------------------------------------------------------------------
call add_wave ( 0, BASIC_WAVE1 )
call add_wave ( 0, BASIC_WAVE2 )
call add_wave ( 0, ANTIMAGIC_WAVE ) // Jaina theme
call add_wave ( LICH, POSSESS_WAVE )
call pit_stop ( 20, 20 )
call add_wave ( 0, ANTI_AIR_WAVE )
call add_wave ( 0, AIR_WAVE )
call pit_stop ( 30, 30 )
call add_wave ( DREAD_LORD, ANTIMAGIC_WAVE ) // Jaina theme
call add_wave ( LICH, POSSESS_WAVE )
call pit_stop ( 30, 30 )
call loop_waves ()
call add_wave ( PIT_LORD, F_U1_WAVE )
call pit_stop ( 40, 30 )
call add_wave ( DREAD_LORD, F_U2_WAVE )
call pit_stop ( 40, 30 )
call add_wave ( PIT_LORD, F_U3_WAVE )
//------------------------------------------------------------------------
elseif sequence == 2 then // Thrall
//------------------------------------------------------------------------
call add_wave ( 0, BASIC_WAVE1 )
call add_wave ( 0, BASIC_WAVE2 )
call add_wave ( DREAD_LORD, SIEGE_WAVE ) // Thrall theme
call add_wave ( LICH, SKELETON_WAVE )
call pit_stop ( 30, 30 )
call add_wave ( 0, ANTI_AIR_WAVE )
call add_wave ( 0, AIR_WAVE )
call pit_stop ( 30, 30 )
call add_wave ( LICH, SKELETON_WAVE ) // Thrall theme
call add_wave ( DREAD_LORD, SIEGE_WAVE )
call pit_stop ( 60, 30 )
call loop_waves ()
call add_wave ( PIT_LORD, F_U1_WAVE )
call pit_stop ( 40, 30 )
call add_wave ( DREAD_LORD, F_U2_WAVE )
call pit_stop ( 40, 30 )
call add_wave ( PIT_LORD, F_U3_WAVE )
//------------------------------------------------------------------------
else // sequence == 3 then // USER
//------------------------------------------------------------------------
call add_wave ( 0, BASIC_WAVE1 )
call add_wave ( 0, BASIC_WAVE2 )
call pit_stop ( 60, 40 )
call add_wave ( 0, AIR_WAVE )
call add_wave ( LICH, SKELETON_WAVE )
call pit_stop ( 60, 40 )
call add_wave ( 0, PLAGUE_WAVE ) // User theme
call add_wave ( DREAD_LORD, BURNING_WAVE )
call pit_stop ( 60, 40 )
call add_wave ( 0, ANTIMAGIC_WAVE ) // recap Jaina theme
call add_wave ( 0, POSSESS_WAVE )
call pit_stop ( 60, 40 )
call add_wave ( DREAD_LORD, SIEGE_WAVE ) // recap Thrall theme
call add_wave ( LICH, SKELETON_WAVE )
call pit_stop ( 60, 40 )
call loop_waves ()
call add_wave ( PIT_LORD, F_U1_WAVE )
call add_wave ( DREAD_LORD, F_U2_WAVE )
call add_wave ( PIT_LORD, F_U3_WAVE )
endif
endfunction
//============================================================================
// wave_units
//============================================================================
function wave_units takes integer norm , integer hard , integer unitid returns nothing
local integer adding
local integer index
if difficulty==HARD then
set adding = hard
else
set adding = norm
endif
if adding < 1 then
return
endif
// if unitid is already being built, add more to existing desires
//
set index = 0
loop
exitwhen index == harass_length
if harass_units[index ] == unitid then
set harass_qty[index ] = harass_qty[index ] + adding
set harass_max[index ] = harass_max[index ] + adding
return
endif
set index = index + 1
endloop
// if unitid is not in harass list then add this new unitid
//
set harass_qty [harass_length] = adding
set harass_max [harass_length] = adding
set harass_units [harass_length] = unitid
set harass_length = harass_length + 1
endfunction
//============================================================================
// do_BONUS_LOVE
//============================================================================
function do_BONUS_LOVE takes nothing returns nothing
call wave_units ( 1, 1, MEAT_WAGON )
endfunction
//============================================================================
// do_EVERY_WAVE_FIRST
//============================================================================
function do_EVERY_WAVE_FIRST takes nothing returns nothing
endfunction
//============================================================================
// do_EVERY_WAVE_LAST
//============================================================================
function do_EVERY_WAVE_LAST takes integer heroid returns nothing
if heroid != 0 then
call wave_units ( 1, 1, heroid ) // undead altar
call wave_units ( 1, 1, BANSHEE ) // temple of the damned
endif
endfunction
//============================================================================
// do_BASIC_WAVE1
//============================================================================
function do_BASIC_WAVE1 takes nothing returns nothing
call wave_units ( 18,30, GHOULZ ) // crypt
call wave_units ( 4, 6, CRYPT_FIEND ) // crypt
endfunction
//============================================================================
// do_BASIC_WAVE2
//============================================================================
function do_BASIC_WAVE2 takes nothing returns nothing
call wave_units ( 0, 1, MEAT_WAGON )
call wave_units ( 8,12, GHOULZ ) // crypt
call wave_units ( 5, 7, CRYPT_FIEND ) // crypt
endfunction
//============================================================================
// do_POSSESS_WAVE
//============================================================================
function do_POSSESS_WAVE takes nothing returns nothing
call wave_units ( 2, 3, ABOMINATION ) // slaughterhouse
call wave_units ( 8,10, BANSHEE_POSSESS ) // temple of the damned
endfunction
//============================================================================
// do_ANTIMAGIC_WAVE
//============================================================================
function do_ANTIMAGIC_WAVE takes nothing returns nothing
call wave_units ( 0, 1, MEAT_WAGON ) // slaughterhouse
call wave_units ( 2, 3, DOOMGUARD ) // crypt
call wave_units ( 6, 8, FELLHOUND ) // crypt
endfunction
//============================================================================
// do_AIR_WAVE
//============================================================================
function do_AIR_WAVE takes nothing returns nothing
call wave_units ( 6, 8, GARGOYLE ) // crypt
call wave_units ( 4, 5, FROST_WYRM ) // boneyard
endfunction
//============================================================================
// do_ANTI_AIR_WAVE
//============================================================================
function do_ANTI_AIR_WAVE takes nothing returns nothing
call wave_units ( 1, 2, DOOMGUARD ) // crypt
call wave_units ( 5, 7, CRYPT_FIEND ) // crypt
call wave_units ( 7, 9, GARGOYLE ) // crypt
endfunction
//============================================================================
// do_SIEGE_WAVE
//============================================================================
function do_SIEGE_WAVE takes nothing returns nothing
call wave_units ( 5, 7, MEAT_WAGON ) // slaughterhouse
call wave_units ( 5, 7, ABOMINATION ) // slaughterhouse
call wave_units ( 2, 3, FROST_WYRM ) // boneyard
endfunction
//============================================================================
// do_BURNING_WAVE
//============================================================================
function do_BURNING_WAVE takes nothing returns nothing
call wave_units ( 1, 2, DOOMGUARD ) // crypt
call wave_units ( 6, 8, BUILD_INFERNAL ) // crypt
endfunction
//============================================================================
// do_PLAGUE_WAVE
//============================================================================
function do_PLAGUE_WAVE takes nothing returns nothing
call wave_units ( 1, 2, MEAT_WAGON ) // slaughterhouse
call wave_units ( 4, 6, GHOULZ ) // crypt
call wave_units ( 5, 7, ABOMINATION ) // slaughterhouse
call wave_units ( 3, 4, NECRO ) // temple of the damned
endfunction
//============================================================================
// do_SKELETON_WAVE
//============================================================================
function do_SKELETON_WAVE takes nothing returns nothing
call wave_units ( 0, 1, MEAT_WAGON ) // slaughterhouse
call wave_units ( 4, 6, ABOMINATION ) // slaughterhouse
call wave_units ( 8,10, NECRO ) // temple of the damned
endfunction
//============================================================================
// do_F_U1_WAVE
//============================================================================
function do_F_U1_WAVE takes nothing returns nothing
call wave_units ( 1, 2, MEAT_WAGON ) // slaughterhouse
call wave_units ( 2, 3, DOOMGUARD ) // crypt
call wave_units ( 5, 7, FELLHOUND ) // crypt
call wave_units ( 2, 3, BANSHEE_CURSE ) // temple of the damned
call wave_units ( 2, 3, FROST_WYRM ) // boneyard
call wave_units ( 2, 3, NECRO ) // temple of the damned
endfunction
//============================================================================
// do_F_U2_WAVE
//============================================================================
function do_F_U2_WAVE takes nothing returns nothing
call wave_units ( 1, 2, MEAT_WAGON ) // slaughterhouse
call wave_units ( 2, 3, BUILD_INFERNAL ) // crypt
call wave_units ( 3, 5, ABOMINATION ) // slaughterhouse
call wave_units ( 4, 6, CRYPT_FIEND ) // crypt
call wave_units ( 2, 3, BANSHEE_CURSE ) // temple of the damned
call wave_units ( 2, 3, NECRO ) // temple of the damned
endfunction
//============================================================================
// do_F_U3_WAVE
//============================================================================
function do_F_U3_WAVE takes nothing returns nothing
call wave_units ( 2, 3, MEAT_WAGON ) // slaughterhouse
call wave_units ( 2, 3, BUILD_INFERNAL ) // crypt
call wave_units ( 3, 4, BANSHEE_POSSESS ) // temple of the damned
call wave_units ( 3, 4, DOOMGUARD ) // crypt
call wave_units ( 4, 5, FELLHOUND ) // crypt
call wave_units ( 2, 3, FROST_WYRM ) // boneyard
call wave_units ( 1, 1, LICH ) // undead altar
call wave_units ( 2, 3, NECRO ) // temple of the damned
endfunction
//============================================================================
// bonus_waves
//============================================================================
function bonus_waves takes integer allow , integer factor , integer base , integer cap returns integer
local integer trees = GetPlayerUnitTypeCount ( USER , ANCIENT_PROTECT )
local integer result
if trees <= allow or factor <= 0 then
return base
endif
set result = base + (trees - allow ) / factor + 1
if result > cap then
return cap
endif
return result
endfunction
Voici à quoi ressemble la moitier du script de la dernière campagne des elfes de la nuit dans reign of chaos (Je me demande si se n'est pas du jass). _________________
Dernière édition par louisdespi le 11/07/09 15:26; édité 4 fois
Revenir en haut
Valerian Membre reconnu Inscrit le: 26 Aoû 2007 Messages: 1005 Sujets: 59 Spécialité en worldedit: Dormir... heu non décors
Revenir en haut
louisdespi Floodeur prématuré Inscrit le: 21 Oct 2007 Messages: 437 Sujets: 70
Revenir en haut
Ayane Bot administrateur Inscrit le: 17 Sep 2007 Messages: 2012 Sujets: 49 Médailles: 2 (En savoir plus... )
Posté le: 30/10/07 16:51 Sujet du message:
C'est en effet du Jass, sauf que les fonctions natives ne sont pas les mêmes (elles sont définies dans common.ai).
Si tu veux facilement faire des IA tu as l'éditeur d'IA dans WorldEditor TFT. Evidemment il offre très peu de possibilités par rapport au script. _________________
Revenir en haut
louisdespi Floodeur prématuré Inscrit le: 21 Oct 2007 Messages: 437 Sujets: 70
Posté le: 30/10/07 17:11 Sujet du message:
Je sais, mais moi j'ai Reign of Chaos , c'est pour sa que je veut apprendre de plus je suis passionné par les intelligences artificielles, j'essaye de les comprendres, si tu t'y connais en jass si tu savait m'aider rien qu'à comprendre quelques petites choses genre se que veut dire :
Ca m'aiderais grandement! Merci beaucoup d'avance. _________________
Dernière édition par louisdespi le 11/07/09 15:30; édité 2 fois
Revenir en haut
Valerian Membre reconnu Inscrit le: 26 Aoû 2007 Messages: 1005 Sujets: 59 Spécialité en worldedit: Dormir... heu non décors
Posté le: 30/10/07 19:04 Sujet du message:
CALME TOI!!!! c'est pas avec sa qu'on va t'aider, de plus conjugue bien té verbe:
"si tu savait" = "si tu savais"
"Je peut" = "Je peux" _________________
Revenir en haut
louisdespi Floodeur prématuré Inscrit le: 21 Oct 2007 Messages: 437 Sujets: 70
Posté le: 30/10/07 19:09 Sujet du message:
Je suis désolé. C'est bon reste calme si j'écrit avec cette grandeur de texte c'est pour différencier le texte que j'écris et l'intelligence artificielle. _________________
Dernière édition par louisdespi le 11/07/09 15:31; édité 1 fois
Revenir en haut
louisdespi Floodeur prématuré Inscrit le: 21 Oct 2007 Messages: 437 Sujets: 70
Posté le: 30/10/07 19:12 Sujet du message:
en tout cas excusez moi si j'y ai été un peu fort désolé _________________
Revenir en haut
Ayane Bot administrateur Inscrit le: 17 Sep 2007 Messages: 2012 Sujets: 49 Médailles: 2 (En savoir plus... )
Posté le: 30/10/07 20:09 Sujet du message:
Jass: constant integer NORM_ALLOW_TREES = 0
constant: indique que l'on va déclarer une constante.
integer: elle sera de type entier
NORM_ALLOW_TREES: le nom de la constante
= 0: Affecte une valeur à cette constante. _________________
Revenir en haut
Gevans Back Inscrit le: 21 Aoû 2007 Messages: 1930 Sujets: 85 Médailles: 2 (En savoir plus... )
Posté le: 30/10/07 20:46 Sujet du message:
Pour le Jass il y a des tutos _________________Si vous recherchez quelque chose, il y a de très grandes chances que vous trouviez la réponse ici alors jetez y un oeil.
Topic indispensable
Revenir en haut
popp Floodeur prématuré Inscrit le: 28 Aoû 2007 Messages: 627 Sujets: 70 Spécialité en worldedit: le multiboard Gui :D
Revenir en haut
louisdespi Floodeur prématuré Inscrit le: 21 Oct 2007 Messages: 437 Sujets: 70
Posté le: 30/10/07 22:13 Sujet du message:
ok bon si jamais quelqu'un s'y connais mp moi. _________________
Revenir en haut
Ayane Bot administrateur Inscrit le: 17 Sep 2007 Messages: 2012 Sujets: 49 Médailles: 2 (En savoir plus... )
Posté le: 31/10/07 11:42 Sujet du message:
Comme le dit Vans, lisez les tutoriels sur le Jass. _________________
Revenir en haut
Vous ne pouvez pas poster de nouveaux sujets dans ce forum Vous ne pouvez pas répondre aux sujets dans ce forum Vous ne pouvez pas éditer vos messages dans ce forum Vous ne pouvez pas supprimer vos messages dans ce forum Vous ne pouvez pas voter dans les sondages de ce forum