Bonjour,
Tout d'abord merci de m'aider highlandsbaron
Voici ce que j'ai trouvé :
Generate Code:
Nummer på bokstaven.
1 = First letter in User Name (Scrambled+2)
2 = Herotype
3 = Second letter in User Name (Scrambled+3)
4 = Item in slot 1
5 = Third letter in User Name (Scrambled+5)
6 = Item in slot 2
7 = Last letter in User Name (Scrambled +1)
8 = Item in slot 3
9 = Näst sista bokstaven i User Name (Scrambled-1)
10 = Item in slot 4
11 = Item in slot 5
12 = Item in slot 6
-------------------------------------------------------
function GetPlayersInGame takes nothing returns integer
local integer playerIndex
local player indexPlayer
local integer number = 0
set playerIndex = 0
loop
set indexPlayer = Player(playerIndex)
if ((GetPlayerSlotState(indexPlayer) == PLAYER_SLOT_STATE_PLAYING) or (GetPlayerSlotState(indexPlayer) == PLAYER_SLOT_STATE_LEFT)) and (GetPlayerController(indexPlayer) == MAP_CONTROL_USER) then
set number = number + 1
endif
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
set indexPlayer = null
return number
endfunction
function Trig_SAVE_Conditions takes nothing returns boolean
if (GetPlayersInGame() == 1) then
return false
elseif (udg_heroes[GetPlayerId(GetTriggerPlayer())+1] == null) then
return false
endif
return true
endfunction
function Trig_SAVE_Actions takes nothing returns nothing
local integer sforce = GetRandomInt(1,59)
// Scramble Force
set udg_TempString = ScrambleLetter(udg_letters[0], sforce)
// First letter in Player Name
set udg_TempString = udg_TempString + ScrambleLetter(SubStringBJ(GetPlayerName(GetTriggerPlayer()), 1,1), sforce)
// Hero Type
set udg_TempString = udg_TempString + GetSaveHeroType(GetPlayerId(GetTriggerPlayer())+1, sforce)
// Second letter in Player Name
set udg_TempString = udg_TempString + ScrambleLetter(SubStringBJ(GetPlayerName(GetTriggerPlayer()), 2,2), sforce)
// Item in 1st Slot
set udg_TempString = udg_TempString + GetSaveItemType(GetPlayerId(GetTriggerPlayer())+1, 1, sforce)
// Third letter in Player Name
set udg_TempString = udg_TempString + ScrambleLetter(SubStringBJ(GetPlayerName(GetTriggerPlayer()), 3,3), sforce)
// Item in 2nd Slot
set udg_TempString = udg_TempString + GetSaveItemType(GetPlayerId(GetTriggerPlayer())+1, 2, sforce)
// Last letter in Player Name
set udg_TempString = udg_TempString + ScrambleLetter(SubStringBJ(GetPlayerName(GetTriggerPlayer()), StringLength(GetPlayerName(GetTriggerPlayer())),StringLength(GetPlayerName(GetTriggerPlayer()))), sforce)
// Item in 3rd Slot
set udg_TempString = udg_TempString + GetSaveItemType(GetPlayerId(GetTriggerPlayer())+1, 3, sforce)
// Ex-last letter in Player Name
set udg_TempString = udg_TempString + ScrambleLetter(SubStringBJ(GetPlayerName(GetTriggerPlayer()), StringLength(GetPlayerName(GetTriggerPlayer()))-1,StringLength(GetPlayerName(GetTriggerPlayer()))-1), sforce)
// Item in 4th Slot
set udg_TempString = udg_TempString + GetSaveItemType(GetPlayerId(GetTriggerPlayer())+1, 4, sforce)
// Item in 5th Slot
set udg_TempString = udg_TempString + GetSaveItemType(GetPlayerId(GetTriggerPlayer())+1, 5, sforce)
// Item in 6th Slot
set udg_TempString = udg_TempString + GetSaveItemType(GetPlayerId(GetTriggerPlayer())+1, 6, sforce)
// Hero-Level
set udg_TempString = udg_TempString + ScrambleLetter(udg_letters[GetHeroLevel(udg_heroes[GetPlayerId(GetTriggerPlayer())+1])], sforce)
// Item Bool
if (UnitInventoryCount(udg_heroes[GetPlayerId(GetTriggerPlayer())+1]) > 0) then
set udg_TempString = udg_TempString + ScrambleLetter(udg_letters[52], sforce)
else
set udg_TempString = udg_TempString + ScrambleLetter(udg_letters[GetRandomInt(0,51)], sforce)
endif
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0,0,50, "Saved. To load, type:")
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0,0,50, "-load " + ColorString(udg_TempString))
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0,0,50, "You can only load from the same profile(name) again.")
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0,0,50, " ")
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0,0,50, " ")
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0,0,50, " ")
endfunction
//===========================================================================
function InitTrig_SAVE takes nothing returns nothing
set gg_trg_SAVE = CreateTrigger( )
call TriggerAddAction( gg_trg_SAVE, function Trig_SAVE_Actions )
call TriggerAddCondition(gg_trg_SAVE,Condition(function Trig_SAVE_Conditions))
endfunction
j'ai pas compris grand chose à part que c'est grâce à sa que j'aurai le code une fois sauver..
il y a un texte pour load aussi que je vous épargnerais :hein:
Init
Evements : Map initialization
Action :
Cache du jeu - Create a game cache from WoWMCSave.w3v
Set savedhash = (last created game cache)
Cache du jeu - Reload all game cache date from disk
Boucle - Actions :
Déclencheur - Add to SAVE <gen> the event [Joueur - (Picked player) types a chat message containing -save as Résultat équivalent]
Déclencheur - Add to LOAD <gen> the event [Joueur - (picked player) types a chat message containing -load as Une sous-chaîne]
--SAVE Heroes--
Set SAVE_Hero[0] = Human lcFFFF80COPaladinlr (et ainsi de suite pour chaqu'un des héros)
Voilà c'est tout ce que j'ai trouvé concernant ce fameux SAVE :rateau:
C'est une map qui se joue en ligne, je souhaiterai comprendre comment sauvegarder et si on le peut vraiment ? sinon comment rajouter cette fonction si possible.. :heu:
Désolé pour le flood :eek: et
Merci Beaucoup de vôtre aide :love: