Jump to content

Fix: Game not starting using pre alpha 2 on Ubuntu 10.04


Snap
 Share

Recommended Posts

Hello,

I wanted to test the game so I grabed it from playdeb.net. I can run the game, choose "Single player" and click on "Start the game" but the screen is blocked when the progress bar is full.

I started the game from a terminal and I got this:

gui/loading/loading.js(38): ReferenceError: curr_music is not defined

ERROR: JavaScript Error (gui/loading/loading.js, line 38): ReferenceError: curr_music is not defined

GAME STARTED, ALL INIT COMPLETE

To fix it, edit as root the file /usr/lib/games/0ad/data/mods/public/gui/loading/loading.js

sudo gedit /usr/lib/games/0ad/data/mods/public/gui/loading/loading.js

And replace at line 38

if (curr_music)

with

if (typeof(curr_music) != "undefined")
.

And then it works !

Hope this helps ;)

Link to comment
Share on other sites

Is this the 0.0.0+r07539~pre-alpha-1~getdeb1 package from PlayDeb? I don't understand why you get this problem when it appears to work fine for me and (as far as I'm aware) for most other people ;). Implicit global variables are yucky but it shouldn't fail randomly - functions_page_pregame.js sets curr_music which I think should make it available to other GUI scripts. Do you have other problems with music/sounds not playing, which might make this work differently? (I could apply this fix to the code in SVN but I'd prefer to understand the problem first.)

Link to comment
Share on other sites

Yes, this is exactly this package. I don't understand. I have no sound until game is started.

Here is the complete log taken from terminal:

TIMER| InitVfs: 138.402 ms

TIMER| InitScripting: 1.62933 ms

WARNING: Cannot find config file "config/local.cfg" - ignoring

WARNING: Cannot find config file "config/profiles/default/settings/user.cfg" - ignoring

TIMER| CONFIG_Init: 3.30224 ms

TIMER| write_sys_info: 10.7451 ms

Performance warning: your graphics card does not support compressed textures. The game will try to continue anyway, but may be slower than expected. Please try updating your graphics drivers; if that doesn't help, please try upgrading your hardware.

TIMER| ps_console: 57.6031 ms

TIMER| ps_lang_hotkeys: 12.757 ms

TIMER| common/setup.xml: 30.3514 ms

TIMER| common/styles.xml: 11.1856 ms

TIMER| common/sprite1.xml: 12.2127 ms

TIMER| common/init.xml: 27.0557 ms

TIMER| pregame/sprites.xml: 9.59941 ms

TIMER| pregame/styles.xml: 535.823 us

TIMER| pregame/mainmenu.xml: 96.1979 ms

TIMER| common/global.xml: 1.31029 ms

TIMER| common/setup.xml: 734.939 us

TIMER| common/styles.xml: 377.422 us

TIMER| common/sprite1.xml: 3.82332 ms

TIMER| msgbox/msgbox.xml: 35.4165 ms

TIMER| InitRenderer: 61.1974 ms

TIMER| common/setup.xml: 1.24457 ms

TIMER| common/styles.xml: 651.13 us

TIMER| common/sprite1.xml: 4.62999 ms

TIMER| common/init.xml: 15.5602 ms

TIMER| loading/loading.xml: 13.9002 ms

TIMER| common/global.xml: 684.025 us

gui/loading/loading.js(38): ReferenceError: curr_music is not defined

ERROR: JavaScript Error (gui/loading/loading.js, line 38): ReferenceError: curr_music is not defined

GAME STARTED, ALL INIT COMPLETE

I'm not a JavaScript expert, but you seem to be right. As long as you do not write "var" before curr_music, it is global and should be accessible from everywhere. Could it be possible for the file functions_page_pregame.js to be loaded/parsed *after* loading.js ? What JavaScript engine do you use ?

Good luck, if you find the solution I'm curious to know it !

Link to comment
Share on other sites

  • 2 weeks later...
What JavaScript engine do you use ?
SpiderMonkey (as used in Firefox etc). I committed a fix in r7550 a while ago since I encountered a similar problem when making the game launch directly into the loading screen skipping the menu - I don't think that's the same problem (so I don't know what the original problem was) but it's the same solution so hopefully it'll work okay.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...