• 🏆 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!

[General] Discovering cool things with Encoder

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
like this
Code:
call inventory.linka(item)         //items

call item.link(1,ItemCatalog.count,item,INV_ITEM)

and this

JASS:
//6 slot inventory
call item1.link(1,ItemCatalog.count,item2,0)        //6 slots
call item2.link(1,ItemCatalog.count,item3,0)        //5 slots
call item3.link(1,ItemCatalog.count,item4,0)        //4 slots
call item4.link(1,ItemCatalog.count,item5,0)        //3 slots
call item5.link(1,ItemCatalog.count,item6,0)        //2 slots
//item6                                             //1 slot

//12 slot inventory
call item12.link(1,ItemCatalog.count,item1,0)       //12 slots
call item12.link(1,ItemCatalog.count,item2,0)       //12 slots

And this
JASS:
local CodeRange level = CodeRange.create(1,20)
local CodeRange xp = CodeRange.create(0, 99)

call hero.linka(level)          //level
call level.link(1,19,xp,0)      //xp

And that's with a little work.

Also, consider this... when you save gold, the max is 1,000,000, but will a level 1 have 1000000 gold ever? Thus you link the level to the resources!!

level 1 - 1000
level 2 - 5000
level 3 - 15000

for example : ). This would mean that you'd want to save the level last-

level
->xp
->gold
->lumber

but Encoder 2.0.2.0 can't do links on the last value at the moment...

anyways, just a lot of fun and interesting thoughts =)

Maybe we should collect a bundle of really cool algorithms and then write a huge advanced tut on them. I've been seeing some new things with Catalog too O-o.
 
Status
Not open for further replies.
Top