Author Topic: Code::blocks Question  (Read 1144 times)

Offline Psudomorph

  • Jr. Member
  • **
  • Posts: 91
Code::blocks Question
« on: August 13, 2007, 09:37:25 AM »
A quick question that hopefully won't prove too obvious:

I've been playing around with basic programming of OP2 missions, but it is starting to bother me that I have to manually transfer the resulting DLL from it's codeblocks folder to the OP2 folder.

Are there any fancy tricks by which I can instruct codeblocks to output a DLL to a specific folder on the hard drive during the Building process?

(Now that I think about it, could it be possible to launch a level without going through the OP2 opening menu at all? Some way to pass a "run this DLL" command to OP2 as it starts up?)

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3101
Code::blocks Question
« Reply #1 on: August 13, 2007, 11:16:36 AM »
As far as telling CodeBlocks to output to a different folder, this is easy. In the workspace browser on the left (the pane with the list of files), and find the icon for the project (it's the one that's bolded, usually, and has the icon that looks like the CodeBlocks logo).

Right click this icon and go to Properties. Click on the Build targets tab in the window that appears. On the right, under Output filename, you may set the filename and path where the final DLL file is written.

As far as launching a DLL automatically, there isn't any way to specify it on the command line if that's what you mean. What you can do is, press the D key at the main menu. The debugging menu will appear. Click Run Script, and then select the DLL file to run.
This has a few problems however (namely, in multiplayer missions, if there are Last One Standing triggers, the game will stop immediately. You either have to comment out the trigger creation code temporarily, or just launch the DLL from the multiplayer menu manually).

For single player missions, there shouldn't be any problems testing them through this method.

If you're testing multiplayer missions and need to test them the usual method (by creating a TCP/IP game with one copy of the game, and joining with another), you can save a few keystrokes if you run the game with the following command line option:

/net:winsock

This will bring the game directly to the TCP/IP host/join selection dialog, which saves a couple of mouse clicks from when the game starts. Unfortunately, there isn't any way to automate it further (with more command line options, for example). (It is possible to load other network providers directly in this manner, by changing the part after the colon. For example, /net:sigs would attempt to load the sigs provider immediately. There are other provider names for Modem, IPX, and Serial but they escape my memory at the moment (dplay_ipx might be the IPX one but I doubt it). If you leave out the part after the colon, it will open directly to the multiplayer menu asking you to pick a connection type).
« Last Edit: August 13, 2007, 11:18:33 AM by op2hacker »

Offline Psudomorph

  • Jr. Member
  • **
  • Posts: 91
Code::blocks Question
« Reply #2 on: August 13, 2007, 02:22:28 PM »
Thank you. I figured there was some easy way I was missing for the Dll.

I know about the debug menu, I was half hoping there was a way to replicate that function via command line, or one of the many clever hacks you people have come up with. It didn't seem likely, but it couldn't hurt to ask as long as I was making a thread anyway.

Thanks for the help.

Now I just need to dredge up some memories from highschool programming class, and hope at least some of it translates into the real world.  :P  

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4811
Code::blocks Question
« Reply #3 on: August 13, 2007, 10:22:24 PM »
And for anyone using MSVC that was thinking of this, I did something similar. Only instead of changing the output name, I added a copy command (they are DOS commands) to the post build step. I also associated Outpost2.exe with the actaul project exe, so if I try to run the project from Dev Studio (Ctrl-F5), it'll launch OP2 for me.