Beginner needs help...

C

Caesar Salad

Hey everyone!

I've recently got in touch with the Ruby programming language and
thought it was very interesting and useful, way better than a ton of
other languages.

Anyway, I need some help on a few things:

1) Is there a way to detect if a program was launched? If yes, can I
block this launch and restart it when desired?
2) Can I make Ruby read *.dat files and convert them into *.txt?

Thanks in advance
 
A

Alex Young

Caesar said:
Hey everyone!

I've recently got in touch with the Ruby programming language and
thought it was very interesting and useful, way better than a ton of
other languages.

Anyway, I need some help on a few things:

1) Is there a way to detect if a program was launched? If yes, can I
block this launch and restart it when desired?
What's the platform? Windows? I suspect the answer's no, but there may
be hooks to do this that I don't know about.
2) Can I make Ruby read *.dat files and convert them into *.txt?
The answer's probably yes, but what type of .dat file are these? What
program produced them? There are many, many different file formats
going by the .dat extension :)
 
C

Caesar Salad

What's the platform? Windows? I suspect the answer's no, but there may
be hooks to do this that I don't know about.
Yes, the platform is Windows XP, but I intend to make it available to
Linux as well. I'm working on an add-on for Age of Empires 2 that
enables the player to choose a modpack before starting the game.
The file is empires2_x1.dat, the data file from Age of Empires 2:
Conquerors Expansion. There's a program that does that already (for
modpack production), but it works quite slowly (30 minutes to produce a
modded data file from an edited txt).
 
A

Alex Young

Caesar said:
Yes, the platform is Windows XP, but I intend to make it available to
Linux as well. I'm working on an add-on for Age of Empires 2 that
enables the player to choose a modpack before starting the game.
Is offering a separate interface that launches the executable with the
relevant modpack in place not an option?
The file is empires2_x1.dat, the data file from Age of Empires 2:
Conquerors Expansion. There's a program that does that already (for
modpack production), but it works quite slowly (30 minutes to produce a
modded data file from an edited txt).
If you can see the source to that program, it's probably worth taking a
look to see what the file format is. To implement a reader in Ruby,
take a look at the bitstruct library - it's probably got everything
you'll need.
 
C

Caesar Salad

Is offering a separate interface that launches the executable with the
relevant modpack in place not an option?
Never thought of that. I'm not on my own in this project (actually, some other guy came up with most of the ideas, but he's no programmer, so he asked me for some advice... so I went on ressearching for a way to implement what he came up with).
The thing is: currently, for AOE2, you can launch a graphic modpack
through an external program, in a temporary fashion. But only when the
game is not running (there are no workarounds for this, unless we hack
into the game's source code, which not only takes time, it's also
illegal). Anyway, what I thought of was to, if the player desired to
open a certain modpack, he/she would simply launch the game. It'd be
blocked, and my program would appear, giving the player the option to
choose what modpack he/she would like to use (in a list or something).
Once that was done, the game would then be launched, with the modpack
loaded.
Also, there are AOE2 players that use Windows, and others that use Linux
(and a few who use Macs). So we intended to make this program available
for both OS.
If you can see the source to that program, it's probably worth taking a
look to see what the file format is. To implement a reader in Ruby,
take a look at the bitstruct library - it's probably got everything
you'll need.
Where can I get this library?

(BTW, where can I get a good Ruby library for graphical interface?)
 
A

Alex Young

Caesar said:
The thing is: currently, for AOE2, you can launch a graphic modpack
through an external program, in a temporary fashion. But only when the
game is not running (there are no workarounds for this, unless we hack
into the game's source code, which not only takes time, it's also
illegal). Anyway, what I thought of was to, if the player desired to
open a certain modpack, he/she would simply launch the game. It'd be
blocked, and my program would appear, giving the player the option to
choose what modpack he/she would like to use (in a list or something).
Once that was done, the game would then be launched, with the modpack
loaded.
Also, there are AOE2 players that use Windows, and others that use Linux
(and a few who use Macs). So we intended to make this program available
for both OS.
In that case, you're probably going to want to just move the AOE2
executable to one side and replace it with your program - the user won't
notice the difference then. I don't know of any cross-platform way to
intercept an executable's launch.
Where can I get this library? http://raa.ruby-lang.org/project/bit-struct/

(BTW, where can I get a good Ruby library for graphical interface?)
TK, GTK, QT and Wx all have Ruby interfaces, among others. Which to
choose is a matter of personal taste, to a large degree. There are good
examples out there for GTK and QT, at the very least. I've not looked
into any others myself - search the archives for more discussion on this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,270
Messages
2,571,352
Members
48,035
Latest member
SvenDriver

Latest Threads

Top