 |
|
vaustein
|
|
Midwest
Jun 2002 time: 23:27
|
|
Is there a Civilization 2 command line option that loads a scenario? I'd like to create a shortcut to open Civ2 and automatically start a particular scenario. (Hint: It's title rhymes with "Roared at the Kings").
In a totally unrelated story, Civilization 2 + Conflicts in Civilization + Fantastic Worlds run under Linux with Winex3. Winex 3 is available at the Transgaming website. The RPMs are for subscribers only, but the CVS source is free to all.
Thank you,
vaustein
|
|
|  |
 |
|
Mercator
|
 |
Sorekara no Nanimo
Jan 1970 time: 06:27
|
|
I'm pretty sure there aren't any command-line options.
Civ2 and even its map editor always start with a menu, rather than the actual "game" window, so I don't think its' even possible.
And as far as the debugging goes, I think that's hardly a point, because civ2 is originally a windows 3.1 application, and runs simply in a window, so no directx or different audio/video settings. If games have any command-line options, that's usually the sort of thing they are about.
It would be possible to write a program that passes key "events" to civ2 (I did that with MapEdit, to automatically open up a map in the civ2 map editor)... But I'm not sure if that's feasible for civ2 either, because of the differences between civ2 versions, whether someone has the civ2 CD in the drive or not etc.
... Ah hell... I couldn't resist 
I attached a little program. Some things you must have before you can run it:
(1) Visual Basic 6 run-time files (see the downloads here: http://www.civgaming.net/mercator/mapedit)
(2) A resource editor, like this: http://www.users.on.net/johnson/resourcehacker/
The zip contains 4 files, you will only need runciv2.exe.
You can throw away the other 3 files, that's the source code (which wil only be useful if you know VB).
Open up runciv2.exe with the resource editor, and find String Table > 7 > 1033. Change the values to what they are on your system...
You'll find 6 values, 101 through 106:
101 will look like:
"2|Select Map To Load|*.mp;"
Which means:
- The 2nd item in the main civ2 menu opens up the maps,
- The map opening dialog has a title of Select Map To Load,
- All files with the extension .mp will be opened as a map (each extension must be preceded by *. and ended with ;)
102 and 103 are the same except for scenarios and savegames respectively.
104 should be the title of the window that asks for the Civ2 CD-ROM. If you don't get this dialog (e.g. you have the CD always in, or you use a no-CD crack), change this value to become empty, that is ""
105 must be the title of the first/main civ2 menu
106 must be the location of your civ2 executable (use double backslashes!, e.g. C:\\MPS\\CIV2\\Civ2.exe
Right...
(I have a funny feeling this isn't gonna work on Linux )
Oh, and I almost forgot. The way this thing actually works:
- drag and drop a file onto the program icon,
- or set runciv2.exe to become the default program to open your maps and savegames. You can then double-click on them and civ2 will open it up (or... that's what it should do anyway ).
[the updated attachment can be found a few posts down]
Last edited by Mercator on 11-07-2003 at 16:43
|
|
|  |
 |
|  |
 |
|
Mercator
|
 |
Sorekara no Nanimo
Jan 1970 time: 06:27
|
|
quote: Originally posted by SlowThinker
That was me...
(This has been downloaded 1 time(s)) |
Hurrah! 
quote: I think it is good to say you have to press 'Compile script' before saving in ResHacker. Otherwise nothing happens. |
I guess so... I have the source code, so I don't need to use ResHacker myself. Good tip (well, "tip", if you don't do it, it won't work)!
code: Run-time error '326'
Resource with identifier '104' not found.
Damn! Yes, I should have tested ResHacker better. If you change 104 to "", and compile, 104 will disappear altogether, so it can't find it.
I've fixed RunCiv2 now. It's now OK if 104 doesn't exist.
quote: but when Civ2 shows initial animations I getcode: Run-time error '5'
Invalid procedure call or argument
|
Damn again... I usually don't play with the CD, so I don't get the animations. When the animations play, RunCiv2 will switch focus to the civ2 window, but it then doesn't find any menu (because that only appears after the movie ends, or has been aborted) and consequently crashes.
But I think I've also solved this problem now... Before switching focus to the menu, runCiv2 will first "press space", which should abort the animation, and display the menu.
What civ2 version are you using, by the way?
Anyway, here's the updated version...
And updated again...
Attachment: runciv2.zip
This has been downloaded 4 time(s).
Last edited by Mercator on 12-07-2003 at 23:19
|
|
|  |
 |
|  |
 |
|
SlowThinker
|
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:27
|
|
Result of testing:
no CD versions (I tested Civ2 2.42) work
MGE with CD works with 104 set to "", but 'Select Game to Load' fails. Focus starts on the name of the file (*.sav by default), but then the focus switches to the folder selections, the window shakes but nothing happens. I have to choose the file manually.
I think this tool would be welcomed by PBEM players. Some players play several games simultaneously and repeated loading must be boring.
PBEM games are usually played in MP/Internet mode, and people use passwords (usually an equal password for all games).
Can you filter keystrokes that go into Civ2?
1. you should grab and throw away keystrokes during the work of RunCiv2. Otherwise user can interrupt the RunCiv2.
2. for PBEM players you could monitor Ctrl-N and save and post the saved file via e-mail. (An automated save after Ctrl-N might be useful not only for PBEM)
3. Sometimes you want a quick view in several saved games. I can imagine 2 ways how support this:
3a. If Civ2 is running and other .sav file is sent to RunCiv2 then RunCiv2 switches to the new game (forces Civ2 to leave the old game and to load the new one).
3b. Civ2 may be finished by Alt-F4 or Ctrl-Q. You could monitor one of these combinations: this combination would end the game quickly.
|
|
|  |
 |
|
Mercator
|
 |
Sorekara no Nanimo
Jan 1970 time: 06:27
|
|
I might have fixed the open dialog problem. I'll update the previous attachment in a sec.
I don't think I can meet your other "demands" though. 
First of all, I don't have MGE, so testing it will be hell. Secondly, I can really only do 2 things: change focus to a particular window by name, and fake pressing down keys.
I can't prevent real key events from getting through, and
I can probably only monitor keystrokes when RunCiv2 is the active application (and that's no good).
In theory it should probably be possible, but I'd probably need C++ to do that, not Visual Basic.
The nearest I might get... When Civ2 is already running, I could let RunCiv2 show a small pop-up with the full path to the savegame (rather than launch civ and open it). That would allow you to copy and paste it easily into the open dialog.
That could save a little time, especially if MGE has the same nasty habit as ToT, i.e. always starting the open dialog in your "my documents" folder.
Is that a good idea?
|
|
|  |
 |
|
SlowThinker
|
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:27
|
|
The new version works with the Open dialog in MGE correctly.
quote: First of all, I don't have MGE, so testing it will be hell. |
I think this wouldn't be a problem. MP games are started similar way as SP games: you choose lines in menus. I could tell you names of windows.
But I found another problem: MGE (and also FW IIRC) remembers which lines in starting menus were chosen last run, and these lines are chosen by default! Lines numbers are written in Civ2.dat. Format is easy: there is a chain
# of line in menu1, # of line in menu2, # of line in menu3 etc.
So a good thing would be to edit Civ2.dat before Civ2 is launched.
quote: The nearest I might get... When Civ2 is already running, I could let RunCiv2 show a small pop-up with the full path to the savegame (rather than launch civ and open it). That would allow you to copy and paste it easily into the open dialog.
That could save a little time, especially if MGE has the same nasty habit as ToT, i.e. always starting the open dialog in your "my documents" folder. |
MGE starts in MGE folder. But once it is running, it remembers the last folder from which a last game was loaded.
So I think this is not a big problem.
I still like a vision that I am going through folders in Explorer or Windows Commander, press Enter on different .sav files and Civ2 serves as a viewer...
I have tried to capture Keys in Delphi, I made a KeyboardHook dll, but it captured a half of keystrokes only.
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:27. Apolyton Time is 00:27. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|