Loadable Heroes

Father_Chaos

BattleForums Member
Joined
Nov 23, 2005
Messages
364
Reaction score
0
I just played a game of Humans VS Orcs, and I was wondering, how can you do like give someone a code like "2h548f75ndf" and in another game if you type it you get the same hero you had, with the same level and the same stuff (in a multiplayer map of course)?
 

tassadar920

Member!
Joined
May 18, 2003
Messages
2,048
Reaction score
0
Location
My house
It's called a savecode, basically you save each attribute you want recoverable to a number/letter and then re-load them.

For example you could order all your heroes in an array, then give the player back a string with the position of their hero in the array, they would be able to re-load that hero later on by calling the number again. You just have to do this for everything you want savable.
 

IceDevil9

BattleForums Senior Member
Joined
Feb 19, 2003
Messages
3,418
Reaction score
3
Location
CA
Website
www.rcthaven.com
It's an incredibly long and comlicated code, it takes awhile, unless you steal it from other maps, which we don't support, so don't ask.

Besides, it requires a string that seems random, but contains certain numbers that refer to your exp, level, each stats, skill level, hero, it takes a long time to code =/ It throws in items too, so it's usually a long string, and would take forever to code. More or less you create arrays with cretain variables set as letters or numbers referring to each hero, then create arrays for the skills and levels for those heroes, and every item has it's own variable, so when the player types -save you need to have a trigger to analyze all those categories, match up variables, and spit out a code. Making it random is another complicated piece to the puzzle.

-Frank :cool:
 

Father_Chaos

BattleForums Member
Joined
Nov 23, 2005
Messages
364
Reaction score
0
Woohoo... Finally I think I won't waste my time working on this :).
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
IceDevil9 said:
It's an incredibly long and comlicated code, it takes awhile, unless you steal it from other maps, which we don't support, so don't ask.

Besides, it requires a string that seems random, but contains certain numbers that refer to your exp, level, each stats, skill level, hero, it takes a long time to code =/ It throws in items too, so it's usually a long string, and would take forever to code. More or less you create arrays with cretain variables set as letters or numbers referring to each hero, then create arrays for the skills and levels for those heroes, and every item has it's own variable, so when the player types -save you need to have a trigger to analyze all those categories, match up variables, and spit out a code. Making it random is another complicated piece to the puzzle.

-Frank :cool:
It's not actually that difficult, as long as you figure out steps how to encode the string first. However, you cannot destroy the string (for example, changing characters to characters that already exist would destroy it), nor make it so easy to decode.*
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
The idea is that there is a trigger that will save data from a hero like type, spells etc. Then the user can upload the file and regenerate that hero, so long as the hero exists and the skills exist within the map he was loaded in.

However, as Icedevil said: It is very complex triggering, often crashing or unable to load the files if the load sequence is done incorrectly or the file becomes unreadable.
 

PTS

Member
Joined
Nov 16, 2005
Messages
9
Reaction score
0
The guy just needed a link to a tutorial, not a discouragement...

Save/Load Code Tutorial

Someone has bothered explaining this in depth. If JASS supports the kind of arrays that C has then it would be easy. In fact you'll be able to make a user name & password type of loading where the user name is used as the encryption key. That way there'll be a minimal chance someone to reverse-engineer your code, beacuse the same hero with the same stuff will have totaly diffirent code, even if the encryption string used is the same (but I've no idea what kind of arrays JASS has...).
 

Father_Chaos

BattleForums Member
Joined
Nov 23, 2005
Messages
364
Reaction score
0
That made me dizzy :fwink.
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
Well, if you understand the whole ideas of encrypting and arrays, it isn't.
 

NewPosts

New threads

Top