MEL system() difficulties..

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2012   #1
MEL system() difficulties..

So here's the deal, I can't launch our game using system() in mel. I'm working on a level exporter, and it would be handy to launch the game directly from the Maya GUI, but it always crashes. And yes, it works perfectly fine when you open the game in windows normally.

I get a Game.exe has stopped working ... APPCRASH type error.

I've tried all kinds of different string formatting, used start, load, shell, all to no avail. The error window displays the game's icon, so I assume the directory string is correct.

I can get system() to load all kinds of other things, such as Minecraft, notepad, Dragon Age 2, etc, but not OUR game!

I'm really at a loss here, shouldn't system() be the same as if I opened the file normally in windows?

The game is running on Ogre3d, and I'm using Maya 2012 x86, Windows 7 x64.

Any ideas / leads would be appreciated!
-John L.
 
Old 10 October 2012   #2
Have you tried this on different versions of Maya?
__________________
Nightshade UV Editor (script for Maya) - Extends Maya's default UV Texture Editor with additional tools.
 
Old 10 October 2012   #3
I would consider doing it with a few lines of python. Here's and example launching rv

from PyQt4 import QtCore
cmd = '"D:/Program Files/Tweak/rv-current-version/bin/rv.exe"'
pro = QtCore.QProcess()
pro.startDetached(cmd)


David
__________________
http://www.djx.com.au
 
Old 10 October 2012   #4
Have you tried wrapping it with batch ?

/risto
__________________
- Oh no, it's me -
 
Old 10 October 2012   #5
Thanks guys! Going through all your suggestions helped us narrow down the problem. It turns out the game had to be launched from a specific location, and somehow running it via MEL, python, or a batch file made it think it was in the wrong directory.
 
Old 10 October 2012   #6
In case anyone wants to see the actual fix, here's what I did:

First you have to change the working directory. Use the chdir mel command.
< chdir $directory; >
Then, you can run the program without any problems.
< system("shell " + $directory + $gameExe); >
 
Old 10 October 2012   #7
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:13 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.