• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

*.mix mpq archive

Status
Not open for further replies.
Level 5
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
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
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
 

Attachments

  • new.7z
    84.7 KB · Views: 556
  • screenshot.png
    screenshot.png
    31.8 KB · Views: 641
Last edited:
The game already loads up "War3Mod.mpq".

Also, even if you automatically enable local files through the .mix file, players will still need to download the .mix, essentially making it useless.

Furthermore Preloader doesn't work properly on the newest patches, so codeless save/load is broken until Blizzard fixes that (I'm really hoping next patch).
 
Furthermore Preloader doesn't work properly on the newest patches, so codeless save/load is broken until Blizzard fixes that (I'm really hoping next patch).
I want to be honest here: Preloader can die in a fire. Blizzard should just implement the ability to read and write into a secure encrypted and permanent gamecache like they did in SC2 (I think it was called banks there).
 
I want to be honest here: Preloader can die in a fire. Blizzard should just implement the ability to read and write into a secure encrypted and permanent gamecache like they did in SC2 (I think it was called banks there).

It should still work. I mean, why have a native declared that does nothing?

I think allowing game cache to work online would be a viable solution for Blizzard, but in the meantime fixing Preloader is good enough.
 
Status
Not open for further replies.
Top