(13 ratings)
|
|
Here is where i did all that save/load crap for the items and their charges. you'll have to put in conditions for every charged item you have though.
hmmm...can you add those triggers to a map pls?
im too lazy to create them on my own >_<
and im not that good with GUI =/
i would appreciate it if you could do that
lazy to add gui? Gosh
"because it would be simple enough to all coders..."
which its obviously not. lol.
but its the easiest out there...
it is the easiest i promise, i've been a guier for a long time before i went into vjass, ofc all are simple now when i know vjass (a)
lazy to add gui? Gosh
thnx dude +rep
dude chill
it's not only that im too lazy but also i don't understand anything about the triggers of this system
they are just too advanced for me
EDIT:
dude wtf? :O
when i saved, a text appeared "Items in your Bag will NOT be saved."
how can this system save charges and not the items?
is this some kind of joke? -.-
EDIT 2:
ok after all it wasn't a joke lol
i kinda combined the triggers and it managed to load with charges
but there is a problem...(as always -.-)
when i loaded all items had 2 charges and when i saved they had 6,4,10 =/
can you pls help me?
EDIT 3:
i think i found the problem
the variable called "Integer_A_Replacement" dosesn't have a variable type
and when i change it's type to integer some actions are disabled due to missing variables -.-
yeah i know im annoying but i really need this system =/
thnx dude +rep
dude chill
it's not only that im too lazy but also i don't understand anything about the triggers of this system
they are just too advanced for me
/
did you turn on the "create unknown variables" thingy in preferences?
also, that "the items in your bag wil not be saved" is for my map, its becuz you have a hero, AND an extra bag, therefore the "items in your bag wont be saved".
walktrough:
set preferences to "create unknown variables automaticly"
Copy triggers to your map,
Remove game message saying "items in the bag wont be saved"
Done. works.
i copied it into my map but when i want to test it the war3 just shows the menu
i have jngp
yes it's the latest but i disabled jass helper
modifications:
-added extra conditions to prevent the save of backpack
-changed bloodmage to own hero
i'm using this system in my orpg, it works well but how can i make it saving an extra hero(backpack) and it's items?
i've tried it and it won't works
added to the save heroes in the init the backpack and changed in the copy to only save the backpack
when i save it it makes mi a little different code but don't works, it won't load the backpack and won't write the wrong code thing
oooooh i haven't seen it yet, thx for the help but i still don't understand something...
when i typed -savebp it made me a code that in 8-9 letters differs from the hero code and when i typed -loadbp it hanven't sent the "your code is invalid" message
my guess, is that you forgot to add a [space] after the -loadbp, so it should be -loadbp[Space]still not workin :S
The problem, lies with these lines in the Load triggers for the backpack.
Since the entered string is "-loadbp " the substring shouldn't be 1,6 but 1,8 and the part after it shouldnt be "-load" but "-loadbp"....
- Conditions:
- (Substring((Entered chat string), 1, 6)) Equal to -load
- Actions:
- Set Code = (Substring((Entered chat string), 7, 999))
and the substring should also be changed in the action part obviously.
- Conditions:
- (Substring((Entered chat string), 1, 8)) Equal to -loadbp
- Actions:
- Set Code = (Substring((Entered chat string), 9, 999))
the hero load removes every player owned units first ~.~
here they are
- SaveLoad Init
- Events
- Map initialization
- Conditions
- Actions
- -------- Some configurables --------
- Set SaveLoad_Alphabet = aA5bB0cCdDeE9fFgGhH8iIj1mMn7NoOp3PqQrRsStTu2UJkK4lLvV6wWxXyYzZ
- Set SaveLoad_CheckName = True
- Set SaveLoad_HyphenSpace = 4
- Set SaveLoad_Lower = |c00ff0000
- Set SaveLoad_Number = |cff00ff00
- Set SaveLoad_Upper = |cffffcc00
- -------- Store all the items you want to be able to be saved below. --------
- Set SaveLoad_Item[1] = Ancestral Staff
- Set SaveLoad_Item[2] = Iron Staff
- Set SaveLoad_Item[3] = Mithril Staff
- Set SaveLoad_Item[4] = Neol's Scepter
- Set SaveLoad_Item[5] = Oak Staff
- Set SaveLoad_Item[6] = Silver Staff
- Set SaveLoad_Item[7] = Staff of the Druid
- Set SaveLoad_Item[8] = Staff of the Ice Queen
- Set SaveLoad_Item[9] = Staff of the Master Druid
- Set SaveLoad_Item[10] = Staff of the Necromancer
- Set SaveLoad_Item[11] = Steel Staff
- Set SaveLoad_Item[12] = Wooden Staff
- Set SaveLoad_Item[13] = Amulet of Flowing Power
- Set SaveLoad_Item[14] = Amulet of Manafeeder
- Set SaveLoad_Item[15] = Amulet of Spirit Balance
- Set SaveLoad_Item[16] = Copper Ring
- Set SaveLoad_Item[17] = Darksteel Ring
- Set SaveLoad_Item[18] = Necklace of the Phantom
- Set SaveLoad_Item[19] = Ring of Destruction
- Set SaveLoad_Item[20] = Ring of Regeneration
- Set SaveLoad_Item[21] = Ring of the Champion
- Set SaveLoad_Item[22] = Ring of the Rogue
- Set SaveLoad_Item[23] = Ring of the Wise
- Set SaveLoad_Item[24] = Coral Armor
- Set SaveLoad_Item[25] = Dragonskin Armor
- Set SaveLoad_Item[26] = Dragonskin Tunic
- Set SaveLoad_Item[27] = Iron Helmet
- Set SaveLoad_Item[28] = Leather Armor
- Set SaveLoad_Item[29] = Leather Helmet
- Set SaveLoad_Item[30] = Mithril Helmet
- Set SaveLoad_Item[31] = Reinforced Leather Armor
- Set SaveLoad_Item[32] = Reinforced Leather Tunic
- Set SaveLoad_Item[33] = Ritual Mask
- Set SaveLoad_Item[34] = Silk Tunic
- Set SaveLoad_Item[35] = Steel Helmet
- Set SaveLoad_Item[36] = Studded Leather Armor
- Set SaveLoad_Item[37] = Coral Sword
- Set SaveLoad_Item[38] = Iron Bow
- Set SaveLoad_Item[39] = Iron Sword
- Set SaveLoad_Item[40] = Mithril Bow
- Set SaveLoad_Item[41] = Mithril Sword
- Set SaveLoad_Item[42] = Oak Bow
- Set SaveLoad_Item[43] = Steel Bow
- Set SaveLoad_Item[44] = Steel Sword
- Set SaveLoad_Item[45] = Thieves Dagger
- Set SaveLoad_Item[46] = Wooden Bow
- Set SaveLoad_Item[47] = Wooden Sword
- Set SaveLoad_Item[48] = |c00ff0000Shivering Axe|r
- Set SaveLoad_Item[49] = |c00ff0000Shivering Boots|r
- Set SaveLoad_Item[50] = |c00ff0000Shivering Horn|r
- Set SaveLoad_Item[51] = Coral Shield
- Set SaveLoad_Item[52] = Enchanted Iron Shield
- Set SaveLoad_Item[53] = Iron Shield
- Set SaveLoad_Item[54] = Iron Tower Shield
- Set SaveLoad_Item[55] = Mithril Round Shield
- Set SaveLoad_Item[56] = Mithril Shield
- Set SaveLoad_Item[57] = Plated Mithril Shield
- Set SaveLoad_Item[58] = Ritual Wooden Shield
- Set SaveLoad_Item[59] = Spiked Steel Shield
- Set SaveLoad_Item[60] = Steel Shield
- Set SaveLoad_Item[61] = Steel Tower Shield
- Set SaveLoad_Item[62] = Unholy Wooden Shield
- Set SaveLoad_Item[63] = Wooden Shield
- Set SaveLoad_ItemCount = 63
- -------- Store all the heroes you want to be able to be saved below. --------
- Set SaveLoad_Hero[1] = |c00ff0000Phoenix Warrior|r
- Set SaveLoad_Hero[2] = |c00ffff00Holy Knight|r
- Set SaveLoad_Hero[3] = |c00ffff00Priest|r
- Set SaveLoad_Hero[4] = |c0000ff00Illusionist|r
- Set SaveLoad_Hero[5] = |c00a400ffMoonmage|r
- Set SaveLoad_Hero[6] = |c000000ffIcy Warrior|r
- Set SaveLoad_Hero[7] = |c0000ff00Amazon|r
- Set SaveLoad_Hero[8] = |c000000ffElementalist|r
- Set SaveLoad_Hero[9] = |c00a400ffDark Stalker|r
- Set SaveLoad_Hero[10] = Backpack
- Set SaveLoad_HeroCount = 10
- -------- Don't modify below this line. --------
- Set SaveLoad_Base = (Length of SaveLoad_Alphabet)
- Set SaveLoad_Char = <Empty String>
- Set Load[0] = 0
- Set LoadCount = 0
- Custom script: call CodeGen_Init()
- SaveLoad Save
- Events
- Player - Player 1 (Red) types a chat message containing -save as An exact match
- Player - Player 2 (Blue) types a chat message containing -save as An exact match
- Player - Player 3 (Teal) types a chat message containing -save as An exact match
- Player - Player 4 (Purple) types a chat message containing -save as An exact match
- Player - Player 5 (Yellow) types a chat message containing -save as An exact match
- Player - Player 6 (Orange) types a chat message containing -save as An exact match
- Player - Player 7 (Green) types a chat message containing -save as An exact match
- Player - Player 8 (Pink) types a chat message containing -save as An exact match
- Player - Player 9 (Gray) types a chat message containing -save as An exact match
- Player - Player 10 (Light Blue) types a chat message containing -save as An exact match
- Conditions
- Actions
- -------- Find the players hero, and save it. I realize it leaks but it's just for demonstration. --------
- Set SaveCount = 0
- Unit Group - Pick every unit in (Units owned by (Triggering player) matching ((((Matching unit) is A Hero) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Backpack))) and do (Set Hero = (Picked unit))
- Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertUnit(GetUnitTypeId(udg_Hero))
- Set SaveCount = (SaveCount + 1)
- -------- Save players gold. --------
- Set Save[SaveCount] = ((Triggering player) Current gold)
- Set SaveCount = (SaveCount + 1)
- -------- Save heroes level. --------
- Set Save[SaveCount] = (Hero level of Hero)
- Set SaveCount = (SaveCount + 1)
- -------- Save heroes items. --------
- Set Save[SaveCount] = (Number of items carried by Hero)
- Set SaveCount = (SaveCount + 1)
- For each (Integer A) from 1 to 6, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Item-type of (Item carried by Hero in slot (Integer A))) Not equal to (Item-type of No item)
- Then - Actions
- Set Item = (Item carried by Hero in slot (Integer A))
- Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertItem(GetItemTypeId(udg_Item))
- Set SaveCount = (SaveCount + 1)
- Else - Actions
- -------- Show Code --------
- Custom script: set udg_Code = CodeGen_Compile()
- Game - Display to (Player group((Triggering player))) for 120.00 seconds the text: (Your code is: + Code)
- SaveLoad Load
- Events
- Player - Player 1 (Red) types a chat message containing -load as A substring
- Player - Player 2 (Blue) types a chat message containing -load as A substring
- Player - Player 3 (Teal) types a chat message containing -load as A substring
- Player - Player 4 (Purple) types a chat message containing -load as A substring
- Player - Player 5 (Yellow) types a chat message containing -load as A substring
- Player - Player 6 (Orange) types a chat message containing -load as A substring
- Player - Player 7 (Green) types a chat message containing -load as A substring
- Player - Player 8 (Pink) types a chat message containing -load as A substring
- Player - Player 9 (Gray) types a chat message containing -load as A substring
- Player - Player 10 (Light Blue) types a chat message containing -load as A substring
- Conditions
- (Substring((Entered chat string), 1, 6)) Equal to -load
- Actions
- -------- Check if load is valid --------
- Set Code = (Substring((Entered chat string), 7, 999))
- Custom script: call CodeGen_Load(udg_Code)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- SaveLoad_Valid Equal to False
- Then - Actions
- Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Invalid code.
- Skip remaining actions
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- PlayerLoad[(Player number of (Triggering player))] Equal to 1
- Then - Actions
- Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: You have already lo...
- Skip remaining actions
- Else - Actions
- Set PlayerLoad[(Player number of (Triggering player))] = 1
- -------- Start loading, load the hero first. --------
- Set LoadCount = 0
- Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Unit - Remove (Picked unit) from the game)
- Unit - Create 1 SaveLoad_Hero[Load[LoadCount]] for (Triggering player) at (Random point in Respawn <gen>) facing Default building facing degrees
- Set Hero = (Last created unit)
- Selection - Select (Last created unit) for (Triggering player)
- -------- Now load players gold --------
- Set LoadCount = (LoadCount + 1)
- Player - Set (Triggering player) Current gold to Load[LoadCount]
- -------- Load heroes level --------
- Set LoadCount = (LoadCount + 1)
- Hero - Set Hero Hero-level to Load[LoadCount], Hide level-up graphics
- -------- Now items --------
- Set LoadCount = (LoadCount + 1)
- For each (Integer A) from 0 to Load[LoadCount], do (Actions)
- Loop - Actions
- Set LoadCount = (LoadCount + 1)
- Hero - Create SaveLoad_Item[Load[LoadCount]] and give it to Hero
- SaveLoad Save Backpack
- Events
- Player - Player 1 (Red) types a chat message containing -savebp as An exact match
- Player - Player 2 (Blue) types a chat message containing -savebp as An exact match
- Player - Player 3 (Teal) types a chat message containing -savebp as An exact match
- Player - Player 4 (Purple) types a chat message containing -savebp as An exact match
- Player - Player 5 (Yellow) types a chat message containing -savebp as An exact match
- Player - Player 6 (Orange) types a chat message containing -savebp as An exact match
- Player - Player 7 (Green) types a chat message containing -savebp as An exact match
- Player - Player 8 (Pink) types a chat message containing -savebp as An exact match
- Player - Player 9 (Gray) types a chat message containing -savebp as An exact match
- Player - Player 10 (Light Blue) types a chat message containing -savebp as An exact match
- Conditions
- Actions
- -------- Find the players hero, and save it. I realize it leaks but it's just for demonstration. --------
- Set SaveCount = 0
- Unit Group - Pick every unit in (Units owned by (Triggering player) matching ((Unit-type of (Matching unit)) Equal to Backpack)) and do (Set Hero = (Picked unit))
- Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertUnit(GetUnitTypeId(udg_Hero))
- Set SaveCount = (SaveCount + 1)
- -------- Save players gold. --------
- Set Save[SaveCount] = ((Triggering player) Current gold)
- Set SaveCount = (SaveCount + 1)
- -------- Save heroes level. --------
- Set Save[SaveCount] = (Hero level of Hero)
- Set SaveCount = (SaveCount + 1)
- -------- Save heroes items. --------
- Set Save[SaveCount] = (Number of items carried by Hero)
- Set SaveCount = (SaveCount + 1)
- For each (Integer A) from 1 to 6, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Item-type of (Item carried by Hero in slot (Integer A))) Not equal to (Item-type of No item)
- Then - Actions
- Set Item = (Item carried by Hero in slot (Integer A))
- Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertItem(GetItemTypeId(udg_Item))
- Set SaveCount = (SaveCount + 1)
- Else - Actions
- -------- Show Code --------
- Custom script: set udg_Code = CodeGen_Compile()
- Game - Display to (Player group((Triggering player))) for 120.00 seconds the text: (Your backpack code is: + Code)
Hmmm, if im gonna use this in my map and when i will release a new version in my map and the players will gonna try to load the heroes at the old version of my map in to the new one, will this still work?
Hmmm, if im gonna use this in my map and when i will release a new version in my map and the players will gonna try to load the heroes at the old version of my map in to the new one, will this still work?