• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Idea for Save script

Status
Not open for further replies.
Level 4
Joined
Oct 8, 2004
Messages
64
I haven't had a need to make a hero save/load script for any maps that i have made. However, I have an idea for a script that i may take a stab at constructing and just release it for everyone to use.


My Script Idea:


TO ADDRESS: Code not being universal for all players

- To make a script so that more then one person can not use the script i would:

* Take the first, and third letter of the players name and use it in the "save Code" as like the 5th, and 8th character.

Note: This would make sure that the save codes could not be used by more then oone person, unless you read this and knew how it worked.



TO ADDRESS SAVING ITEMS/HERO LEVEL

- Well, I haven't started coding this yet but i'll try to give an example.

- First Note that we will only be saving in the script: Hero Type, 6 items in inventory, and Hero level.

- To save the information we want i would do something like this.

Say that our save code looks like this (X = number or letter)

XXXX-XXXX-XXXX-XXXX

In order to save information i would make for example
the 5th "X", and the 13th "X" when combined give you a 2 digit (number/letter combination) and the save/load script will read this as "The item type of the item carried by the hero in the 6th inventory slot"


I hope this gives some people ideas for making a save/load script. Feel free to use this method to create one.


I have just decided to make this sript as I type this. I will make the script universal by assigning each item/hero an integer to the "Custom Value" field to work will all the default items, and heros, and try to include information on how to set a custom item and hero to be able to use it for the script.
 
Level 4
Joined
Oct 8, 2004
Messages
64
Player 1 Load Code Trigger
Events
Player - Player 1 (Red) types a chat message containing -load as A substring
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Length of (Entered chat string)) Equal to 32
Then - Actions
Set _7[1] = (Substring((Entered chat string), 7, 7))
Set _8[1] = (Substring((Entered chat string), 8, 8))
Set _9[1] = (Substring((Entered chat string), 9, 9))
Set _10[1] = (Substring((Entered chat string), 10, 10))
Set _11[1] = (Substring((Entered chat string), 11, 11))
Set _12[1] = (Substring((Entered chat string), 12, 12))
Set _13[1] = (Substring((Entered chat string), 13, 13))
Set _14[1] = (Substring((Entered chat string), 14, 14))
Set _15[1] = (Substring((Entered chat string), 15, 15))
Set _16[1] = (Substring((Entered chat string), 16, 16))
Set _17[1] = (Substring((Entered chat string), 17, 17))
Set _18[1] = (Substring((Entered chat string), 18, 18))
Set _19[1] = (Substring((Entered chat string), 19, 19))
Set _20[1] = (Substring((Entered chat string), 20, 20))
Set _21[1] = (Substring((Entered chat string), 21, 21))
Set _22[1] = (Substring((Entered chat string), 22, 22))
Set _23[1] = (Substring((Entered chat string), 23, 23))
Set _24[1] = (Substring((Entered chat string), 24, 24))
Set _25[1] = (Substring((Entered chat string), 25, 25))
Set _26[1] = (Substring((Entered chat string), 26, 26))
Set _27[1] = (Substring((Entered chat string), 27, 27))
Set _28[1] = (Substring((Entered chat string), 28, 28))
Set _29[1] = (Substring((Entered chat string), 29, 29))
Set _30[1] = (Substring((Entered chat string), 30, 30))
Set _31[1] = (Substring((Entered chat string), 31, 31))
Set _32[1] = (Substring((Entered chat string), 32, 32))
-------- ---------------------------------------------------------------------------------------------- --------
Set Gold_Value[1] = (_23[1] + _27[1])
Set lumber_Value[1] = (_13[1] + _28[1])
-------- ---------------------------------------------------------------------------------------------- --------
Set Name_First_Digit_Check[1] = _18[1]
Set Name_Second_Digit_Check[1] = _20[1]
Set Hero_Type[1] = (_7[1] + _17[1])
Set Hero_Level[1] = (_8[1] + _15[1])
Set Slot_1_Item[1] = (_24[1] + _25[1])
Set Slot_2_Item[1] = (_19[1] + _22[1])
Set Slot_3_Item[1] = (_29[1] + _32[1])
Set Slot_4_Item[1] = (_10[1] + _12[1])
Set Slot_5_Item[1] = (_30[1] + _31[1])
Set Slot_6_Item[1] = (_9[1] + _14[1])
-------- ---------------------------------------------------------------------------------------------- --------
-------- ----------------------------Detect Hero Type------------------------------------------------------------------ --------
-------- ---------------------------------------------------------------------------------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to aa
Then - Actions
Set Players_Hero_Type[1] = Paladin
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ab
Then - Actions
Set Players_Hero_Type[1] = Archmage
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ac
Then - Actions
Set Players_Hero_Type[1] = Mountain King
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ad
Then - Actions
Set Players_Hero_Type[1] = Blood Mage
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ae
Then - Actions
Set Players_Hero_Type[1] = Admiral Proudmoore
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to af
Then - Actions
Set Players_Hero_Type[1] = Antonidas
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ag
Then - Actions
Set Players_Hero_Type[1] = Antonidas
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ah
Then - Actions
Set Players_Hero_Type[1] = Arthas
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ai
Then - Actions
Set Players_Hero_Type[1] = Arthas (wielding Frostmourne)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to aj
Then - Actions
Set Players_Hero_Type[1] = Dagren the Orcslayer
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ak
Then - Actions
Set Players_Hero_Type[1] = Halahk the Lifebringer
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to al
Then - Actions
Set Players_Hero_Type[1] = Jaina
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to am
Then - Actions
Set Players_Hero_Type[1] = Kael
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to an
Then - Actions
Set Players_Hero_Type[1] = Lord Garithos
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ao
Then - Actions
Set Players_Hero_Type[1] = Lord Nicholas Buzan
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ap
Then - Actions
Set Players_Hero_Type[1] = Magroth the Defender
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to aq
Then - Actions
Set Players_Hero_Type[1] = Muradin Bronzebeard
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ar
Then - Actions
Set Players_Hero_Type[1] = Sir Gregory Edmunson
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to as
Then - Actions
Set Players_Hero_Type[1] = Sylvanas Windrunner
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to at
Then - Actions
Set Players_Hero_Type[1] = Uther
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to au
Then - Actions
Set Players_Hero_Type[1] = Blademaster
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to av
Then - Actions
Set Players_Hero_Type[1] = Far Seer
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to aw
Then - Actions
Set Players_Hero_Type[1] = Tauren Chieftain
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ax
Then - Actions
Set Players_Hero_Type[1] = Shadow Hunter
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ay
Then - Actions
Set Players_Hero_Type[1] = Blademaster of Blackrock Clan
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to az
Then - Actions
Set Players_Hero_Type[1] = Cairne Bloodhoof
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a1
Then - Actions
Set Players_Hero_Type[1] = Cairne Bloodhoof (Expansion)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a2
Then - Actions
Set Players_Hero_Type[1] = Chen Stormstout
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a3
Then - Actions
Set Players_Hero_Type[1] = Drek'Thar
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a4
Then - Actions
Set Players_Hero_Type[1] = Grom Hellscream
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a5
Then - Actions
Set Players_Hero_Type[1] = Grom Hellscream (Possessed)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a6
Then - Actions
Set Players_Hero_Type[1] = Gul'dan
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a7
Then - Actions
Set Players_Hero_Type[1] = Rexxar
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a8
Then - Actions
Set Players_Hero_Type[1] = Rokhan
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to a9
Then - Actions
Set Players_Hero_Type[1] = Samuro
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ba
Then - Actions
Set Players_Hero_Type[1] = Thrall
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bb
Then - Actions
Set Players_Hero_Type[1] = Death Knight
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bc
Then - Actions
Set Players_Hero_Type[1] = Lich
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bd
Then - Actions
Set Players_Hero_Type[1] = Dreadlord
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to be
Then - Actions
Set Players_Hero_Type[1] = Crypt Lord
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bf
Then - Actions
Set Players_Hero_Type[1] = Mannoroth
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bg
Then - Actions
Set Players_Hero_Type[1] = Archimonde
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bh
Then - Actions
Set Players_Hero_Type[1] = Azgalor
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bi
Then - Actions
Set Players_Hero_Type[1] = Kil'jaeden
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bj
Then - Actions
Set Players_Hero_Type[1] = Magtheridon
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bk
Then - Actions
Set Players_Hero_Type[1] = Anub'arak
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bl
Then - Actions
Set Players_Hero_Type[1] = Arthas (Evil)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bm
Then - Actions
Set Players_Hero_Type[1] = Balnazzar
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bn
Then - Actions
Set Players_Hero_Type[1] = Dalvengyr
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bo
Then - Actions
Set Players_Hero_Type[1] = Detheroc
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bp
Then - Actions
Set Players_Hero_Type[1] = Kel'Thuzad (Lich)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bq
Then - Actions
Set Players_Hero_Type[1] = Mal'Ganis
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to br
Then - Actions
Set Players_Hero_Type[1] = Sylvanas
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bs
Then - Actions
Set Players_Hero_Type[1] = Tichondrius
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bt
Then - Actions
Set Players_Hero_Type[1] = Varimathras
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bu
Then - Actions
Set Players_Hero_Type[1] = Keeper of the Grove
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bv
Then - Actions
Set Players_Hero_Type[1] = Priestess of the Moon
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bw
Then - Actions
Set Players_Hero_Type[1] = Demon Hunter
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bx
Then - Actions
Set Players_Hero_Type[1] = Warden
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to by
Then - Actions
Set Players_Hero_Type[1] = Cenarius
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to bz
Then - Actions
Set Players_Hero_Type[1] = Furion
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ca
Then - Actions
Set Players_Hero_Type[1] = Ghost
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cb
Then - Actions
Set Players_Hero_Type[1] = Illidan
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cc
Then - Actions
Set Players_Hero_Type[1] = Illidan (Evil)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cd
Then - Actions
Set Players_Hero_Type[1] = Maiev
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ce
Then - Actions
Set Players_Hero_Type[1] = Malfurion
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cf
Then - Actions
Set Players_Hero_Type[1] = Malfurion (Without Stag)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cg
Then - Actions
Set Players_Hero_Type[1] = Tyrande
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ch
Then - Actions
Set Players_Hero_Type[1] = Alchemist
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ci
Then - Actions
Set Players_Hero_Type[1] = Naga Sea Witch
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cj
Then - Actions
Set Players_Hero_Type[1] = Tinker
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to ck
Then - Actions
Set Players_Hero_Type[1] = Beastmaster
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cm
Then - Actions
Set Players_Hero_Type[1] = Firelord
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cn
Then - Actions
Set Players_Hero_Type[1] = Pandaren Brewmaster
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to co
Then - Actions
Set Players_Hero_Type[1] = Pit Lord
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cp
Then - Actions
Set Players_Hero_Type[1] = Lady Vashj
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Type[1] Equal to cl
Then - Actions
Set Players_Hero_Type[1] = Dark Ranger
Else - Actions
Do nothing
-------- ---------------------------------------------------------------------------------------------- --------
-------- ---------------------------------------------------------------------------------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Level[1] Equal to aa
Then - Actions
Set Player_Hero_Level[1] = 1
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Level[1] Equal to ab
Then - Actions
Set Player_Hero_Level[1] = 2
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Level[1] Equal to ac
Then - Actions
Set Player_Hero_Level[1] = 3
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hero_Level[1] Equal to ac
Then - Actions
Set Player_Hero_Level[1] = 3
Else - Actions
Do nothing
-------- ---------------------------------------------------------------------------------------------- --------
-------- ---------------------------------------------------------------------------------------------- --------
Unit - Create 1 Players_Hero_Type[1] for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
Hero - Set (Last created unit) Hero-level to Player_Hero_Level[1], Hide level-up graphics
Else - Actions
Quest - Display to Player Group - Player 1 (Red) the Quest Update message: You have typed a me...
 
Level 4
Joined
Oct 8, 2004
Messages
64
The above is the start of the save/lod code i started last night, it was going to work for all the default heros and items.

I could have easily pulled this off, but then i saw a post about a save code. And i saw that there is a save code script on here call "EZ Save load code 2" that from looking at the code looks like it ould work, but requires customization for ther persons map that uses it.

So, with that said unless a pile of people ask me to finish this. I dont see a problem with people using that save load code, and i see no reason to finish this.

I will keep the map that i have this started in just in case though.
 
Status
Not open for further replies.
Top