| 07-13-2010, 05:40 PM | #2 |
try JASS:scope Menu initializer Init globals public button array ba[5] endglobals private function Actions takes nothing returns nothing local unit h = null local dialog d local gamecache gc = null local location l = GetRectCenter(GetPlayableMapRect()) call DestroyTimer(GetExpiredTimer()) call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Main") call DialogSetMessage(d, "Main Menu") set ba[0] = DialogAddButton(d, "New Game",0) // ---------------------------------------------------------- set gc = InitGameCache("roti00.w3v") set h = RestoreUnit(gc, "Heroes", "Kael", Player(0), GetLocationX(l), GetLocationY(l), 0) if ( h != null ) then call RemoveUnit( h ) set ba[1] = DialogAddButton(d, "Autosave: " + "Location" + " - " + "Time",0) endif // ---------------------------------------------------------- set gc = InitGameCache("roti01.w3v") set h = RestoreUnit(gc, "Heroes", "Kael", Player(0), GetLocationX(l), GetLocationY(l), 0) if ( h != null ) then call RemoveUnit( h ) set ba[2] = DialogAddButton(d, "Save 01: " + "Location" + " - " + "Time",0) endif // ---------------------------------------------------------- set gc = InitGameCache("roti02.w3v") set h = RestoreUnit(gc, "Heroes", "Kael", Player(0), GetLocationX(l), GetLocationY(l), 0) if ( h != null ) then call RemoveUnit( h ) set ba[3] = DialogAddButton(d, "Save 02: " + "Location" + " - " + "Time",0) endif // ---------------------------------------------------------- set gc = InitGameCache("roti03.w3v") set h = RestoreUnit(gc, "Heroes", "Kael", Player(0), GetLocationX(l), GetLocationY(l), 0) if ( h != null ) then call RemoveUnit( h ) set ba[4] = DialogAddButton(d, "Save 03: " + "Location" + " - " + "Time",0) endif // ---------------------------------------------------------- call DialogDisplay(Player(0), d, true) endfunction //=========================================================================== private function Init takes nothing returns nothing call TimerStart(CreateTimer(),0.01,fale,function Actions) endfunction endscope the timer waits 'till the game actually starts...maybe this fixes your problem, cause dialogs can't be displayed on init and the scope's init-func is run during init. |
| 07-14-2010, 02:00 PM | #3 |
I just gave it a try, still the same bug. Game displays a blacks screen when i try to load the first map of the campaign. : ( I suspect its a problem with the campaign editor failing to compile the map.. When i compiled the map as a standalone, it worked. I reimported the standalone, and it also worked. |
| 07-14-2010, 02:15 PM | #4 |
Try change the initializer to Actions |
| 07-14-2010, 06:53 PM | #5 |
Hm.. I'm pretty convinced that its an issue with the campaign editor, When i save my maps while they are opened via campaign editor, The compile time seems a little shorter. Scopes don't seem to be recognized. I have to compile separately then load the map to the campaign to get things working. Either ways, its lookin good. Thanks for the feedback! |
| 07-15-2010, 12:15 AM | #6 |
Oh yeah, there's something about JNGP not working well with Campaigns I think. |
| 07-15-2010, 08:26 PM | #7 |
You have to save the map outside of the campaign in JNGP, then re-import the map back into the campaign. The use of 3rd party programs like JEdit or NotePad++ helps a lot in situations like this. |
| 07-16-2010, 04:04 AM | #8 | |
Quote:
Thanks for verifying that. I've never used those before. Are they able to compile? Or do they just help you check your syntax errors and stuff? If they can't compile I don't see how it makes any difference as I still have to port the map into the campaign 1 way or another. |
| 07-16-2010, 04:53 AM | #9 |
They provide syntax highlighting. To be perfectly honest, I do about 0.001% of my work in the actual editor (pretty much for debugging or choosing special effects) and the rest I do in JEdit. |
| 07-16-2010, 01:16 PM | #10 | |
Quote:
|
| 07-16-2010, 04:31 PM | #11 |
I average about 1 syntax error for every 150 lines, not worried about that. |
| 07-16-2010, 05:42 PM | #12 | |
Quote:
Ditto to that. Programming huge text of code without regular testing intervals messes me up real bad. I find its much harder to track down bugs that don't spit out any error messages. |
| 07-16-2010, 05:55 PM | #13 |
Open/Save/Close time in sessions is sped up an average of 58,000 % When you're coding large amounts of script in order to implement features and framework, there's nothing you need more than fast coding. JEdit line-splitting, rectangular selection, syntax highlighting, find & replace blows NewGen out off the face of the earth. Notepad ++ smart highlighting is amazing. |
| 07-16-2010, 06:22 PM | #14 |
It's about testing your stuff ingame regularly, not writing 1000 lines of code outside of the game and afterwards track down each bug you might find. |
| 07-16-2010, 07:21 PM | #15 |
I'll concede everyone codes differently. This is an example of a system where 99.99% of the work was done in Notepad++ and JEdit. The slow speed and lack of features in NewGen aggrivates me, so I prefer to do it this way. |
