|
|
#1 |
|
User
Join Date: Aug 2003
Posts: 71
|
To whomever is able to help, I'll gladly +rep if the forum allows.
I'm trying to create a dialog box that pops up immediately after the map loads, I originally created the file as a trigger, and modified it to JASS. The Jass version wont load.. It just takes me to a black screen when i try launch my campaign. Any ideas anyone? Any advice will be greatly appreciated. Thanks in advance. PS: I've attached the campaign file it might help troubleshoot the error. I'm using NewGen WE pack 5d. Jass Code: 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 TriggerSleepAction( 0.50 ) 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 local trigger MenuTrg = CreateTrigger( ) call TriggerAddAction( MenuTrg, function Actions ) endfunction endscope Original Working Trigger: Trigger: Main Menu BAK
![]() Conditions
![]() Actions
![]() ![]() Wait 0.50 seconds
![]() ![]() Game - Display to (All players) the text: Main
![]() ![]() Dialog - Change the title of Dialog to Main Menu
![]() ![]() Dialog - Create a dialog button for Dialog labelled New Game
![]() ![]() Set DialogButton[0] = (Last created dialog Button)
![]() ![]() -------- ---------------------------------------------------------- --------
![]() ![]() Game Cache - Create a game cache from roti00.w3v
![]() ![]() Game Cache - Restore Kael of Heroes from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
![]() ![]() Set Hero = (Last restored unit)
![]() ![]() -------- ---------------------------------------------------------- --------
![]() ![]() Game Cache - Create a game cache from roti01.w3v
![]() ![]() Game Cache - Restore Kael of Heroes from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
![]() ![]() Set Hero = (Last restored unit)
![]() ![]() -------- ---------------------------------------------------------- --------
![]() ![]() Game Cache - Create a game cache from roti02.w3v
![]() ![]() Game Cache - Restore Kael of Heroes from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
![]() ![]() Set Hero = (Last restored unit)
![]() ![]() -------- ---------------------------------------------------------- --------
![]() ![]() Game Cache - Create a game cache from roti03.w3v
![]() ![]() Game Cache - Restore Kael of Heroes from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
![]() ![]() Set Hero = (Last restored unit)
![]() ![]() -------- ---------------------------------------------------------- --------
![]() ![]() Dialog - Show Dialog for Player 1 (Red)Last edited by sPyRaLz : 07-13-2010 at 04:37 PM. Reason: Added Attachment |
|
|
|
| Sponsored Links - Login to hide this ad! |
|
|
|
|
#2 |
|
†6†
Join Date: Oct 2008
Posts: 841
![]()
|
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. |
|
|
|
|
|
#3 |
|
User
Join Date: Aug 2003
Posts: 71
|
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. Last edited by sPyRaLz : 07-14-2010 at 02:27 PM. |
|
|
|
|
|
#4 |
|
default string
|
Try change the initializer to Actions
|
|
|
|
|
|
#5 |
|
User
Join Date: Aug 2003
Posts: 71
|
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!
|
|
|
|
|
|
#6 |
|
default string
|
Oh yeah, there's something about JNGP not working well with Campaigns I think.
|
|
|
|
|
|
#7 |
|
User
|
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.
Last edited by Bribe : 07-15-2010 at 08:26 PM. |
|
|
|
|
|
#8 | |
|
User
Join Date: Aug 2003
Posts: 71
|
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. |
|
|
|
|
|
|
#9 |
|
User
|
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. |
|
|
|
|
|
#10 | |
|
User
Join Date: Jan 2007
Posts: 101
|
Quote:
|
|
|
|
|
|
|
#11 |
|
User
|
I average about 1 syntax error for every 150 lines, not worried about that.
|
|
|
|
|
|
#12 | |
|
User
Join Date: Aug 2003
Posts: 71
|
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. |
|
|
|
|
|
|
#13 |
|
User
|
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. |
|
|
|
|
|
#14 |
|
User
Join Date: Jan 2007
Posts: 101
|
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.
__________________ |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
|
Donate |