Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / Fpsc to Visual basic

Author
Message
outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 14th Mar 2009 23:30
so i made a visual basic program to launch a few multiplayer games i made. everything is done exept when i launch the game from the program it crashes. when i launch it from the .exe file its fine im soo lost.
heres the script

If RadioButton4.Checked = True Then
Shell("C:\Program Files\Black Matter\Brutality\Blockade\Blockade.exe")
End If

i have it so that when the radio button is checked and button1 is clicked the game will lauch. then it crashes

iv attached the pic of the main sreen

un-banned. ADD ME ON
XBOX LIVE!

Attachments

Login to view attachments
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 14th Mar 2009 23:47
Try making the shell have a variable here try this






Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 15th Mar 2009 06:06
I been working on a launch menu in Visual Basic with the same idea as outlaw241.

On the most part I got it to launch the game, but it brings up the error

Then crashes

I have searched and search and still searching. I have tried everything that I come across, but I am receiving the same error.

Wizzkid
AGK Tool Maker
18
Years of Service
User Offline
Joined: 14th Aug 2006
Location: Northern Ireland
Posted: 15th Mar 2009 12:48
I had this problem with a compression and exe packing tool I made in Autoit. Now I don't know how VB works as I don't use it, but I set the fpsc game.exe's working directory to the location of the game and it worked fine, so in autoit it looked like this (don't know whether this will help):

Run("c:\game\fpsc game.exe", "c:\game\")

Hope it helps


FireBASIC - The Heart of Great Programming - http://firebasic.ablazegaming.co.uk
Doomster
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Germany
Posted: 15th Mar 2009 13:22
You shouldn't launch the Game with the absolute path, you never know if anyone installs it to a different directory.

And like Wizzkid said, you must set an working Directory, otherwise the Game Executable can't find the Files.

samourai
16
Years of Service
User Offline
Joined: 11th Oct 2008
Location: Turn around...
Posted: 15th Mar 2009 13:36
hi,
i had help from the visual basic forums.
when you click launch it opens a text box with the file location so you can check to make sure the exe is in the right place then when you click launch it runs as admin.


http;//www.flamestarstudio.tk

Attachments

Login to view attachments
knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 15th Mar 2009 22:33 Edited at: 15th Mar 2009 22:34
This is what I use for FPSC IP:


knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 15th Mar 2009 22:34
Forgot this:

You can kill the process or wait for it to exit by using the following:


ninja9578
16
Years of Service
User Offline
Joined: 25th May 2008
Location:
Posted: 15th Mar 2009 23:29
Try using 'Exec' instead of Shell. I don't know much about VB, but in C++ isn't in the Windows API.

Nothing is impossible
knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 16th Mar 2009 00:13
Quote: "Try using 'Exec' instead of Shell. I don't know much about VB, but in C++ isn't in the Windows API."

I don't think 'Exec' is a command in VB as VB isn't as in-depth as C++.
'Process.Start()' is the VB way of starting, stopping & monitoring processes.

knxrb

DarkFact
18
Years of Service
User Offline
Joined: 18th Feb 2006
Location:
Posted: 18th Mar 2009 20:11 Edited at: 18th Mar 2009 20:14
In VB.NET, always start another program in VB with Process.Start() so you can control what the process (exe) is doing and for monitoring it. You know when it exits, when it throws an error and you can stop the process "legally".

For VB (legacy), shell usually works. Try to see if a variation of Process.Start() works though.

outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 22nd Mar 2009 00:35
well Process.Start() started the program but it stayed a black screen and i had to manually kill the program

un-banned. ADD ME ON
XBOX LIVE!
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 22nd Mar 2009 04:27
This could have to do with launching the program outside of the current directory. Either place your VB executable in the same directory as the game (current directory) or change the current directory before calling the FPSC program.

Best.

Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 22nd Mar 2009 06:14
Thank you xplosys, this solved my problem and hopefully it will solve outlaw's problem too if it is the same.

outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 24th Mar 2009 01:34
ok well thank you xplosys and every one else. i finally got it.
i put the .exe in the same directory as my game .exe.

un-banned. ADD ME ON
XBOX LIVE!
knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 24th Mar 2009 12:24 Edited at: 24th Mar 2009 12:24
If you don't want it in the same directory then you can add in the extra folder names like this:

Just replace 'data' with the name of the folder.

knxrb

outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 26th Mar 2009 04:07 Edited at: 26th Mar 2009 04:10
Quote: "If you don't want it in the same directory then you can add in a folder."

no i cant have it in the same folder because my setup.ini is different for each game.


if i ever figure this out i am soooo making a tutorial...

un-banned. ADD ME ON
XBOX LIVE!
outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 26th Mar 2009 04:15 Edited at: 26th Mar 2009 05:29
well

gameProc = Process.Start(Application.StartupPath & "Blockadeblockade.exe") doesnt work


location of game C:UsersHomeDesktopBrutalityBlockade
location of laucher.exe C:UsersHomeDesktopBrutality

did not work. it found the game but it just showed black screen... back to square 1



here is the entire script im using for it


un-banned. ADD ME ON
XBOX LIVE!
knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 26th Mar 2009 10:42
Have you copied just the exe to the folder or all the neccessary game files as well because just copying the exe will cause the black screen.

knxrb

outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 27th Mar 2009 06:21
yep. all the game files are there...
at this point i dont know what to do

un-banned. ADD ME ON
XBOX LIVE!
knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 27th Mar 2009 12:15 Edited at: 27th Mar 2009 12:47
I've just tried replicating what you are trying to do and I get a black screen as well.
It seems to be when I call the game process using 'Process.Start()'
Does it run okay when you double-click the exe and run it normally.

[Edit] I've just found the solution to the black screen problem

[Edit Again] Here's how you fix it:

Method 1:
Move the game files & exes into the application directory and call it using 'Process.Start(Application.StartupPath & "gamename.exe")'.
Method 2:
Make a shortcut link to your game in the application directory and call it using 'Process.Start(Application.StartupPath & "gamename.lnk")'

knxrb

DarkFact
18
Years of Service
User Offline
Joined: 18th Feb 2006
Location:
Posted: 27th Mar 2009 18:51
You don't have to do all of that. Just change the current directory to the game directory and call the process to start. You can immediately change back to the main directory at this point or leave it alone.

Pseudo code:

If currentdirectory != exe_directory then
changedirectory(exe_directory)

Process.Start(game)

If currentdirectory != main_directory then
changedirectory(main_directory)

This method works for both shell and process versions for VB6 and .NET

outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 28th Mar 2009 05:42 Edited at: 28th Mar 2009 05:46
Quote: "Move the game files & exes into the application directory and call it using 'Process.Start(Application.StartupPath & "gamename.exe")'."


yes that does work but the problem is that my files are in different folders and if you create shortcuts to each folder it gives error

EDIT
gameProc = Process.Start("MYGAME.exe")
works but, the launcher.exe has to be in the same folder as the game.exe

un-banned. ADD ME ON
XBOX LIVE!

Attachments

Login to view attachments
outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 28th Mar 2009 06:02
how it has to be

un-banned. ADD ME ON
XBOX LIVE!

Attachments

Login to view attachments
JRH
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Stirling, UK
Posted: 28th Mar 2009 12:20
Ok, this is how I would do it:


I always use an exception,

JRH

knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 28th Mar 2009 15:45
You shouldn't use a 'MsgBox(ex.ToString)' as that is an old statement from Visual Basic 6.
You should use this instead:
'MessageBox.Show(ex.ToString)'

knxrb

outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 29th Mar 2009 00:36 Edited at: 29th Mar 2009 00:37
nope

Try
Process.Start(~your games executable file~)
Catch ex as Exception
MsgBox(ex.message)
End Try



What mine looked like:

If RadioButton4.Checked = True Then
Try
Process.Start("C:\Users\Home\Desktop\Brutality\Blockade\blockade.exe")
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End If

gives black screen

un-banned. ADD ME ON
XBOX LIVE!
knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 29th Mar 2009 00:39
Try my solution and see if that works

knxrb

outlaw241
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location: Ontario Caliiiiii US of A
Posted: 29th Mar 2009 00:42
i did... i didn't use "MessageBox.Show(ex.ToString)"

i used yours

un-banned. ADD ME ON
XBOX LIVE!
knxrb
FPSC Tool Maker
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 29th Mar 2009 12:46
I don't mean the 'MessageBox.Show()', I mean using my solution from earlier in the thread.

knxrb

Login to post a reply

Server time is: 2024-10-12 05:31:27
Your offset time is: 2024-10-12 05:31:27