Has some JASS functions, but to use system you don't need to know anything.
1. Copy triggers and variables used by map. Don't forget to copy this:
http://img159.imageshack.us/img159/4728/untitled2ks2.th.pnghttp://img207.imageshack.us/img207/2797/untitled3pt7.th.png2. Add your heroes:
- -Set CodeUnitType to type of hero to be added
- -Set CodeAbilitiy1, CodeAbilitiy2, CodeAbilitiy3 and CodeAbilitiy4 to abilities of hero.
- -Run CodeAddHero trigger
- -Repeat until satisfied
3. Add your items:
- -Place items used in map into CodeItems region
4. Modify save/load commands, so that you can't have two heroes, or something (this is a test map).
Limits for default code generator:- Hero level:
- - 511
- Hero types:
- - 8
- Abilities: Two modes:
- - five abilites, max levels are: 15, 15, 15, 15, 15
- Items:
- - 64
- Attributes:
- - 255
Technical:- 0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ/.-=
- each character = 6 bit.
- Crc 12 bits, key: (12,11,3,2,1,0) = 0xc07 = 3097
- After generating code and applying crc, map encrypts (xors) the code with player-name dependant key, making it impossible to load other players' characters.
Default code structure:-
3 bits: hero type
-
9 bits: hero level
-
20 bits: levels of abilities
-
3 bits: amount of items carries by hero (technically max 7 items, but..)
-
6 * (amount of items carries by hero) bits: items
-
24 bits: attributes
-
12 bits: checksum
To create your own code structure:- -Change encryption and code-deneration values.
- - - -
http://img245.imageshack.us/img245/9219/0hf0.th.png- -Find InitCodeGenDefault function.
- - - -
http://img109.imageshack.us/img109/149/2eo5.th.png- - - -it contains definitions for triggers responsible for code generation.
- -Add your own save funcions:
- - - -
http://img155.imageshack.us/img155/8453/3kd4.th.png- - - -on image, you see function saving level. It sets variable Size to 9, meaning max level will be 511 (see below), and sets Value to level of Unit, where Unit is hero being saved.
- -Add your own load funcions:
- - - -
http://img155.imageshack.us/img155/1112/4fh5.th.png- - - -on image, you see function loading agility. It consists of 2 parts. In first part, which is run when firstpass variable is set to true (save trigger sets itto true or false, you don't need to change it), this function sets Size variable to same value as it did for save function. In second part, necessary actions for loading are carried out, like creation of units, or, like on image, setting agility of hero.
- -Enjoy.
- - - - -Size variable:
- - - - - -The more this variable is, the more saved value can be (and code longer, too). For example, if Size = 5, max size of Value is 31
- - - - - - -Size = 0 =====> max value = 0
- - - - - - -Size = 1 =====> max value = 1
- - - - - - -Size = 2 =====> max value = 3
- - - - - - -Size = 3 =====> max value = 7
- - - - - - -Size = 4 =====> max value = 15
- - - - - - -Size = 5 =====> max value = 31
- - - - - - -Size = 6 =====> max value = 63
- - - - - - -Size = 7 =====> max value = 127
- - - - - - -Size = 8 =====> max value = 255
- - - - - - -Size = 9 =====> max value = 511
- - - - - - -Size = 10 =====> max value = 1023
- - - - - - -Size = 11 =====> max value = 2047
- - - - - - -Size = 12 =====> max value = 4095
- - - - - - -
- - - - - - -Size = i =====> max value = 2^i - 1
----------------------------------------------------------
It'd be nice if you somehow informed player that save/load system used in map is made by lowlife and is freely available. Although i'm not requirying that. You may not credit me at all if you want.