• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Tfk

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Deleted 10/31/14

Keywords:
none
Contents

TFK (Map)

Reviews
21:49, 22nd Jan 2011 ap0calypse: Approved StoPCampinGn00b: Rejected for map being "deleted" by author and spam on the front page.
Yup, for now I think. I going to removed all refugee item after changing into first class.

What items can they use though? Just refugee items? What class are refugee items?? Cloth?

When I was a refugee, he used iron sword and etc, so I'm assuming that they can possibly use any item?

edit
what about charged items and refugee gear? ... surely, you want to be able to save a refugee, unless you just reset its gear each time?

What do you want to do with refugees, reset back to starter gear while a refugee?
 
Level 14
Joined
Dec 13, 2008
Messages
617
All Projectiles cost 0gold and disable to sell. they can carry be all class, but only rouge class that have throw projectile skills can only use projectiles.

EDIT:
I get it now...
JASSHELPER is little annoying is not finish loading "Found errors, please wait..." so I always force end task in able to proceed..
 
Last edited:
Level 14
Joined
Dec 13, 2008
Messages
617
found error, when I used to save maps again and force end task the jasshelper "cause loading now to much long" the map get corrupted and disable to play again.
*Toinks
EDIT:
I think I need to disable that jasshelper, give just one more try... `headache`
 
Don't disable jasshelper... you won't be able to use Encoder then >.>....

the loading takes forever on your map. Whenever i save, it takes like 5 mins, rofl.. ur map is huge.


On another note, should horses only be able to hold item class of 0?

This is how I split it up
JASS:
//can be split up into each class and so forth if wanting super class specific items
            
            //0
            //      warrior, warlord, legionaire, brigand, pikeman, lancer
            //      0,1,2,3,4,5, rune
            //
            //1 
            //      rogue, elu, slayer, shadow slayer, blader, executioner
            //      0,1,2,3,6, rune
            //2 
            //      oracles, prophet, medium, sage, trickster, dualist, shaman, witch doctor
            //      0,1,7, rune
            //3 
            //      ranger
            //      0,1,2,8, rune
            //4
            //      Refugee
            //      0
            set classCat

And 0-4 are point values on units since you weren't using them and I wanted it to be easy.
 
I'm almost done... rofl, you have no idea how much crap I just did :p

JASS:
//! textmacro CATALOG_2
    struct ItemCatalog2 extends array
        //can be changed to arrays if adding charged reg items that collide with these
        static readonly integer CHARGE_99_0 = 0
        static readonly integer CHARGE_99_1 = 0
        static readonly integer CHARGE_20_0 = 0
        static readonly integer CHARGE_20_1 = 0
        
        private integer array catalogs
        private integer array classCatalogs
        
        method operator raw takes nothing returns integer
            return CatalogRaw(catalog, this)
        endmethod
        
        static method operator count takes nothing returns integer
            return CatalogCount(catalog)
        endmethod
        
        method operator id takes nothing returns integer
            return CatalogId(catalog, this)
        endmethod
        
        static method add takes integer v returns nothing
            call CatalogAdd(catalog, v)
        endmethod
        
        static method addCatalog takes integer catalog returns nothing
            call CatalogAddCatalog(thistype.catalog, catalog)
        endmethod
        
        static method operator [] takes integer i returns thistype
            return classCatalogs[GetUnitPointValueByType(i)]
        endmethod
        
        private static method onInit takes nothing returns nothing
            //item classes
            /*
                0   --------------------------	Off-Hand
                1	--------------------------	Clothes
                2	--------------------------	Leather
                3	--------------------------	Chain
                4	--------------------------	Plated
                5	--------------------------	Sword/Axe/Hammer/Two-Handed
                6	--------------------------	Dagger/Katar/Fist
                7	--------------------------	Mace/Wand/Staff/Book/Runes
                8	--------------------------	Bow/Crossbow
            */
            set catalogs[0] = CatalogCreate()
            set catalogs[1] = CatalogCreate()
            set catalogs[2] = CatalogCreate()
            set catalogs[3] = CatalogCreate()
            set catalogs[4] = CatalogCreate()
            set catalogs[5] = CatalogCreate()
            set catalogs[6] = CatalogCreate()
            set catalogs[7] = CatalogCreate()
            set catalogs[8] = CatalogCreate()
            
            //can be split up into each class and so forth if wanting super class specific items
            
            //0
            //      warrior, warlord, legionaire, brigand, pikeman, lancer
            //      0,1,2,3,4,5, rune
            //
            //1 
            //      rogue, elu, slayer, shadow slayer, blader, executioner
            //      0,1,2,3,6, rune
            //2 
            //      oracles, prophet, medium, sage, trickster, dualist, shaman, witch doctor
            //      0,1,7, rune
            //3 
            //      ranger
            //      0,1,2,8, rune
            //4
            //      Refugee
            //      0
            set classCatalogs[0] = CatalogCreate()      //war
            set classCatalogs[1] = CatalogCreate()      //rog
            set classCatalogs[2] = CatalogCreate()      //medium
            set classCatalogs[3] = CatalogCreate()      //ranger
            set classCatalogs[4] = CatalogCreate()      //refugee
            
            //class 0
            set CHARGE_99_0 = 1
            call CatalogAdd(catalogs[0], 'I00F')        //Stone
            set CHARGE_99_1 = CatalogCount(catalogs[0])
            set CHARGE_20_0 = CatalogCount(catalogs[0])+1
            call CatalogAdd(catalogs[0], 'I01N')        //Minor Healing Potion          0
            call CatalogAdd(catalogs[0], 'I01L')        //Greater Healing Potion        0
            call CatalogAdd(catalogs[0], 'I01O')        //Minor Mana Potion             0
            call CatalogAdd(catalogs[0], 'I01M')        //Greater Mana Potion           0
            call CatalogAdd(catalogs[0], 'I01P')        //Minor Rejuvenation Potion     0
            call CatalogAdd(catalogs[0], 'I01Q')        //Greater Rejuvenation Potion   0
            call CatalogAdd(catalogs[0], 'I01R')        //Green Potion                  0
            call CatalogAdd(catalogs[0], 'I01S')        //Sleep Potion                  0
            call CatalogAdd(catalogs[0], 'I022')        //Blue Herbs                    0
            call CatalogAdd(catalogs[0], 'I023')        //Green Herbs                   0
            call CatalogAdd(catalogs[0], 'I025')        //Mushroom                      0
            call CatalogAdd(catalogs[0], 'I021')        //Red Herbs                     0
            call CatalogAdd(catalogs[0], 'I024')        //Yellow Herbs                  0
            set CHARGE_20_1 = CatalogCount(catalogs[0])
            call CatalogAdd(catalogs[0], 'I04I')        //Boar Tusk                     0
            call CatalogAdd(catalogs[0], 'I02Y')        //Iron Shield                   0
            call CatalogAdd(catalogs[0], 'I00Y')        //Wooden Shield                 0
            call CatalogAdd(catalogs[0], 'I04P')        //Blood Stone Heart             0
            call CatalogAdd(catalogs[0], 'I04B')        //Necklace of Nobleman          0
            call CatalogAdd(catalogs[0], 'I04A')        //Silverkey of Brotherhood      0
            call CatalogAdd(catalogs[0], 'I049')        //Medal of Great Honor          0
            
            //auto added on loading refugee, no need to save
            //call CatalogAdd(catalogs[], 'I04Q')         //Refugee's Blade               0
            //call CatalogAdd(catalogs[], 'I04S')         //Refugee's Boots               0
            //call CatalogAdd(catalogs[], 'I04R')         //Refugee's Suit                0
            
            //class 1
            call CatalogAdd(catalogs[1], 'I02P')        //Bandana                       1
            call CatalogAdd(catalogs[1], 'I02W')        //Bandit Hat                    1
            call CatalogAdd(catalogs[1], 'I02T')        //Hawk Mask                     1
            call CatalogAdd(catalogs[1], 'I02S')        //Hood                          1
            call CatalogAdd(catalogs[1], 'I02C')        //Hood Cape                     1
            call CatalogAdd(catalogs[1], 'I02U')        //Mage Hat                      1
            call CatalogAdd(catalogs[1], 'I03F')        //Mantle                        1
            call CatalogAdd(catalogs[1], 'I03D')        //Robe                          1
            call CatalogAdd(catalogs[1], 'I02D')        //Royal Cape                    1
            call CatalogAdd(catalogs[1], 'I02E')        //Sandals                       1
            call CatalogAdd(catalogs[1], 'I03E')        //Vestment                      1
            call CatalogAdd(catalogs[1], 'I02B')        //Peasant                       1
            call CatalogAdd(catalogs[1], 'I048')        //Zyria Reinforcer Coat         1
            call CatalogAdd(catalogs[1], 'I04U')        //Pirate Hat                    1
            call CatalogAdd(catalogs[1], 'I04J')        //Wirs Legs                     1
            
            //class 2
            call CatalogAdd(catalogs[2], 'I04L')        //Bandits Armor                 2
            call CatalogAdd(catalogs[2], 'I00X')        //Boots of Speed                2
            call CatalogAdd(catalogs[2], 'I03C')        //Full Leather Armor            2
            call CatalogAdd(catalogs[2], 'I03B')        //Hard Leather Armor            2
            call CatalogAdd(catalogs[2], 'I02L')        //Hat                           2
            call CatalogAdd(catalogs[2], 'I00Z')        //Leather Armor                 2
            call CatalogAdd(catalogs[2], 'I04M')        //Hard Scales Armor             2
            call CatalogAdd(catalogs[2], 'I047')        //Zyria Reinforcer Armor        2
            
            //class 3
            call CatalogAdd(catalogs[3], 'I03G')        //Naga Armor                    3
            
            //class 4
            call CatalogAdd(catalogs[4], 'I02M')        //Plated Boots                  4
            call CatalogAdd(catalogs[4], 'I02R')        //Plated Helm                   4
            call CatalogAdd(catalogs[4], 'I02O')        //Full Pated Mail               4
            call CatalogAdd(catalogs[4], 'I02Q')        //Bronze Helm                   4
            call CatalogAdd(catalogs[4], 'I02N')        //Boots of Horde                4
            call CatalogAdd(catalogs[4], 'I02V')        //Mythril Helm                  4
            
            //class 5
            call CatalogAdd(catalogs[5], 'I032')        //Axe                           5
            call CatalogAdd(catalogs[5], 'I02X')        //Iron Sword                    5
            call CatalogAdd(catalogs[5], 'I036')        //Lance                         5
            call CatalogAdd(catalogs[5], 'I030')        //Large Axe                     5
            call CatalogAdd(catalogs[5], 'I037')        //Long Horn                     5
            call CatalogAdd(catalogs[5], 'I033')        //Long Sword                    5
            call CatalogAdd(catalogs[5], 'I031')        //Small Axe                     5
            call CatalogAdd(catalogs[5], 'I035')        //Spear                         5
            call CatalogAdd(catalogs[5], 'I034')        //Pike                          5
            call CatalogAdd(catalogs[5], 'I04G')        //Mythril Sword                 5
            call CatalogAdd(catalogs[5], 'I04K')        //Pick Axe                      5
            call CatalogAdd(catalogs[5], 'I04H')        //Enforcer Axe                  5
            
            //class 6
            call CatalogAdd(catalogs[6], 'I038')        //Dagger                        6
            call CatalogAdd(catalogs[6], 'I039')        //Mythril Dagger                6
            call CatalogAdd(catalogs[6], 'I04N')        //Spider Claw                   6
            call CatalogAdd(catalogs[6], 'I04O')        //Wild Fangs                    6
            call CatalogAdd(catalogs[6], 'I03I')        //Heretic Blade                 6
            call CatalogAdd(catalogs[6], 'I04F')        //Hammer Forge                  6
            
            //class 7
            call CatalogAdd(catalogs[7], 'I02K')        //Bone Wand                     7
            call CatalogAdd(catalogs[7], 'I010')        //Novice Stick                  7
            call CatalogAdd(catalogs[7], 'I03A')        //Mind Staff                    7
            
            //class 8
            call CatalogAdd(catalogs[8], 'I046')        //Wooden Bow                    8
            
            
            //add item catalogs to class catalogs
            ///////////////////////////////////////////////////////////////
            call CatalogAddCatalog(classCatalogs[0], catalogs[0])
            call CatalogAddCatalog(classCatalogs[0], catalogs[1])
            call CatalogAddCatalog(classCatalogs[0], catalogs[2])
            call CatalogAddCatalog(classCatalogs[0], catalogs[3])
            call CatalogAddCatalog(classCatalogs[0], catalogs[4])
            call CatalogAddCatalog(classCatalogs[0], catalogs[5])
            call CatalogAddCatalog(classCatalogs[1], catalogs[0])
            call CatalogAddCatalog(classCatalogs[1], catalogs[1])
            call CatalogAddCatalog(classCatalogs[1], catalogs[2])
            call CatalogAddCatalog(classCatalogs[1], catalogs[3])
            call CatalogAddCatalog(classCatalogs[1], catalogs[6])
            call CatalogAddCatalog(classCatalogs[2], catalogs[0])
            call CatalogAddCatalog(classCatalogs[2], catalogs[1])
            call CatalogAddCatalog(classCatalogs[2], catalogs[7])
            call CatalogAddCatalog(classCatalogs[3], catalogs[0])
            call CatalogAddCatalog(classCatalogs[3], catalogs[1])
            call CatalogAddCatalog(classCatalogs[3], catalogs[2])
            call CatalogAddCatalog(classCatalogs[3], catalogs[8])
            call CatalogAddCatalog(classCatalogs[4], catalogs[0])
        endmethod
    endstruct

    struct HeroCatalog2 extends array
        implement Catalog
        
        private static method onInit takes nothing returns nothing
            //0
            call add('H013')        //Refugee
            
            //1
            call add('H002')        //Warrior
            call add('H00S')        //Pikeman
            call add('H00T')        //Legionaire
            call add('H009')        //Rogue
            call add('H007')        //Medium
            call add('H00B')        //Oracles
            call add('H020')        //Shaman
            call add('H01W')        //Blader
            call add('H00N')        //Slayers
            call add('H01Z')        //Trickster
            call add('H00E')        //Ranger
            
            //2
            call add('H00G')        //Warlord
            call add('H00U')        //Lancer
            call add('H00V')        //Brigand
            call add('H00F')        //Eluminator
            call add('H021')        //Dualist
            call add('H01Y')        //Shadow Slayer
            call add('H01X')        //Executioner
            call add('H00H')        //Prophet
            call add('H00I')        //Sage
            call add('H022')        //Witch Doctor
            
            //0
            call add('H01A')        //Wanderer
        endmethod
    endstruct
//! endtextmacro

and that's just the beginning
 
Level 4
Joined
Jul 29, 2010
Messages
94
good map 5/5
but any bugs is not cool
fix it plz, me and my friends want play ;D
w8 2.0 vers, you add more content to 2.0? items, bosses, quests?
 
Level 14
Joined
Dec 13, 2008
Messages
617
I have 5mins+ but still processing... I think I miss something because when I open NEWGEN WE, after installing cJass a dialog box appear and said something like "error triggers" but I hit to continue and load the maps then save it. "Waiting for the end of time"...
 
Level 14
Joined
Dec 13, 2008
Messages
617
I didn't disable jasshelper
I follow what you said to try a new map, then jasshelper succes at this time.

Edit:
I load the origin map dialogue box said this maps not supported version something like that but I proceed then to >load map >then save it success!
 
You need to follow the instructions in the chapter. One of them was to disable cjass.

edit
here's the latest save/load stuff..

you are very welcome. You now have the best save/load implementation ever created inside of your map : P. I worked very hard on it ;D.

edit
everyone, keep your code from the previous version, don't get one out of this one. I forgot to save item charges >: O, lol, so I'll be overwriting v2 encoder tomorrow.


To load older codes, it's -load version,code

For example, from the previous, it'd be -load 1,code


And yea... 23 char code for a lvl 1 with 4 items etc remember? Now it's 9 >: ).

23 char code for maxed out dude, now it's 22. It'd be even better if warriors couldn't use just about every item in the map, but w/e. If you went caster, it'd prob be around 18 cuz they can use very few items.
 

Attachments

  • PearlEastKingdom1.9.w3x
    4.7 MB · Views: 87
Last edited:
Level 5
Joined
Feb 27, 2011
Messages
176
Off topic :
@jxtanghero .. You remember that i wanted you help you with items..
Well my comp crashed..So i had a chance to instal windows 7..
And i lost a couple of my file's ..
And the worst thing is that the windows 7 that is freshly instaled isnt working..
So i had to go to net caffe to tell you this..
Dont expect my work in any time soon ^^ if you still want help ^ ^
Back on Topic : Well i really love the new version..Alot of things improved ..
I cant tell you more cuz of my situation :/ Peace out!
 
Level 14
Joined
Dec 13, 2008
Messages
617
Off topic :
@jxtanghero .. You remember that i wanted you help you with items..
Well my comp crashed..So i had a chance to instal windows 7..
And i lost a couple of my file's ..
And the worst thing is that the windows 7 that is freshly instaled isnt working..
So i had to go to net caffe to tell you this..
Dont expect my work in any time soon ^^ if you still want help ^ ^
Back on Topic : Well i really love the new version..Alot of things improved ..
I cant tell you more cuz of my situation :/ Peace out!

That's sad, but you could still help sir if you have free time PM me.
 
Here we go, added item charges

Some level 1 refugee codes. It has the starting 4 items and I am just using the healing pot from code to code (-1 charge). At the second last, I have no healing pots left and the start 200 gold. At the end, I spend my 200g on pots and drop them, then save. This was in single player, which has a bit higher security than multiplayer. Notice how drastically the code changes with super small value changes ^)^ (1 bit, smallest value change possible)

gl to people trying to crack this =P
Code:
7Ikq-AJrp-8O5Y (10 item charge)
HRQw-zbbT-m6vA (9 item charge)
sUEC-YSNC-kWkA (8)
DL2y-gdGT-r8EV (7)
a3uH-9WgP-uGpb
Zl0M-WV1O-Hsxw (5)
aUVk-u7aw-LB9T
DF9b-mgo0-YorX (3)
bJCQ-R7IB-AEiy
HrNX-81cu-OxhX (1)
4W63-oOmE-wRA (0),(200g)
1Q4y-ndXz-m (0),(0g)

Lucky for me, my lvl 20 didn't have any items with charges on it (lost my v1 code and had the old v2 code, hehe), so I didn't lose it in the last version : D

My code from last version (the old v2) loaded ;D fSBL-YwHS-0u5t-PcJ3-Sezd-M2


Ok, so to continue getting me to manage the save/load stuff for you for free, you have to improve the terrain, fix bugs, and etc ; ). Make it a map I want to play ;D. Try to remove all grinding ^)^

Also please try to learn vJASS so that you can recode the map in vjass so that it runs faster ^)^.
 

Attachments

  • PearlEastKingdom1.9.w3x
    4.7 MB · Views: 194
Last edited:
Level 14
Joined
Dec 13, 2008
Messages
617
I really want to, my problem is how to install LUA, I was little confuse in that, could you please send me LUA script with a fix and full one so I can only copy paste this into my map. I was read the tutorial last night but I don't know were to place the script and what exactly script I needed to copy
EDIT:
Map Testing...
 
You can't just cnp the script into a map, that's impossible : ). I can't send you a copy because it's not that simple. You have to install it to your computer ;p. The only way I could get it on your computer is if I was there =D.

The Lua stuff isn't too difficult to install. I already changed all of the necessary lines, so what you need to do is this.

First, disable all of the Encoder stuff (UnitStatePercent, etc). Only keep LUA_FILE_HEADER enabled.

At the very top of the script, change this portion
JASS:
//Writes map header to map (run once, but multiple times won't hurt)
//------------------------------------------------------------------------
    //function initmap()
    
    //comment after initialization
    /*
    //! externalblock extension=lua FileExporter $FILENAME$
        //! runtextmacro LUA_FILE_HEADER()
        //! i initmap()
    //! endexternalblock
    */

    //uncomment after initialization
    //! import "luajass.PearlEastKingdom.j"
//------------------------------------------------------------------------

To this
JASS:
//Writes map header to map (run once, but multiple times won't hurt)
//------------------------------------------------------------------------
    //function initmap()
    
    //comment after initialization
    ///*
    //! externalblock extension=lua FileExporter $FILENAME$
        //! runtextmacro LUA_FILE_HEADER()
        //! i initmap()
    //! endexternalblock
    //*/

    //uncomment after initialization
    ///! import "luajass.PearlEastKingdom.j"
//------------------------------------------------------------------------

Then hit save and let it save. When it's saved, change it back to this and hit save again.
JASS:
//Writes map header to map (run once, but multiple times won't hurt)
//------------------------------------------------------------------------
    //function initmap()
    
    //comment after initialization
    /*
    //! externalblock extension=lua FileExporter $FILENAME$
        //! runtextmacro LUA_FILE_HEADER()
        //! i initmap()
    //! endexternalblock
    */

    //uncomment after initialization
    //! import "luajass.PearlEastKingdom.j"
//------------------------------------------------------------------------

Now you'll have LUA_FILE_HEADER installed and ready to go. Create a new trigger and convert it to custom text.

Put this into the trigger
JASS:
//GetObjectId 1.0.0.5
//! externalblock extension=lua FileExporter $FILENAME$
    //! runtextmacro LUA_FILE_HEADER()
    //! i writelua("GetObjectId", [[
    //////////////////////////////////////////////////////////////////
    //code

    //! i function getobjectid(obj, objecttype)
        //obj refers to the base object
            //"hpea", "Amov", "Bphx", etc
        //objectType refers to the type of object to create
        
        //! i if (currentobjecttype() ~= objecttype) then
            //! i setobjecttype(objecttype)
        //! i end
        //! i local object = generateid(obj)
        //! i while (
            //! i objectexists(object) or
            //! i string.find(object, "'", 1, true) ~= nil or
            //! i string.find(object, '\\', 1, true) ~= nil or
            //! i string.find(object, ',', 1, true) ~= nil or
            //! i string.find(object, '/', 1, true) ~= nil) do
            
            //! i object = generateid(obj)
            
        //! i end
        //! i return object
    //! i end

    //end code
    //////////////////////////////////////////////////////////////////
    //! i ]])
//! endexternalblock

Save. Delete the code out of the trigger and then put this into it
JASS:
//GetVarObject 3.0.0.5
//function getvarobject(base, objtype, varname, import)
    //base: base id of object
        //"hpea", "Amov", "Bphx", etc
        
    //objtype: type of object
        //"units", "abilities", "items", etc
        
    //varname: name assigned to variable
        //OBJECTTYPE_NAME
        //"UNITS_MY_UNIT", "ABILITIES_RAIN_OF_CHAOS", etc
        
    //import: should the variable be imported into the map as a global?
        //true, false, nil
        
//function getvarobjectname(value)
    //retrieve name given value ("hpea", etc)
    
//function getvarobjectvalue(objectname)
    //retrieve value given name ("UNITS_MY_UNIT", etc)
    
//function updateobjects()
    //call at end of script
        
//! externalblock extension=lua FileExporter $FILENAME$
    //! runtextmacro LUA_FILE_HEADER()
    
    //! i writelua("GetVarObject", [[
    //////////////////////////////////////////////////////////////////
    //code
    
    //! i local filename = "JassGlobals"
    //! i local filename_lua = getfilename() .. "_VAR_OBJECT_JassGlobals1"
    
    //! i dofile("GetObjectId")
    
    //! i local vars = readlua(filename_lua)
    //! i local vars2 = readjass(filename)
    //! i local varsdata
    //! i local newvars = ""
    
    //! i if (vars == nil) then
        //! i vars = {}
        //! i vars2 = ""
        //! i varsdata = ""
    //! i else
        //! i if (vars ~= "return {}") then
            //! i varsdata = vars:sub(9,vars:len()-1)
            //! i vars = loadstring(vars)()
        //! i else
            //! i varsdata = ""
            //! i vars = {}
        //! i end
        //! i if (vars2 == nil) then
            //! i vars2 = ""
        //! i else
            //! i vars2 = vars2:sub(string.len("globals")+1, vars2:len()-string.len("\nendglobals"))
        //! i end
    //! i end
    
    //! i local imports = {}
    //! i do
        //! i local s,k = vars2:find("constant integer ")
        //! i local s2,k2
        //! i while (s ~= nil) do
            //! i s2,k2 = vars2:find("=", k)
            //! i imports[vars2:sub(k+1, s2-1)] = true
            //! i s,k = vars2:find("constant integer ", k2)
        //! i end
    //! i end
    
    //! i function getvarobject(base, objtype, varname, import)
        //! i local value = vars[varname]
        //! i local imported
        //! i if (import == nil) then
            //! i import = false
        //! i end
        //! i if (value == nil) then
            //! i imported = false
            //! i value = getobjectid(base, objtype)
            //! i while (vars["1" .. value] ~= nil) do
                //! i value = getobjectid(base, objtype)
            //! i end
            //! i vars[varname] = value
            //! i vars["1" .. value] = varname
            //! i if (newvars == "") then
                //! i newvars = "['" .. varname .. "']='" .. vars[varname] .. "',['1" .. value .. "']='" .. varname .. "'"
            //! i else
                //! i newvars = newvars .. ",['" .. varname .. "']='" .. vars[varname] .. "',['1" .. value .. "']='" .. varname .. "'"
            //! i end
        //! i else
            //! i imported = imports[varname] or false
            //! i if (currentobjecttype() ~= objtype) then
                //! i setobjecttype(objtype)
            //! i end
        //! i end
        //! i if (import ~= imported) then
            //! i if (not imported) then
                //! i vars2 = vars2 .. "\nconstant integer " .. varname .. "='" .. value .. "'"
            //! i elseif (imported) then
                //! i local s,k = string.find(vars2, "\nconstant integer " .. varname .. "='" .. value .. "'")
                //! i vars2 = vars2:sub(1,s-1) .. vars2:sub(k+1, vars2:len())
            //! i end
            //! i imports[varname] = import
        //! i end
        //! i return value
    //! i end
    
    //! i function getvarobjectname(value)
        //! i return vars["1" .. value]
    //! i end
    
    //! i function getvarobjectvalue(objectname)
        //! i return vars[objectname]
    //! i end
    
    //! i function updateobjects()
        //! i writejass(filename, "globals" .. vars2 .. "\nendglobals")
        //! i if (varsdata == "") then
            //! i varsdata = newvars
        //! i elseif (newvars ~= "") then
            //! i varsdata = varsdata .. "," .. newvars
        //! i end
        //! i newvars = ""
        //! i writelua(filename_lua, "return {" .. varsdata .. "}")
    //! i end

    //end code
    //////////////////////////////////////////////////////////////////
    //! i ]])
//! endexternalblock

Save, delete the code out of the trigger and then put this into it
JASS:
//! externalblock extension=lua ObjectMerger $FILENAME$
    //! runtextmacro LUA_FILE_HEADER()
    //! i dofile("GetVarObject")
    
    //! i local id = getvarobject("Hvsh", "units", "UNITS_UNIT_STATE_PERCENT", true)
    
    //! i createobject("Hvsh", id)
    //! i makechange(current, "uabi", "Aloc,Avul")
    //! i makechange(current, "usid", "0")
    //! i makechange(current, "usin", "0")
    //! i makechange(current, "usca", "0")
    
    //! i updateobjects()
//! endexternalblock

Then save, then close** the map, then open the map, then *delete the trigger* then enable all of the encoder stuff, then hit save. Your map should then save properly and you'll have all of the Lua stuff you need installed on to your machine =).


There, step by step to get Encoder running in your map : p. To convert to custom text, there's an edit menu in the top left corner of the trigger editor. Select the trigger, then click edit -> Convert to custom text
 
Level 14
Joined
Dec 13, 2008
Messages
617
Alright, this one works and much better thanks a lot I get it now, Now I need to go home first...

SAVE/LOAD was awesome and it's really great, your better have hard time for this and I was thinking how to repay you for all of this. You did a great job dude "leave me all the rest..." -Linkin_Park
 
Would you like me to modify the save/load stuff so that you don't need Lua? I can do that. You already have the right object in the map and everything, so no real need. However, if you do ever plan on more complex things like Attack Indexing and so on, you'd really need the Lua stuff to be working..

Eh, we'll see if you can get it working at your house.
 
All that changed in the new one was the code.. it's the thing I uploaded, lol...

And I er... didn't test all of it... well, I didn't test saving horses and their inventories ;p, so hf ;D

Oh actually, the current horse can only save 2 items even tho it has an inventory of 6 because we're waiting on jx to add the other 2 horses in (4 slot and 6 slot inventory) and update the current one to have a 2 slot inventory ;o.

So if only 2 items in your horse save, that's why =). Also, only charged items save on horses.

On refugee, he can only hold charged items. If you pick up an iron sword and wonder why it didn't save, that's why =p. Blame it on the author for having crummy pick up stuff right now =).

Also, I don't know if the elemental stuff saves yet... last time I wrote to the right arrays, it still ended up being 0 >.<. No clue what's going on

edit
The items are saved based on inventory size, so saving 6 items on a horse that only saves 2 items = lost gold ;D. So wait for jx to update the current horse to have an inventory size of 2 before you get one, or save it with only a max of 1 item on it.
 
Level 14
Joined
Dec 13, 2008
Messages
617
I'm back!

Would you like me to modify the save/load stuff so that you don't need Lua? I can do that. You already have the right object in the map and everything, so no real need. However, if you do ever plan on more complex things like Attack Indexing and so on, you'd really need the Lua stuff to be working..

EDIT:

No error found at all, I think I already install LUA proper at this time.
 
Last edited:
Level 2
Joined
Nov 8, 2010
Messages
14
HeY why cant i save? and theres a bug everytime when i change to 1st class the 2nd player gets DC need help plss
 
uh... I'll check it out ; o. Seems strange since when I was testing it, it worked fine...


no way to fix desyncs, again that's part of the map... that's one of the things that makes the map what it was. You have a % chance to go up, and if you fail you all d/c and you lose your chars =P.

No, but it is a bug in the map that's up to the author to fix. I hate GUI, so unless he's willing to convert the whole map to vjass, I won't touch it =P.
 
Level 14
Joined
Dec 13, 2008
Messages
617
I disable CODER because I don't have any yet ability to edit that code, but for sure as mr. Adiktuz said I will try to convert all in vjass, after I meet the various code that I needed to learn first. But now honestly I have no idea yet how desyncs happen. If someone could help me with that particular prob, I'm willing to listen.
 

mio

mio

Level 1
Joined
May 18, 2010
Messages
2
i can't host the game when i try to host it just returns to local area network pls help
 
Top