- Joined
- Jun 7, 2012
- Messages
- 66
So here is a little useful thing. It's "new.mix" file. You can open it in mpq editor (I use ladik's MPQ editor) and add some files. You put this mix file in your warcraft folder(where war3.exe is located), and when you run warcraft, these files will be avalaible for use like from any mpq archive. Just put all your files in folder "yourmapname", so it doesn't interfere with maps other than yours. Me and players of my map use mix-archive for 3 years, it works in lan/battle.net and doesn't require you to modify your executables/dlls.
Several examples of use:
-music pack for your map
-put all import in your mix file, but it makes mix-archive mandatory for players
-alternative unit models(bacisally you create 2 copies of 1 unit, one of them uses native warcraft model, other uses model from your *.mix archive, and then you use similar functions when you create unit
To check if player has ot doesn't have *.mix archive, I created text file "FileModule.cfg" and put it inside my mix-archive. File looks like this
On map initialization I used Preloader("myrpgfolder\\FileModule.cfg"), then read values with GetPlayerTechMaxAllowed(Player(15) , 3333) and synchronized them through gamecache.
Sadly, Preloader() in 1.28 ignores file-path and from 1.27 onwards ignores files in mpq archives.
Now my question is, is it possible to add script to this mix-file(similar to Memory hack ), that somehow automatically enables "Allow Local Files", if it is disabled in registry? I need it for codeless save/load system.
Edit: uploaded mix-archive which I used in my map if someone needs example. mycoolrpg.mix
Several examples of use:
-music pack for your map
-put all import in your mix file, but it makes mix-archive mandatory for players
-alternative unit models(bacisally you create 2 copies of 1 unit, one of them uses native warcraft model, other uses model from your *.mix archive, and then you use similar functions when you create unit
Code:
function AdvancedModel takes integer id returns integer//which unittypeid to create
local integer id1=LoadInteger(udg_h,id,2)
local integer id2=LoadInteger(udg_h,id,3)
local integer ans=id
if id1==0 or id2==0 then
return id
endif
if udg_Advanced[GetPlayerId(GetLocalPlayer())] then//boolean archive, where I store if player has *.mix archive
set ans=id2
endif
return ans
endfunction
//add alternative models to your hashtable on map initialization etc
function AddAdvancedModel takes integer id1,integer id2 returns nothing//unittypeid1,unittypeid alternative
call SaveInteger(udg_h,id1,2,id1)
call SaveInteger(udg_h,id1,3,id2)
call SaveInteger(udg_h,id2,2,id1)
call SaveInteger(udg_h,id2,3,id2)
endfunction
To check if player has ot doesn't have *.mix archive, I created text file "FileModule.cfg" and put it inside my mix-archive. File looks like this
Code:
function PreloadFiles takes nothing returns nothing
call SetPlayerTechMaxAllowed(Player(15),3333,32)//32-version of archive
endfunction
Sadly, Preloader() in 1.28 ignores file-path and from 1.27 onwards ignores files in mpq archives.
Now my question is, is it possible to add script to this mix-file(similar to Memory hack ), that somehow automatically enables "Allow Local Files", if it is disabled in registry? I need it for codeless save/load system.
Edit: uploaded mix-archive which I used in my map if someone needs example. mycoolrpg.mix
Attachments
Last edited: