Thread Tools
Old April 25, 2003, 13:06   #1
vaustein
Settler
 
Local Time: 19:10
Local Date: November 1, 2010
Join Date: Jun 2002
Location: Midwest
Posts: 12
Good news and command line
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
vaustein is offline  
Old April 25, 2003, 13:27   #2
Paradox
Chieftain
 
Local Time: 00:10
Local Date: November 2, 2010
Join Date: Dec 2002
Location: Kent, UK + Cape Town,S.A
Posts: 50
Id be interested to know myself!!
...I posted a q some time back about any options...no-one seemed to know of any ???

Must say cant believe the programmers didnt insert any if only to assist themselves in debugging,etc....
__________________
"Some people are alive, simply because its against the law to kill them"

"Freedom is not the right to do as you please, but the liberty to do as you ought"
Paradox is offline  
Old April 27, 2003, 13:08   #3
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Dec 1969
Posts: 3,079
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]
__________________
Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

Last edited by Mercator; July 11, 2003 at 07:43.
Mercator is offline  
Old April 27, 2003, 13:25   #4
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Dec 1969
Posts: 3,079
Oh... and runciv2 will "crash" if civ2 is already running.
__________________
Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)
Mercator is offline  
Old April 27, 2003, 22:02   #5
Straybow
Civilization II Succession GamesSpanish CiversPtWDG2 TabemonoAlpha Centauri Democracy GameNationStatesGalCiv Apolyton EmpireTrade Wars / BlackNova TradersCivilization II Democracy Game
Emperor
 
Straybow's Avatar
 
Local Time: 17:10
Local Date: November 1, 2010
Join Date: Dec 1969
Location: LF & SG(2)... still here in our hearts
Posts: 6,230
Ah, yes, "Better Windows than Windows" sets the heart racing. M$ products grow bigger and uglier and more expensive with each generation. The antitrust threat did nothing to reign in aggressive licensing, and one survey of several thousand IT professionals showed that 25% planned to discontinue MSCE certification. Gooooo Linux!

Oh yeah, this is supposed to be about Civ
__________________
(\__/) Save a bunny, eat more Smurf!
(='.'=) Sponsored by the National Smurfmeat Council
(")_(") Smurf, the original blue meat! © 1999, patent pending, ® and ™ (except that "Smurf" bit)
Straybow is offline  
Old July 9, 2003, 21:35   #6
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
That was me...
(This has been downloaded 1 time(s))

A year ago I tried to do something similar (I wanted also to grab keystrokes from Civ2, but I know almost nothing about Windows programming and I interrupted my efort)

I am very surprised PBEM players don't search for something like this...



I think it is good to say you have to press 'Compile script' before saving in ResHacker. Otherwise nothing happens.

But I get the following error when running RunCiv2.exe:
Code:
Run-time error '326'
Resource with identifier '104' not found.
I think this was because I had
Code:
104, 	""
So I changed to
Code:
104, 	"Please Note"
but when Civ2 shows initial animations I get
Code:
Run-time error '5'
Invalid procedure call or argument
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old July 11, 2003, 07:39   #7
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Dec 1969
Posts: 3,079
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 get
Code:
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...
Attached Files:
File Type: zip runciv2.zip (4.9 KB, 5 views)
__________________
Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

Last edited by Mercator; July 12, 2003 at 14:19.
Mercator is offline  
Old July 11, 2003, 21:23   #8
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
Another good tip is to save after 'Compile script'.
Code:
Run-time error '5'
Invalid procedure call or argument
Again with new version...

Maybe you should wait a little with that "press space".
Or there is another problem and I should try to repeat your procedure. How do you 'play without CD'?

I test it with MGE. This is my script content:
Code:
STRINGTABLE
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
101, 	"2|Select Map To Load|*.mp;"
102, 	"4|Select Scenario To Load|*.scn;*.alt;"
103, 	"5|Select Game To Load|*.sav;*.hot;*.net;"
104, 	"Please Note"
105, 	"Civilization II Multiplayer Gold"
106, 	"E:\\Hry\\Civilization 2 MGE\\civ2.exe"
}
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old July 12, 2003, 07:05   #9
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Dec 1969
Posts: 3,079
Quote:
Originally posted by SlowThinker
Another good tip is to save after 'Compile script'.
... But I think you're asked to do that when you try to shut down.

Quote:
Code:
Run-time error '5'
Invalid procedure call or argument
Again with new version...
bah...

Quote:
Maybe you should wait a little with that "press space".
Or there is another problem and I should try to repeat your procedure. How do you 'play without CD'?
I tested it with FW, so I don't need the CD. For MGE you could get a no-CD crack.

How does it work if you press space or click the mouse yourself, as soon as the animation pops up?

The "script" looks good to me... It's probably a problem with the timing, as you said.

Oh wait... but when does the error happen? You should change the 104 to "", unless you actually get that pop-up.
__________________
Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)
Mercator is offline  
Old July 12, 2003, 11:29   #10
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
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.
SlowThinker is offline  
Old July 12, 2003, 14:18   #11
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Dec 1969
Posts: 3,079
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?
__________________
Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)
Mercator is offline  
Old July 13, 2003, 11:00   #12
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
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.
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old July 13, 2003, 13:48   #13
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Dec 1969
Posts: 3,079
Quote:
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.
Well, you could, but I'd still have to rely on people on Apolyton to see if it actually works.

As for the rest, MGE seems to act exactly like ToT in those respects.

But I'm afraid my work has to end here. I might continue work on this (if I ever decide to make a run program for ToT). But right now, I just don't have the time or motivation to continue with this. Sorry.
I included the source though, so maybe that's all the information you need to recreate it in Delphi.
__________________
Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)
Mercator is offline  
Old July 13, 2003, 15:13   #14
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
I think adding keystrokes for *.net would be easy for you ... And very useful for PBEM players.

Anyway thank you for your work.

Edit: PBEM players in place of MP players.

Last edited by SlowThinker; July 13, 2003 at 16:28.
SlowThinker is offline  
Old July 13, 2003, 15:58   #15
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Dec 1969
Posts: 3,079
Well, it probably wouldn't be too difficult, but I just don't feel like it right now...
Maybe I'll do something about it, maybe I won't. This ain't a priority on my list, so to speak.
__________________
Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)
Mercator is offline  
Old July 13, 2003, 16:28   #16
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
You would be famous between PBEM players, so to speak...
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old July 13, 2003, 17:00   #17
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 02:10
Local Date: November 2, 2010
Join Date: Dec 1969
Posts: 3,079
I'll get right to it! (not)
__________________
Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)
Mercator is offline  
 

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 20:10.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team