| 10-30-2007, 04:09 AM | #1 |
*Soon* there will be native jasshelper executable for Mac, but in the meantime, provided you have a virtual machine it is possible to run at least jasshelper if not newgen on your computer. Intro Last two months I worked in making jasshelper very standalone the reason is that I moved to Linux and then I cannot run world editor anymore, so I use WINE to run jasshelper (just jasshelper) without newgen pack or any other editor, i added certain options to make it survive alone. Since I don't own a mac this is mostly speculation, and reality may be different, this is just so someone could try to make it work. Before trying this Is it a dual core apple machine? then you should try a virtual machine like vmware or dual booting. Try this tutorial to run newgen world editor : http://www.wc3campaigns.net/showthread.php?t=96126 Really Since you probably skipped the last paragraph, let me repeat it, if your Mac is an intel based one, dual booting or vmware fusion so you can run newgen pack are gonna be a total improvement over the method I am gonna describe. It is hard to use jasshelper like this, I want to save it in the editor and then it compiles! Not the (incoming overcomplicated) method you are describing! The thing is that reverse engineering world editor is ... hard, and it is much harder if not impossible in the macintosh native world editor since we really have no idea how to do that kind of stuff on mac executables. So, even if we used an ultra portable language for the development of jasshelper you would have to deal with indirect saving to take advantage of it (and this is true for every kind of preprocessor) So what is it? This method is going to change your development ways a lot, you will have to get used not to use world editor in the 'standard' way, it is not easy to get used to it, but once you do it there is a potential for saving time , in short, you'll be able to do scripting without having to open heavy world editor all the time... Step one, get to run jasshelper This is hard right now, but may get easier later if we get a Mac executable of jasshelper... You probably need a virtual machine and a windows license to run on it. If not, darwine would work, but it wasn't updated in ages, so I'd say virtual machine is the way to go. It looks like you'll need Microsoft's virtual machine software, although vmware may have a powerpc version, I have not done any research about it Learn how to run programs in your virtual machine, most importantly, learn how to share files between your own computer and the virtual computer. Once you have some sort of shared folder, you'll be able to do more things. jasshelper.exe Get the jasshelper.exe executable: http://www.wc3campaigns.net/showthread.php?t=88142 That jasshelper distribution package often has a folder called grimoire\ the jasshelper executable should be there. PJass.exe Grab Pjass.exe from pjass' thread: http://www.wc3campaigns.net/showthread.php?t=75239 common.j and blizzard.j These two files are in war3patch.mpq in a folder called scripts, I don't really want to explain such thing like "extracting files from the mpq" I recon there are mpq tools for the Mac, so this should be easy. If not, request those files, someone could post them. Copying So, let's say you got a shared folder your guest windows XP can use, copy jasshelper.exe and pjass.exe to that folder. Also copy common.j and blizzard.j to that same folder. Test Head to the virtual machine and go to the shared folder, double click jasshelper.exe. A window should appear, the window reads "missing arguments: <common.j> <blizzard.j> <mappath>" If an access violation appears instead then for some reason jasshelper won't run on the virtual machine and we are screwed. Getting a map This is the part that is gonna dissapoint you (or not?) all your vJass code you are gonna have to do in an outside .j file, just so you can save your map in your world editor without it crashing. Notice that if you have to use a library you will have to paste the library on your .j file instead of copying the library to your map like what would happen on PC computers. Grab a map and create a new empty 'trigger' convert it to custom text, to that trigger add this line: JASS:
//! import "myscript.j"
You should thank Karukef for pushing the //! syntax for preprocessor commands since this means you can save this line in your map from unhacked WE without crashing it... Save the map and copy it to the shared folder. myscript.j Now you need to actually write myscript.j for your test I suggest this JASS:library myTest initializer init private function ex takes nothing returns nothing call BJDebugMsg("Hello World! ") endfunction private function init takes nothing returns nothing call TimerStart(CreateTimer(),0.5, true, function ex) endfunction endlibrary Save myscript.j on the shared folder. running jasshelper, processing the map I forgot to say, it is convenient your input map is always the same name, although later with some windows command line and .bat files knowledge you may make something much better, or someone could make a program to assist in this process. Let's say your map is called "map.w3x" we can now do this command (making sure the shared folder is the work folder): jasshelper.exe common.j blizzard.j map.w3x How do we actually do this? I suggest a batch file: run.bat:
@echo off cd "U:\Path\To\Shared\Folder\" start jasshelper.exe common.j blizzard.j map.w3x Save it as run.bat in your shared folder (if you wrote the batch file from windows, you must make sure the extension is .bat, windows is very restrictive (And annoying) with extensions and will force a .txt on it if you use notepad and you don't disable extension hiding... If you make the batch file from Mac OS/X make sure to save it in DOS/Windows format (line breaks) If all is done correctly double clicking run.bat from the virtual machine should pop up a dos window for a second and then you'll get to see jasshelper's progress bar and (hopefully) it saves correctly. I think, the catch could be that since it is a virtual machine things are far slower than they should be and this might be an issue for you if your computer is not a recent model. Test the map If jasshelper didn't complaint or popup errors (and it shouldn't in the case of this test version myscript.j then map.w3x should contain a jasshelper- processed map. Copy it out side the shared folder yo your warcraft III's maps folder so you can test it. During the test you should see your old map but now it is full of annoying hello world messages, vJASS in action! how exciting... So... If it worked so far then you know what to do, whenever you update something on your map and want to test the changes, save it and copy it to this shared folder, enter to the virtual machine and use run.bat to compile it. Then move it to war3's folder and test. If you want to code in vJASS then you should edit this myscript.j file and use vJASS there, note that anything using functions that use vJASS should be in this file else your world editor will show syntax errors whenever you save. This is annoying IF you asked me, this current method is easy, ensures that you don't touch vJASS a lot and is simple but it is heck impractical and annoying. There's something better to do. So the idea is this we have the //! import "myscript.j" line but this time we do something more: after saving the map, extract war3map.j from the map (using some mpq editor) and save this war3map.j as "source.j" in the shared folder. Change run.bat to this: run.bat:
@echo off cd "U:\Path\To\Shared\Folder\" start jasshelper.exe common.j blizzard.j source.j map.w3x This will allow you to keep editing myscript.j and then just use run.bat to compile it. No need for world editor save and constantly copying files. Take it an step further, once you have finished working on the script you may like to work on other things, like unit editor and other things (notice many editor features use the script) It would be nice to freely edit those things without having to do our little virtual machine ritual everytime, so once script work is done, you can take the processed map.w3x and extract war3map.j from it, and IMPORT it as war3map.j in your original map. This allows you to save from world editor without doing changes to the map script. Whenever you want to update GUI triggers, preplaced unit, destructables, cameras, rects, etc. You need to update source.j and recompile: to do it, first REMOVE imported war3map.j and save the map. Then extract the new war3map.j from the map and replace source.j . --- Hope it actually works... Notice how a native mac executable would not make things much easier, since the complications are more about dealing with updating and testing the script. This makes me mad If this pisses you off, request blizzard to add an scriptable plugin interface to the "starcraft II editor", this will ensure that we do not need to hack the windows version to add nice features like newgen so we will be able to have more portable world editor additions, (And yes, we will need third party features, the sc2 editor is not going to be perfect) If this looks like hard, imagine having to do it WITHOUT the world editor, that's where I am into right now... |
| 10-30-2007, 08:19 AM | #2 |
God fucking damnit. I can get JASSHelper to almost compile from the command-line. I am forced to use the //! importa thingey because I can't save the map with the code in it. The only problem is I get weird ghost errors that keep it from finishing. It gave me an error on the highlighted line: JASS:globals // Generated trigger gg_trg_Globals_Test = null string TestString = "Woah! I made a freeform globals block!" endglobals //=========================================================================== // // Just another Warcraft III map // // Warcraft III map script // Generated by the Warcraft III World Editor // Date: Mon Oct 29 22:06:16 2007 // Map Author: Unknown // //=========================================================================== //*************************************************************************** //* //* Global Variables //* //*************************************************************************** function InitGlobals takes nothing returns nothing endfunction //*************************************************************************** //* //* Triggers //* //*************************************************************************** //=========================================================================== // Trigger: Globals Test //=========================================================================== // begin import from X:\Globals Test.txt // scope GlobalsTestScope begins function TestString takes nothing returns nothing call BJDebugMsg(TestString) endfunction // scope GlobalsTestScope ends // end import from X:\Globals Test.txt function Trig_Globals_Test_Actions takes nothing returns nothing endfunction //=========================================================================== function InitTrig_Globals_Test takes nothing returns nothing set gg_trg_Globals_Test = CreateTrigger( ) call TriggerAddAction( gg_trg_Globals_Test, function Trig_Globals_Test_Actions ) endfunction //=========================================================================== function InitCustomTriggers takes nothing returns nothing call InitTrig_Globals_Test( ) endfunction //*************************************************************************** //* //* Players //* //*************************************************************************** function InitCustomPlayerSlots takes nothing returns nothing // Player 0 call SetPlayerStartLocation( Player(0), 0 ) call SetPlayerColor( Player(0), ConvertPlayerColor(0) ) call SetPlayerRacePreference( Player(0), RACE_PREF_HUMAN ) call SetPlayerRaceSelectable( Player(0), true ) call SetPlayerController( Player(0), MAP_CONTROL_USER ) endfunction function InitCustomTeams takes nothing returns nothing // Force: TRIGSTR_002 call SetPlayerTeam( Player(0), 0 ) endfunction //*************************************************************************** //* //* Main Initialization //* //*************************************************************************** //=========================================================================== function main takes nothing returns nothing call SetCameraBounds( -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) ) call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" ) call NewSoundEnvironment( "Default" ) call SetAmbientDaySound( "LordaeronSummerDay" ) call SetAmbientNightSound( "LordaeronSummerNight" ) call SetMapMusic( "Music", true, 0 ) call InitBlizzard( ) //! initstructs //! initdatastructs call InitGlobals( ) call InitCustomTriggers( ) endfunction //*************************************************************************** //* //* Map Configuration //* //*************************************************************************** function config takes nothing returns nothing call SetMapName( "Just another Warcraft III map" ) call SetMapDescription( "Nondescript" ) call SetPlayers( 1 ) call SetTeams( 1 ) call SetGamePlacement( MAP_PLACEMENT_USE_MAP_SETTINGS ) call DefineStartLocation( 0, 2752.0, 448.0 ) // Player setup call InitCustomPlayerSlots( ) call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER ) call InitGenericPlayerSlots( ) endfunction JASS:scope GlobalsTestScope globals string TestString = "Woah! I made a freeform globals block!" endglobals function TestString takes nothing returns nothing call BJDebugMsg(TestString) endfunction endscope JASS://! import X:\Globals Test.txt function Trig_Globals_Test_Actions takes nothing returns ntohing endfunction //=========================================================================== function InitTrig_Globals_Test takes nothing returns nothing set gg_trg_Globals_Test = CreateTrigger( ) call TriggerAddAction( gg_trg_Globals_Test, function Trig_Globals_Test_Actions ) endfunction Code:
C:\Documents and Settings\Administrator\Desktop\jassnewgenpack3g\jasshelper>jasshelper.exe common.j blizzard.j Y:\Test\GlobalsTest.w3m If I ever get this working I'm writing a fucking tutorial for it. Edit: Sorry about jacking your thread Cohadar. :P |
| 10-30-2007, 04:53 PM | #3 |
Go Pyro Go. |
| 10-31-2007, 02:48 AM | #4 |
Didn't even see this thread when I posted that. Let's see what happens with this. Edit: You forgot to mention the part about creating a folder called "bin" and then putting SFmpq.dll into it. Edit Again: GODDAMN! I did everything right, used the exact same code you did and I still got the error "Unexpected : B" on the line call BJDebugMsg("Hello World! "). Any ideas? |
| 10-31-2007, 04:36 AM | #5 |
A logs folder is supposedly created, zip all its contents and attach it. |
| 10-31-2007, 05:03 AM | #6 |
Here you go. |
| 10-31-2007, 05:08 AM | #7 |
Try to save any 'normal' map and compile it with jasshelper (without adding any //! import line) |
| 10-31-2007, 05:16 AM | #8 |
Not good... it errors on the second line of the "InitGlobals" function. |
| 10-31-2007, 10:27 AM | #9 | |
Quote:
There could be 2 things here: BJDebugMsg is not a native as I know? Try using call DisplayTextToPlayer(GetLocalPlayer(),0,0,"text") That unexpected B is somewhere before that line of code. EDIT: I will install linux as second OS tomorrow, so I will join this discussion in a more direct way. |
| 10-31-2007, 01:32 PM | #10 | |
Quote:
At the moment the structs phase begins there are errors, for some reason it appears there are problems with the parser, these are bad news since could mean that the virtual machine got bugs that directly affect jasshelper. In windows guest - Linux host I noticed the shared folder behaves strangely to windows this is because it is a folder from the unix like file system. It could be this is affecting something, so try copying all the contents from the shared folder to a normal folder in the virtual machine and try again. -- What virtual machine are you using? |
| 10-31-2007, 07:29 PM | #11 |
VirtualPC 7. And yes, Cohadar, that is a native. If you looked at the post previous to yours you would notice that it is erroring on maps without compile errors too. |
| 10-31-2007, 11:15 PM | #12 |
The only logical explanation would be a bug with the virtual machine, but that would be way too much bad luck. Tried running from a non-shared folder? Are you using the sfmpq.dll provided with newgen pack or latest grimoire? I heard there are issues when using the one in grimoire with jasshelper. |
| 11-01-2007, 05:43 AM | #13 |
I've tried it using both SFmpq.dlls. And I'm testing the non-shared folder right now. |
| 11-02-2007, 02:39 PM | #14 |
Grrrr. After installing Ubuntu I discovered that it does not have a driver for my ATI graphic card, and then I found out those idiots at ATI declared they will not support linux drivers any more. It is a last time I ever got anything from ATI. |
| 11-03-2007, 06:09 AM | #15 |
That's how I felt, cohadar. Oh, and running it in a separate folder does not fix the error, Vexorian. |
