- Joined
- May 27, 2009
- Messages
- 495
Hello dragon... any updates on my spell request xD
naa ...... still updating my map..
naa ...... still updating my map..
Hello dragon... any updates on my spell request xD
naa ...... still updating my map..
thanks....
Maybe the BladeStorm (Caster) buff?
Does Archer Model does have it? NightElf model... maybe it doesn't have
EDIT:
and why I'm wondering why does the Order of Information in the Object editor does not match the original WE... I recently reformatted my computer and the order of informations are different... I am already really good at using that order.....
and also... I always get this error:
See attachment
have you uploaded it?? where is it xD
just waiting..... for the mean time... is it ok to Turn Off UMSWE?
gee thanks...
But... Is this a bug?
When I try to use this integer.... [(Percentage Life of)(Triggering Unit)] x (10.00)
JassHelper always says Unable to Convert Real to Arithmetic.......
Or sometimes unable to convert Arithmetic to Null
I found a bug on jass Helper this is on JNGPS
it always gives me an error... but this happens when I use 1.3b
Please fix it... see the attached file
I somehow cant update to the newest JassHelper version? I've downloaded it directly from wc3c, replaced all the files in the JassHelper folder and nothing changed at all.
hmm thats very strange. well anyway i released 1.3c with new JassHelper!
Somehow you messed up wehack.lua - you've erased half of its contents (it's 16KB now, and it should be 32KB). I hope you have previous version backed up.Dark_Dragon said:i released 1.3c
-- This file is executed once on we start up. The state perseveres
-- through callbacks
--
-- wehack.runprocess: Wait for exit code, report errors (grimext)
-- wehack.runprocess2: Wait for exit code, don't report errors (jasshelper)
-- wehack.execprocess: Don't wait for exit code (War3)
--
grimregpath = "Software\\Grimoire\\"
--warcraftdir = grim.getregpair(grimregpath,"War3InstallPath")
--if warcraftdir == 0 then
-- wehack.messagebox("Error, could not find warcraft install path in wehack.lua")
--end
egui_text = "Extra Graphic User Interface (1.3)\n\nEGUI is advanced GUI which works for 1.24+ patches.\n\nEGUI has many new features and fixes.\n\nIn order to use EGUI features use this GUI action:\nCustom Script: Enable EGUI"
jngps_text = "Jass NewGen Pack Special (1.3v)\n\nHack by: Dark Dragon & Van Damm\nCredits go to people who made JNGP\nand those who made tools implemented in JNGPS\n\nJNGPS is a group of scripts that are recoded\nto work with 1.24+ patch.\nAs well adding custom functions in jass and GUI"
isstartup = true
grimdir = grim.getcwd()
dofile("wehacklib.lua")
dofile("findpath.lua")
if path==0 or path=="" then
path = "."
end
mapvalid = true
cmdargs = "" -- used to execute external tools on save
confregpath = "HKEY_CURRENT_USER\\Software\\Grimoire\\"
haveext = grim.exists("grimext\\grimex.dll")
if haveext then
utils = wehack.addmenu("Extensions")
end
haveumswe = haveext and grim.exists("umswe\\umswecore.lua")
if haveumswe then
ums = wehack.addmenu("UMSWE")
end
whmenu = wehack.addmenu("Grimoire")
wh_window = TogMenuEntry:New(whmenu,"Start War3 with -window",nil,true)
wh_opengl = TogMenuEntry:New(whmenu,"Start War3 with -opengl",nil,false)
wh_grimoire = TogMenuEntry:New(whmenu,"Start War3 with Grimoire",nil,true)
if not grim.isnewcompiler(path.."\\war3.exe") then
wh_enablewar3err = TogMenuEntry:New(whmenu,"Enable war3err",nil,true)
wh_enablejapi = TogMenuEntry:New(whmenu,"Enable japi",nil,false)
--wh_machine = TogMenuEntry:New(whmenu,"Enable warmachine",nil,false)
end
wehack.addmenuseparator(whmenu)
wh_tesh = TogMenuEntry:New(whmenu,"Enable TESH",nil,true)
if grim.isdotnetinstalled() then
wh_colorizer = TogMenuEntry:New(whmenu,"Enable Colorizer",nil,true)
end
wh_nolimits = TogMenuEntry:New(whmenu,"Enable no limits",
function(self) grim.nolimits(self.checked) end,false)
wh_oehack = TogMenuEntry:New(whmenu,"Enable object editor hack",
function(self) grim.objecteditorhack(self.checked) end,true)
wh_syndisable = TogMenuEntry:New(whmenu,"Disable WE syntax checker",
function(self) grim.syndisable(self.checked) end,true)
wh_descpopup = TogMenuEntry:New(whmenu,"Disable default description nag",
function(self) grim.descpopup(self.checked) end,true)
wh_autodisable = TogMenuEntry:New(whmenu,"Don't let WE disable triggers",
function(self) grim.autodisable(self.checked) end,true)
wh_alwaysenable = TogMenuEntry:New(whmenu,"Always allow trigger enable",
function(self) grim.alwaysenable(self.checked) end,true)
wh_disablesound = TogMenuEntry:New(whmenu,"Mute editor sounds",nil,true)
--wh_enablewar3err = TogMenuEntry:New(whmenu,"Enable war3err",nil,true)
wh_firstsavenag = TogMenuEntry:New(whmenu,"Disable first save warning",nil,true)
-- when warmachine is turned on, war3err must not be on
--function setwar3err()
-- if wh_machine.checked then
-- grim.setregstring(confregpath,"Enable war3err","off")
-- wehack.checkmenuentry(wh_enablewar3err.menu,wh_enablewar3err.id,0)
-- end
--end
-- when warmachine is turned on, war3err must not be on
--function setwarmachine()
-- if wh_enablewar3err.checked then
-- grim.setregstring(confregpath,"Enable warmachine","off")
-- wehack.checkmenuentry(wh_machine.menu,wh_machine.id,0)
-- end
--end
--if not grim.isnewcompiler(path.."\\war3.exe") then
--wh_enablewar3err.cb = setwarmachine
--wh_machine.cb = setwar3err
--end
wehack.addmenuseparator(whmenu)
weukey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\WE Unlimited_is1"
weuval = "InstallLocation"
weupath = grim.getregpair(weukey,weuval)
haveweu = grim.exists(weupath .. "WE Unlimited.exe")
if haveweu then
wh_useweu = TogMenuEntry:New(whmenu,"Integrate WEU",nil,false)
end
usetestmapconf = (grim.getregpair(confregpath,"Use custom test map settings") == "on")
function testmapconfig()
usetestmapconf = wehack.testmapconfig(path,usetestmapconf)
if usetestmapconf then
grim.setregstring(confregpath,"Use custom test map settings","on")
else
grim.setregstring(confregpath,"Use custom test map settings","off")
end
end
wh_configtest = MenuEntry:New(whmenu,"Customize test map settings",testmapconfig);
function attachdebugger()
wehack.execprocess("w3jdebug\\pyw3jdebug.exe")
end
havedebugger = grim.exists("w3jdebug\\pyw3jdebug.exe")
if havedebugger then
wh_debug = MenuEntry:New(whmenu,"Attach debugger",attachdebugger)
end
function aboutpopup()
wehack.showaboutdialog("Grimoire 1.5")
end
wh_about = MenuEntry:New(whmenu,"About Grimoire ...",aboutpopup)
havejh = grim.exists("jasshelper\\jasshelper.exe")
if havejh then
jhmenu = wehack.addmenu("JassHelper")
jh_enable = TogMenuEntry:New(jhmenu,"Enable JassHelper",nil,true)
jh_debug = TogMenuEntry:New(jhmenu,"Debug Mode",nil,false)
jh_disable = TogMenuEntry:New(jhmenu,"Disable vJass syntax",nil,false)
jh_disableopt = TogMenuEntry:New(jhmenu,"Disable script optimization",nil,false)
-- if grim.exists("jasshelper\\jasshelper.dll") then
-- jh_fast = TogMenuEntry:New(jhmenu,"Fast external evaluation",nil,true)
-- else
-- jh_fast = nil
-- end
wehack.addmenuseparator(jhmenu)
function jhshowerr()
-- if jh_fast ~= nil and jh_fast.checked then
-- wehack.showpreviouserrors();
-- else
wehack.execprocess("jasshelper\\jasshelper.exe --showerrors")
-- end
end
function jhabout()
-- if jh_fast ~= nil and jh_fast.checked then
-- wehack.jasshelperabout();
-- else
wehack.execprocess("jasshelper\\jasshelper.exe --about")
-- end
end
jhshowerrm = MenuEntry:New(jhmenu,"Show previous errors",jhshowerr)
jhaboutm = MenuEntry:New(jhmenu,"About JassHelper ...",jhabout)
end
-- cJass#1
have_ah = grim.exists("adichelper\\adichelper.exe")
if have_ah then
ah_menu = wehack.addmenu("C Jass")
ah_enable = TogMenuEntry:New(ah_menu,"Enable cJass Parser",nil,true)
ah_enableopt = TogMenuEntry:New(ah_menu,"Enable (C)Optimizer",nil,true)
wehack.addmenuseparator(ah_menu)
ah_opt_remove = TogMenuEntry:New(ah_menu,"Remove unused code",nil,true)
wehack.addmenuseparator(ah_menu)
if (grim.getregpair(confregpath,"First launch passed") ~= "yes") then
ah_firstlaunch = true
end
if ah_firstlaunch then
if (wehack.runprocess2("AdicHelper\\AHupdate.exe /ask") == 6) then
ah_enableupdate = true
end
grim.setregstring(confregpath,"First launch passed","yes")
if ah_enableupdate then
grim.setregstring(confregpath,"Enable AutoUpdate","on")
else
grim.setregstring(confregpath,"Enable AutoUpdate","off")
end
end
ah_enableupdate = TogMenuEntry:New(ah_menu,"Enable AutoUpdate",nil,false)
if ah_enableupdate.checked then
wehack.execprocess("adichelper\\AHupdate.exe /silent")
end
ah_update = MenuEntry:New(ah_menu,"Check for updates now",function() wehack.execprocess("adichelper\\AHupdate.exe") end)
ah_updateopt = MenuEntry:New(ah_menu,"AutoUpdate settings", function() wehack.execprocess("adichelper\\AHupdate.exe /options") end)
wehack.addmenuseparator(ah_menu)
-- Game version switch
ah_version = MenuEntryGroup:New(ah_menu,"Game version switch")
ah_ver23m = SwitchMenuEntry:New(ah_version,"Compile for game version 1.23")
ah_ver24m = SwitchMenuEntry:New(ah_version,"Compile for game version 1.24+",true)
wehack.addmenuseparator(ah_menu)
ah_aboutm = MenuEntry:New(ah_menu,"About cJass ...",function() wehack.execprocess("adichelper\\adichelper.exe") end)
end
-- /cJass#1
-- Campaigh Helper --
--function ch_execute()
-- wehack.runprocess2("CampaignHelper\\Campaign Helper.exe")
--end
--havech = grim.exists("CampaignHelper\\Campaign Helper.exe")
--if havech then
-- ch_menu = wehack.addmenu("CampaignHelper")
-- MenuEntry:New(ch_menu, "Run Compiler", ch_execute)
--end
-- Jass New Gen Special
havespec = grim.exists("egui\\egui.mpq")
if havespec then
-- Menu stuff
jngps = wehack.addmenu("Special")
if haveumswe then
spec_mod = MenuEntryGroup:New(jngps,"Which extension to use")
spec_mod_egui = SwitchMenuEntry:New(spec_mod,"Enable EGUI")
spec_mod_umswe = SwitchMenuEntry:New(spec_mod,"Enable UMSWE")
spec_mod_nothing = SwitchMenuEntry:New(spec_mod,"Disable addons",true)
currentmod = spec_mod.active
else
spec_egui = CheckMenuEntry:New(jngps,"Enable EGUI",false)
end
wehack.addmenuseparator(jngps)
spec_tesh = MenuEntryGroup:New(jngps,"Which TESH to use")
spec_tesh_classic = SwitchMenuEntry:New(spec_tesh,"Use classic TESH")
spec_tesh_horus = SwitchMenuEntry:New(spec_tesh,"Use updated TESH",true)
wehack.addmenuseparator(jngps)
spec_theme = MenuEntryGroup:New(jngps,"TESH theme")
spec_theme_default = SwitchMenuEntry:New(spec_theme,"TESH default theme",true)
spec_theme_jasscraft = SwitchMenuEntry:New(spec_theme,"TESH JassCraft theme")
wehack.addmenuseparator(jngps)
egui_info = MenuEntry:New(jngps, "About EGUI", function() wehack.messagebox(egui_text, "About EGUI", false) end)
jngps_info = MenuEntry:New(jngps, "About JNGPS", function() wehack.messagebox(jngps_text, "JNGPS Info", false) end)
-- EGUI related
if not haveumswe then
spec_egui.cb = function() wehack.messagebox("You need to restart World Editor now.","NewGen Special",false) end
end
-- TESH changer eye candy
currenttesh = spec_tesh.active
function checktesh(self)
local name = ""
if (currenttesh ~= self.index) then
if self.index == 1 then
name = "original"
else
name = "updated"
end
if not grim.exists("tesh\\dlls\\"..name.."\\TESH.dll") then
wehack.messagebox("Unable to load "..name.." TESH!","NewGen Special")
end
wehack.messagebox("Switching to "..name.." TESH.\nPlease restart World Editor to apply changes.","NewGen Special",false)
end
end
spec_tesh.func = checktesh
-- TESH theme changer eye candy
currenttheme = spec_theme.active
function checktheme(name)
if grim.exists("tesh\\styles\\"..name.."\\Styles.ini") and grim.exists("tesh\\styles\\"..name.."\\TESH.ini") then
wehack.messagebox("Switching TESH to "..name.." theme.\nPlease restart World Editor to apply changes.","NewGen Special",false)
else
wehack.messagebox("Unable to load TESH "..name.." theme!","NewGen Special")
end
end
function applytheme(self)
if (self.index ~= currenttheme) then
if (self.index == 2) then
checktheme("JassCraft")
else
checktheme("default")
end
end
end
spec_theme.func = applytheme
else
ums_enabled = TogMenuEntry:New(ums,"Enable UMSWE",nil,false)
end
function initshellext()
local first, last = string.find(grim.getregpair("HKEY_CLASSES_ROOT\\WorldEdit.Scenario\\shell\\open\\command\\", ""),"NewGen",1)
if first then
wehack.checkmenuentry(shellext.menu,shellext.id,1)
else
local second, third = string.find(grim.getregpair("HKEY_CLASSES_ROOT\\WorldEdit.Scenario\\shell\\open\\command\\", ""),".bat",1)
if second then
wehack.checkmenuentry(shellext.menu,shellext.id,1)
else
wehack.checkmenuentry(shellext.menu,shellext.id,0)
end
end
end
function fixopencommand(disable,warpath,grimpath,filetype)
--local curval = grim.getregpair("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\open\\command\\","")
--if curval ~= 0 then
-- if disable then
-- grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\open\\command\\","",string.gsub(curval, "%%L", "%%1"))
-- else
-- grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\open\\command\\","",string.gsub(curval, "%%1", "%%L"))
-- end
--end
local wepath = "\""..grimpath.."\\NewGen WE.exe\""
if not grim.exists(grimpath.."\\NewGen WE.exe") then
wepath = "\""..grimpath.."\\we.bat\""
end
if disable then
grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\open\\command\\","","\""..warpath.."\\World Editor.exe\" -loadfile \"%L\"")
else
grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\open\\command\\","",wepath.." -loadfile \"%L\"")
end
end
function registerextension(disable,warpath,grimpath,filetype,istft)
if disable then
grim.deleteregkey("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\fullscreen\\command\\");
grim.deleteregkey("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\fullscreen\\");
grim.deleteregkey("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\windowed\\command\\");
grim.deleteregkey("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\windowed\\");
grim.deleteregkey("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\opengl\\command\\");
grim.deleteregkey("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\opengl\\");
else
--if istft then
-- gamepath = "\""..warpath.."\\Frozen Throne.exe\""
--else
-- gamepath = "\""..warpath.."\\Warcraft III.exe\""
--end
--grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\fullscreen\\","","Play Fullscreen")
--grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\fullscreen\\command\\","",gamepath.." -loadfile \"%L\"")
--grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\windowed\\","","Play Windowed")
--grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\windowed\\command\\","",gamepath.." -window -loadfile \"%L\"")
local gamepath = "\""..grimpath.."\\NewGen Warcraft.exe\""
if not grim.exists(grimpath.."\\NewGen Warcraft.exe") then
gamepath = "\""..grimpath.."\\startwar3.bat\""
end
grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\fullscreen\\","","Play Fullscreen")
grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\fullscreen\\command\\","",gamepath.." -loadfile \"%L\"")
grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\windowed\\","","Play Windowed")
grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\windowed\\command\\","",gamepath.." -window -loadfile \"%L\"")
grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\opengl\\","","Play With OpenGL")
grim.setregstring("HKEY_CLASSES_ROOT\\WorldEdit."..filetype.."\\shell\\opengl\\command\\","",gamepath.." -window -opengl -loadfile \"%L\"")
end
end
function toggleshellext()
local istft = (grim.getregpair("HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III\\", "InstallPathX") ~= 0)
local first, last = string.find(grim.getregpair("HKEY_CLASSES_ROOT\\WorldEdit.Scenario\\shell\\open\\command\\", ""),"NewGen",1)
local found = false
if first then
found = true
else
local second, third = string.find(grim.getregpair("HKEY_CLASSES_ROOT\\WorldEdit.Scenario\\shell\\open\\command\\", ""),".bat",1)
if second then
found = true
end
end
if path ~= 0 and grimdir ~= 0 then
fixopencommand(found,path,grimdir,"Scenario")
registerextension(found,path,grimdir,"Scenario",istft)
fixopencommand(found,path,grimdir,"ScenarioEx")
registerextension(found,path,grimdir,"ScenarioEx",istft)
fixopencommand(found,path,grimdir,"Campaign")
registerextension(found,path,grimdir,"Campaign",istft)
fixopencommand(found,path,grimdir,"AIData")
if found then
wehack.checkmenuentry(shellext.menu,shellext.id,0)
else
wehack.checkmenuentry(shellext.menu,shellext.id,1)
end
end
end
function initlocalfiles()
if grim.getregpair("HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III\\", "Allow Local Files") == 0 then
wehack.checkmenuentry(localfiles.menu,localfiles.id,0)
else
wehack.checkmenuentry(localfiles.menu,localfiles.id,1)
end
end
function togglelocalfiles()
if grim.getregpair("HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III\\", "Allow Local Files") == 0 then
grim.setregdword("HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III\\", "Allow Local Files", 1)
wehack.checkmenuentry(localfiles.menu,localfiles.id,1)
else
grim.setregdword("HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III\\", "Allow Local Files", 0)
wehack.checkmenuentry(localfiles.menu,localfiles.id,0)
end
end
function runobjectmerger(mode)
curmap = wehack.findmappath()
if curmap ~= "" then
source = wehack.openfiledialog("Unit files (*.w3u)|*.w3u|Item files (*.w3t)|*w3t|Doodad files (*.w3d)|*.w3d|Destructable files (*.w3b)|*.w3b|Ability files (*.w3a)|*.w3a|Buff files (*.w3h)|*.w3h|Upgrade files (*.w3q)|*.w3q|", "w3a", "Select files to import ...", true)
grim.log("got in lua: " .. source)
if source ~= "" then
list = strsplit("|", source);
-- cmdargs = "ObjectMerger \""..curmap.."\" "..wehack.getlookupfolders().." "..mode..fileargsjoin(list)
cmdargs = "grimext\\ObjectMerger.exe \""..curmap.."\" "..wehack.getlookupfolders().." "..mode..fileargsjoin(list)
grim.log("assembled cmdline: " .. cmdargs)
-- wehack.messagebox(cmdargs,"Grimoire",false)
wehack.savemap()
grim.log("called saved map")
end
else
showfirstsavewarning()
end
end
function runconstantmerger()
curmap = wehack.findmappath()
if curmap ~= "" then
source = wehack.openfiledialog("Text files (*.txt)|*.txt|", "txt", "Select files to import ...", true)
if source ~= "" then
list = strsplit("|", source);
-- cmdargs = "ConstantMerger \""..curmap.."\" "..wehack.getlookupfolders()..fileargsjoin(list)
cmdargs = "grimext\\ConstantMerger.exe \""..curmap.."\" "..wehack.getlookupfolders()..fileargsjoin(list)
-- wehack.messagebox(cmdargs,"Grimoire",false)
wehack.savemap()
end
else
showfirstsavewarning()
end
end
function runtriggermerger()
curmap = wehack.findmappath()
if curmap ~= "" then
source = wehack.openfiledialog("GUI Trigger files (*.wtg)|*.wtg|Custom Text Trigger files (*.wct)|*wct|", "wtg", "Select trigger data to import ...", true)
if source ~= "" then
list = strsplit("|", source);
-- cmdargs = "TriggerMerger \""..curmap.."\" "..wehack.getlookupfolders()..fileargsjoin(list)
cmdargs = "grimext\\TriggerMerger.exe \""..curmap.."\" "..wehack.getlookupfolders()..fileargsjoin(list)
-- wehack.messagebox(cmdargs,"Grimoire",false)
wehack.savemap()
end
else
showfirstsavewarning()
end
end
function runfileimporterfiles()
curmap = wehack.findmappath()
if curmap ~= "" then
source = wehack.openfiledialog("All files (*.*)|*.*|", "*", "Select files to import ...", true)
if source ~= "" then
list = strsplit("|", source);
inmpqpath = wehack.inputbox("Specify the target path ...","FileImporter","Units\\")
-- cmdargs = "FileImporter \""..curmap.."\" "..wehack.getlookupfolders()..argsjoin(inmpqpath,list)
cmdargs = "grimext\\FileImporter.exe \""..curmap.."\" "..wehack.getlookupfolders()..argsjoin(inmpqpath,list)
-- wehack.messagebox(cmdargs,"Grimoire",false)
wehack.savemap()
end
else
showfirstsavewarning()
end
end
function runfileimporterdir()
curmap = wehack.findmappath()
if curmap ~= "" then
source = wehack.browseforfolder("Select the source directory ...")
if source ~= "" then
-- cmdargs = "FileImporter \""..curmap.."\" "..wehack.getlookupfolders().." \""..source.."\""
cmdargs = "grimext\\FileImporter.exe \""..curmap.."\" "..wehack.getlookupfolders().." \""..source.."\""
-- wehack.messagebox(cmdargs,"Grimoire",false)
wehack.savemap()
end
else
showfirstsavewarning()
end
end
function runfileexporter()
curmap = wehack.findmappath()
if curmap ~= "" then
target = wehack.browseforfolder("Select the target directory ...")
if target ~= "" then
-- wehack.rungrimextool("FileExporter", curmap, removequotes(wehack.getlookupfolders()), target)
wehack.runprocess("grimext\\FileExporter.exe \""..curmap.."\" "..wehack.getlookupfolders().." \""..target.."\"")
end
else
showfirstsavewarning()
end
end
function runtilesetter()
curmap = wehack.findmappath()
if curmap ~= "" then
map = wehack.openarchive(curmap,15)
oldtiles = wehack.getcurrenttiles()
wehack.closearchive(map)
if oldtiles ~= "" then
newtiles = wehack.tilesetconfig(string.sub(oldtiles,1,1), string.sub(oldtiles,2))
if newtiles ~= "" then
tileset = string.sub(newtiles,1,1)
tiles = string.sub(newtiles,2)
if tileset ~= "" and tiles ~= "" then
-- cmdargs = "TileSetter \""..curmap.."\" "..wehack.getlookupfolders().." "..tileset.." "..tiles
cmdargs = "grimext\\TileSetter.exe \""..curmap.."\" "..wehack.getlookupfolders().." "..tileset.." "..tiles
wehack.savemap()
end
end
-- tileset = wehack.inputbox("Specify the tileset ...","TileSetter",string.sub(oldtiles,1,1))
-- if tileset ~= "" then
-- tiles = wehack.inputbox("Specify the tile list ...","TileSetter",string.sub(oldtiles,2))
-- if tiles ~= "" then
-- cmdargs = "grimext\\TileSetter.exe \""..curmap.."\" "..wehack.getlookupfolders().." "..tileset.." "..tiles
-- wehack.savemap()
-- end
-- end
end
else
showfirstsavewarning()
end
end
function showfirstsavewarning()
if wh_firstsavenag.checked then
return
else
wehack.messagebox("Could not find path to map, please try saving again","Grimoire",false)
end
end
function testmap(cmdline)
--if havejh and jh_enable.checked and not mapvalid then
-- return
--end
--wehack.messagebox(cmdline)
--mappath = strsplit(" ",cmdline)[2]
--compilemap_path(mappath)
if wh_opengl.checked then
cmdline = cmdline .. " -opengl"
end
if wh_window.checked then
cmdline = cmdline .. " -window"
end
if not grim.isnewcompiler(path.."\\war3.exe") then
if wh_grimoire.checked then
-- local args = string.gsub(cmdline,"\"([^\"]*)\" ","")
-- wehack.messagebox(args,"Grimoire",false)
-- cmdline = "startwar3.bat " .. args
local testmaparglist = argsplit(cmdline)
local len = table.getn(testmaparglist)
if len > 2 then
cmdline = "startwar3.bat"
if not grim.exists(cmdline) then
cmdline = "NewGen Warcraft.exe" -- NewGen version doesn't use batch files
end
for i = 2, len do
if (i < len) and (usetestmapconf) then
local arglen = string.len(testmaparglist[i+1])
if testmaparglist[i] == "-loadfile" and arglen > 3 then
local ext = string.lower(string.sub(testmaparglist[i+1],arglen-4+1))
if ext == ".w3m" or ext == ".w3x" then
local substitute = wehack.setupwgcfile(testmaparglist[i+1]);
if (substitute ~= testmaparglist[i+1]) then
testmaparglist[i+1] = "\"" .. substitute .. "\""
end
end
end
end
cmdline = cmdline .. " " .. testmaparglist[i]
end
end
end
end
wehack.execprocess(cmdline)
end
function compilemap_path(mappath)
if mappath == "" then
showfirstsavewarning()
return
end
map = wehack.openarchive(mappath,15)
wehack.extractfile("jasshelper\\common.j","scripts\\common.j")
wehack.extractfile("jasshelper\\blizzard.j","scripts\\Blizzard.j")
wehack.extractfile("war3map.j","war3map.j")
wehack.closearchive(map)
if cmdargs ~= "" then
local cmdtable = argsplit(cmdargs)
-- local len = table.getn(cmdtable)
-- for i = 1, len do
-- cmdtable[i] = removequotes(cmdtable[i])
-- end
-- wehack.rungrimextool(cmdtable)
grim.log("running tool on save: "..cmdargs)
wehack.runprocess(cmdargs)
cmdargs = ""
end
-- cJass#2
if have_ah and ah_enable.checked then
cmdline = "AdicHelper\\AdicHelper.exe"
if ah_version.active == 1 then
cmdline = cmdline .. " /v23"
else
cmdline = cmdline .. " /v24"
end
if jh_debug.checked then
cmdline = cmdline .. " /dbg"
end
cmdline = cmdline .. " /mappars=\"" .. mappath.."\""
adicresult = wehack.runprocess2(cmdline)
if adicresult == 1 then
mapvalid = false
return
end
end
-- /cJass#2
-- (vJass compiler) --
if havejh and jh_enable.checked then
cmdline = "jasshelper\\jasshelper.exe"
if jh_debug.checked then
cmdline = cmdline .. " --debug"
end
if jh_disable.checked then
cmdline = cmdline .. " --nopreprocessor"
end
if jh_disableopt.checked then
cmdline = cmdline .. " --nooptimize"
end
cmdline = cmdline .. " jasshelper\\common.j jasshelper\\blizzard.j \"" .. mappath .."\""
toolresult = 0
-- if jh_fast ~= nil and jh_fast.checked then
-- toolresult = wehack.runjasshelper(jh_debug.checked, jh_disable.checked, "jasshelper\\common.j", "jasshelper\\blizzard.j", mappath, "")
-- else
toolresult = wehack.runprocess2(cmdline)
-- end
if toolresult == 0 then
-- cJass#3
if have_ah and ah_enableopt.checked then
cmdline = "AdicHelper\\AdicHelper.exe"
if not ah_opt_remove.checked then
cmdline = cmdline .. " /nop"
end
cmdline = cmdline .. " /mapoptz=\"" .. mappath.."\""
wehack.runprocess2(cmdline)
end
-- /cJass#3
mapvalid = true
else
mapvalid = false
end
end
end
function compilemap()
mappath = wehack.findmappath()
compilemap_path(mappath)
end
if haveext then
localfiles = MenuEntry:New(utils,"Enable Local Files",togglelocalfiles)
shellext = MenuEntry:New(utils,"Register Shell Extensions",toggleshellext)
initlocalfiles()
initshellext()
wehack.addmenuseparator(utils)
end
if haveext and grim.exists("grimext\\tilesetter.exe") then
tilesetter = MenuEntry:New(utils,"Edit Tileset",runtilesetter)
end
if haveext and grim.exists("grimext\\fileexporter.exe") then
fileexporter = MenuEntry:New(utils,"Export Files",runfileexporter)
end
if haveext and grim.exists("grimext\\fileimporter.exe") then
fileimporterdir = MenuEntry:New(utils,"Import Directory",runfileimporterdir)
fileimporterfiles = MenuEntry:New(utils,"Import Files",runfileimporterfiles)
end
if haveext and grim.exists("grimext\\objectmerger.exe") then
objectmerger = MenuEntry:New(utils,"Merge Object Editor Data",function(self) runobjectmerger("m") end)
objectreplacer = MenuEntry:New(utils,"Replace Object Editor Data",function(self) runobjectmerger("r") end)
objectimporter = MenuEntry:New(utils,"Import Object Editor Data",function(self) runobjectmerger("i") end)
end
if haveext and grim.exists("grimext\\constantmerger.exe") then
constantmerger = MenuEntry:New(utils,"Merge Constants Data",runconstantmerger)
end
if haveext and grim.exists("grimext\\triggermerger.exe") then
triggermerger = MenuEntry:New(utils,"Merge Trigger Data",runtriggermerger)
end
function extabout()
grim.openlink("http://www.wc3campaigns.net")
end
if haveext then
wehack.addmenuseparator(utils)
aboutextensions = MenuEntry:New(utils,"About Grimex ...",extabout)
end
if haveumswe then
ums_cat = TogMenuEntry:New(ums,"Custom Editor Categories",nil,false)
ums_til = TogMenuEntry:New(ums,"Non Tileset Specific Objects",nil,false)
ums_pat = TogMenuEntry:New(ums,"Custom Tile Pathability",nil,false)
function umsactive()
if havespec then
if (spec_mod.active == 2) then
return true
else
return false
end
else
return ums_enabled.checked
end
end
function unloadumswe()
local umswehandle = wehack.getarchivehandle("umswe\\umswe.mpq")
if umswehandle ~= 0 then
wehack.closearchive(umswehandle)
wehack.setarchivehandle("umswe\\umswe.mpq", 0)
end
end
function getumsweargs()
local umsargs = "";
if umsactive() then
umsargs = umsargs .. " umscore=1"
else
umsargs = umsargs .. " umscore=0"
end
if (ums_cat.checked) then
umsargs = umsargs .. " umscategories=1"
else
umsargs = umsargs .. " umscategories=0"
end
if (ums_til.checked) then
umsargs = umsargs .. " umstiles=1"
else
umsargs = umsargs .. " umstiles=0"
end
if (ums_pat.checked) then
umsargs = umsargs .. " umspathing=1"
else
umsargs = umsargs .. " umspathing=0"
end
return umsargs
end
function toggleumswe()
if not isstartup then
unloadumswe()
wehack.setwaitcursor(true)
wehack.runprocess("grimext\\PatchGenerator.exe umswe\\umswecore.lua "..wehack.getlookupfolders().." umswe"..getumsweargs())
wehack.setwaitcursor(false)
end
end
function toggleumswecat()
if umsactive() and not isstartup then
unloadumswe()
wehack.setwaitcursor(true)
wehack.runprocess("grimext\\PatchGenerator.exe umswe\\umswecategories.lua "..wehack.getlookupfolders().." umswe"..getumsweargs())
wehack.setwaitcursor(false)
end
end
function toggleumswetil()
if umsactive() and not isstartup then
unloadumswe()
wehack.setwaitcursor(true)
wehack.runprocess("grimext\\PatchGenerator.exe umswe\\umswetilesets.lua "..wehack.getlookupfolders().." umswe"..getumsweargs())
wehack.setwaitcursor(false)
end
end
function toggleumswepat(newstate)
if umsactive() and not isstartup then
unloadumswe()
wehack.setwaitcursor(true)
wehack.runprocess("grimext\\PatchGenerator.exe umswe\\umswepathing.lua "..wehack.getlookupfolders().." umswe"..getumsweargs())
wehack.setwaitcursor(false)
end
end
function togglemods(self)
if (currentmod ~= self.index) then
if (self.index == 2) or (spec_mod.active == 2) then
toggleumswe()
end
wehack.messagebox("You need to restart World Editor now.","NewGen Special")
end
end
if havespec then
spec_mod.func = togglemods
else
ums_enabled.cb = toggleumswe
end
ums_cat.cb = toggleumswecat
ums_til.cb = toggleumswetil
ums_pat.cb = toggleumswepat
function categoryconfig()
if wehack.showcategorydialog("umswe\\umswecategories.conf.lua") and umsactive() then
if ums_cat.checked then
unloadumswe()
wehack.setwaitcursor(true)
wehack.runprocess("grimext\\PatchGenerator.exe umswe\\umswecategories.lua "..wehack.getlookupfolders().." umswe"..getumsweargs())
wehack.setwaitcursor(false)
end
end
end
function pathabilityconfig()
unloadumswe()
if wehack.showpathdialog("umswe\\umswepathing.conf.lua","umswe\\umswe.mpq") and umsactive() then
if ums_pat.checked then
wehack.setwaitcursor(true)
wehack.runprocess("grimext\\PatchGenerator.exe umswe\\umswepathing.lua "..wehack.getlookupfolders().." umswe"..getumsweargs())
wehack.setwaitcursor(false)
end
end
end
function umsweabout()
wehack.showumsweabout("UMSWE 5.0")
end
wehack.addmenuseparator(ums)
ums_catconf = MenuEntry:New(ums,"Customize Editor Categories",categoryconfig)
ums_pathconf = MenuEntry:New(ums,"Customize Tile Pathability",pathabilityconfig)
ums_about = MenuEntry:New(ums,"About UMSWE ...",umsweabout)
end
isstartup = false
I am having a Lua Error on 1.3
Please Help Me!
Its ok now... But When I try to Optimize it.... Using Vexorian's Map Optimizer 4.9.... Warcraft III Doesn't read my map.... it just shows a blank space with no player info or anything else... only the map preview and map name is shown.... then when I start the game... it just redirects to the game creation module....
Is there any error with my Code?
I just used widgetizer and it is working but with Optimzer it doesn't. I just use the custom trigger: Unit - Stun Unit.... I know that JNGPS has the Optimizer Feature but I need an optimzer that optimized and protects..... like vexorian's ... I use the common.j and blizzard.j for war3 1.24+.... still does not work... any help?
EDIT:
I have figured out which is the error on why Optimizer does make the map unreadable ... it is because of the DDUniversal Pack...... I need a Common.j and Blizzard.j That supports the DDUniversal pack in order to work? Where could i find one?
Again, not able to update to the latest JassHelper. Do I have to do anything else except overwriting all the old files in the JassHelper folder with the new ones?
I might've found the problem. When I extract the newest JassHelper, it doesn't even contain any JassHelper.exe. Only clijasshelper.exe and grimoirejasshelper.exe...
still the same problem occurs....
I cannot optimzed without war3patch.mpq
i really need the 2 scripts
could you extract it from war3patch? i try to extract it but unknown files go
thats well... the vexorian made different name yes... k now u will need to change the name of grimoirejasshelper.exe everytime or maybe should i make JNGPS work for both jasshelper.exe and grimoirejasshelper.exe? i can make that if u want.
If you could make it check to either work with one of those, that would be surprisingly amazing. But its totally up to you to do that.
Be sure that it also checks in JassHelper\executable folder. Some people might not know that they have to copy the files out of that folder directly into the JassHelper folder.
i really need help.......... The 2 scripts doesn't work.... Warcraft still doesn't ready my map! Is there anything that could optimize my map... It must be like vexorians optimizer.... But... If I remove the custom triggers (EGUI) my map is being read by the war3 engine..... But if Custom Script: Enable GUI is on.... war3 reads my map......
Please help... I really need it for my map!
Here's a screenshot
Hope it could helps...
really need my map to be optimzed and protected....
Uhm can't I use vJASS and cJASS in the same map? Because whenever I wanna save the cJASS compiler seems to got issues with textmacros.
Also the two example maps that can be included when installling cJASS neither compile in WE nor are they playable in Wc3.
function SpawnCreeps takes rect area,boolean attack, real attack_x, real attack_y, integer lvl1, integer lvl2, integer lvl3, integer lvl4, integer lvl5 returns nothing
local unit creep
//! textmacro SpawnCreeps takes LEVEL , TYPE
loop
exitwhen $LEVEL$ == 0
set creep = CreateUnit(MINIONS,LEVEL$TYPE$[GetRandomInt(0,LVL$TYPE$_COUNT)],GetRandomReal(GetRectMinX(area),GetRectMaxX(area)), GetRandomReal(GetRectMinY(area),GetRectMaxY(area)),GetRandomReal(0,360))
if attack then
call IssuePointOrder(creep,"attack",attack_x,attack_y)
endif
set $LEVEL$ = $LEVEL$ - 1
endloop
//! endtextmacro
//! runtextmacro SpawnCreeps("lvl1","1")
//! runtextmacro SpawnCreeps("lvl2","2")
//! runtextmacro SpawnCreeps("lvl3","3")
//! runtextmacro SpawnCreeps("lvl4","4")
//! runtextmacro SpawnCreeps("lvl5","5")
set creep = null
//! textmacro nothing
//! endtextmacro
//! runtextmacro nothing()
//! textmacro nothing takes nothing
//! endtextmacro
//! runtextmacro nothing("")
//! texmacro nothing
//! endtextmacro
//! runtextmacro nothing
@YourNameHere
if you want to use textmacros which don´t use any arguments then just leave out the 'takes'. I think this should work:JASS://! texmacro nothing //! endtextmacro //! runtextmacro nothing
Thanks. Will be fixed.e/btw another bug, if you have "Remove unused code" on, AdicHelper removes custom native declarations.