Keen: Modding Forum Index Keen: Modding
All the modding info you'll ever need
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ModKeen 2 + Fin2Bmp Windows/Linux port: LModKeen 2
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Keen: Modding Forum Index -> ModKeen
View previous topic :: View next topic  
Author Message
Shadow Master



Joined: 20 Oct 2006
Posts: 129
Location: Santiago, Chile

PostPosted: Wed Apr 04, 2007 5:27 pm    Post subject: Reply with quote

The filename normalizing script is here. Instead of adding extra code to ModKeen, I decided to write a separate UNIX shell script file.

If you need to download it, save the following link to a file:
http://shadowm2006.sitesled.com/src/normalize_filenames

Code:
Code:
#!/bin/sh
## ------------------------------------------------------------------------------------
## normalize_filenames - Converts all filenames of a dir in a case-sensitive
##                       volume to what LModKeen expects
##
## Copyright (c)2007 by Ignacio R. Morelle "Shadow Master". (shadowm2006@gmail.com)
## for LModKeen II
##
## Original code Copyright (c)2002-2004 Andrew Durdin. (andy@durdin.net)
## Keen Dreams support added by MultiMANIA. (multimania@gmail.com)
## Linux port code, reviewed Keen Dreams support and FIN2BMP integration
## by Shadow Master.
##
## This software is provided 'as-is', without any express or implied warranty.
## In no event will the authors be held liable for any damages arising from
## the use of this software.
## Permission is granted to anyone to use this software for any purpose, including
## commercial applications, and to alter it and redistribute it freely, subject
## to the following restrictions:
##    1. The origin of this software must not be misrepresented; you must not
##       claim that you wrote the original software. If you use this software in
##       a product, an acknowledgment in the product documentation would be
##       appreciated but is not required.
##    2. Altered source versions must be plainly marked as such, and must not be
##       misrepresented as being the original software.
##    3. This notice may not be removed or altered from any source distribution.
## ------------------------------------------------------------------------------------


normalize_keen123 ()
{
   if [ -e ./egagraph.ck$episode ]; then
      mv ./egagraph.ck$episode ./EGAGRAPH.CK$episode
   fi
   if [ -e ./egalatch.ck$episode ]; then
      mv ./egalatch.ck$episode ./EGALATCH.CK$episode
   fi
   if [ -e ./egasprit.ck$episode ]; then
      mv ./egasprit.ck$episode ./EGASPRIT.CK$episode
   fi
   if [ -e ./finale.ck$episode ]; then
      mv ./finale.ck$episode ./FINALE.CK$episode
   fi
   if [ -e ./sounds.ck$episode ]; then
      mv ./sounds.ck$episode ./SOUNDS.CK$episode
   fi
   if [ -e ./preview2.ck1 ]; then
      mv ./preview2.ck1 ./PREVIEW2.CK1
   fi
   if [ -e ./preview3.ck1 ]; then
      mv ./preview3.ck1 ./PREVIEW3.CK1
   fi

   return 0
}

normalize_keen456 ()
{
   if [ -e ./audio.ck$episode ]; then
      mv ./audio.ck$episode ./AUDIO.CK$episode
   fi
   if [ -e ./config.ck$episode ]; then
      mv ./config.ck$episode ./CONFIG.CK$episode
   fi
   if [ -e ./egagraph.ck$episode ]; then
      mv ./egagraph.ck$episode ./EGAGRAPH.CK$episode
   fi   
   if [ -e ./egahead.ck$episode ]; then
      mv ./egahead.ck$episode ./EGAHEAD.CK$episode
   fi   
   if [ -e ./gamemaps.ck$episode ]; then
      mv ./gamemaps.ck$episode ./GAMEMAPS.CK$episode
   fi

   if [ $episode != 6 ]; then
      exe_eganame="KEEN${episode}E.EXE"
      exe_cganame="KEEN${episode}C.EXE"
      exe_eganame_l="keen${episode}e.exe"
      exe_cganame_l="keen${episode}c.exe"
   else
      exe_eganame="KEEN6.EXE"
      exe_cganame="KEEN6C.EXE"
      exe_eganame_l="keen6.exe"
      exe_cganame_l="keen6c.exe"
   fi

   if [ -e ./$exe_eganame_l ]; then
      mv ./$exe_eganame_l ./$exe_eganame
   fi
   if [ -e ./$exe_cganame_l ]; then
      mv ./$exe_cganame_l ./$exe_cganame
   fi

   return 0
}

declare episode

if [[ "$1" = "-h" || "$1" = "--help" ]]; then
   echo "Usage:"
   echo "   normalize_filenames [episode number]"
   echo "Note: episode number is D for Keen Dreams."
   exit 0
fi

if [[ "$1" = "1" || "$1" = "keen1" || "$1" = "KEEN1" ]]; then
   episode=1
elif [[ "$1" = "2" || "$1" = "keen2" || "$1" = "KEEN2" ]]; then
   episode=2
elif [[ "$1" = "3" || "$1" = "keen3" || "$1" = "KEEN3" ]]; then
   episode=3
elif [[ "$1" = "4" || "$1" = "keen4" || "$1" = "KEEN4" ]]; then
   episode=4
elif [[ "$1" = "5" || "$1" = "keen5" || "$1" = "KEEN5" ]]; then
   episode=5
elif [[ "$1" = "6" || "$1" = "keen6" || "$1" = "KEEN6" ]]; then
   episode=6
elif [[ "$1" = "D" || "$1" = "kdreams" || "$1" = "KDREAMS" || "$1" = "keend" || "$1" = "KEEND" ]]; then
   episode=7
else
   echo "No episode number given!"
   exit -1
fi

case $episode in
   1) normalize_keen123 ;;
   2) normalize_keen123 ;;
   3) normalize_keen123 ;;
   4) normalize_keen456 ;;
   5) normalize_keen456 ;;
   6) normalize_keen456 ;;
esac

echo "Done! Now you can run ModKeen."


Loooooooooooooong. Isn't it?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
XkyRauh



Joined: 31 Aug 2003
Posts: 1099
Location: San Diego, California

PostPosted: Wed Apr 04, 2007 10:35 pm    Post subject: Reply with quote

Long, but systematic. :) Cheers.
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Shadow Master



Joined: 20 Oct 2006
Posts: 129
Location: Santiago, Chile

PostPosted: Mon Apr 09, 2007 7:40 pm    Post subject: LModKeen II beta4 preannouncement Reply with quote

Yes, the 4th beta of LModKeen II is coming. New features:

- Builds for Windows using the Mingw32 cross-compiler for Linux -- a Win32 exe (ready-to-use) will be included with the final package. And yes, this has been tested. Outputs some extra garbage to console, but Keen data handling is OK.
- Adds Bio Menace support (in progress).
- More code optimizations.
- Will add Dangerous Dave support as soon as Levellass remembers my request.
- The makefiles for Linux and Mingw32 will work ON ANY SYSTEM with no modifications (warning: the mingw32 makefile will require slight modifications).
- Enhances miscellaenous stuff.

That's all. I'm sure you guys will be happy with the feature noted above in bold font. No more WindowsUpdate Syndrome with ModKeen, you'll be able to run it natively from Windows as you did with z-1 Win32 port of ModKeen 1. Remember, the difference between his and my port is simple: mine is port of ModKeen 2.0.1. :)

Levellass also mentioned something about Shadow Knights support. Could she help me? >:) And if somebody knows if Dangerous Dave 3 uses the Keen engine code, please tell me. Its files are named in a similar way to Keen4's files.

And yes, this version will include a free (as in "free beer") toaster. A windows9x-nuclear-bomb assembling pack is avaiable under request too.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Shadow Master



Joined: 20 Oct 2006
Posts: 129
Location: Santiago, Chile

PostPosted: Thu Apr 19, 2007 3:17 pm    Post subject: Reply with quote

I decided to use the beta-3 source code for a definitive LModKeen II release, with bugfixes and the Win32 and Linux makefiles I made recently. I only have one bug to fix for the release, and it's about the Win32 console output. For example:
Code:

Importing bitmaps: 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0%...

That's the strange output of the Windows build. I think I introduced a bug or two in the Win32 console code while reusing existing code (Meta engine v0.1.1 source code, copyright (c) 2006-2007 by myself). It should be easy to fix, but for the mean time, this project needs a new name.

I named it "LModkeen" because of "Linux", but now it is also the second unofficial Win32 ModKeen. I need "ideas" for the L.

Ah, Bio-Menace, Shadow Knights, Dangerous Dave 2 and Keen Dreams support won't be in this release, wait for LModKeen 3.0.

EDIT: I should've said two bugs. The other one is on the filename normalizer script. I didn't include a line for renaming one of the EGAsomething.CKx files on Keen 1-3.

EDIT2: Levellass, know that I shall fill your email inbox with spam messages until you help me with DD2 and SK support!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
adurdin
Site Admin


Joined: 29 Aug 2003
Posts: 585
Location: Edinburgh, Scotland

PostPosted: Thu Apr 19, 2007 7:50 pm    Post subject: Reply with quote

Shadow Master wrote:
for the mean time, this project needs a new name.

I named it "LModkeen" because of "Linux", but now it is also the second unofficial Win32 ModKeen. I need "ideas" for the L.


Loony? Light? Lapwing? Lollipop? :)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Shadow Master



Joined: 20 Oct 2006
Posts: 129
Location: Santiago, Chile

PostPosted: Fri May 04, 2007 5:59 pm    Post subject: Reply with quote

I wrote down the production name for this application in my copybook. I didn't bring it today though.

Well. I have only one, ONE bug to solve before releasing LModKeen II. And it is about Win32 console support (I think I mentioned it before). I don't have enough time and I can't find the cause of this problem.

Any volunteers with Mingw32 to write a better Makefile based in the current one (which is for Mingw32's Linux cross-compiler) and find and fix the bug that causes me this horrendous headache? Please. :) If anyone wants to help me with this, post here and I'll reply with the link to the lmodkeen2-rc1 zip file for you to download.

I'm more enthusiastic currently about LModKeen 3, with the improved Keen Dreams, new Bio Menace, Dangerous Dave and Shadow Knights support, plus it will be C++ based in order to re-modularize old stuff.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Malvineous



Joined: 13 Mar 2004
Posts: 79
Location: Brisbane, Australia

PostPosted: Sun May 06, 2007 1:08 am    Post subject: Filename case Reply with quote

Just saw your post about fixing the case of filenames. I have this problem fairly often so I thought you might be interested in a more generic script I came up with. Save the code in a file called "namelower", make it executable and put it in the path and then you can do stuff like this:

$ cd keen1
$ namelower *

And it will make each filename in the directory lowercase. The script is here:

Code:
#!/bin/sh

if [ "$1" == "" ]; then
  echo "namelower - rename a given file so that its filename contains only"
  echo "            lowercase characters."
  echo ""
  echo "Usage: namelower file1 [file2...]"
  echo ""
fi

while [ "$1" != "" ]; do
  FILENAME=$1
  LOWERFILE=`strlower "${FILENAME}"`
  if [ "$FILENAME" != "$LOWERFILE" ]; then
    # File is not already lowercase
    if [ -a "$LOWERFILE" ]; then
      echo "namelower: skipping ${FILENAME}, lowercase file already exists." > /dev/stderr
    else
      mv "$FILENAME" "$LOWERFILE"
    fi
  fi
  shift
done

and it uses a command called "strlower" which needs to be compiled separately because I couldn't find an existing utility that did it (and it was far too slow doing the case conversion in the shell script.)

Code:
#include <ctype.h>
#include <stdio.h>

char *strlower(char *str)
{
  char *str1 = str;
  while (*str != 0)
    *str++ = tolower(*str);
  return str1;
}

int main(int argc, char *argv[])
{
  if (argc >= 2)
    printf("%s\n", strlower(argv[1]));
  return 0;
}

Compile it with something like "gcc -o strlower strlower.c && strip strlower" Make sure you put it in your path too (/usr/local/bin is a good place for both) and it should be ready to go.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Shadow Master



Joined: 20 Oct 2006
Posts: 129
Location: Santiago, Chile

PostPosted: Mon May 07, 2007 5:38 pm    Post subject: Reply with quote

Perhaps I should hack it so that it converts lower to upper. I need upper, not lowercase names :p

When I decided to convert all names in ModKeen's code to uppercase, I was thinking about something I read/heard about sometime ago. Old DOS systems store 8.3 *uppercase* filenames in the File Allocation Table. I'm not sure, but I think I saw proof of it by viewing an IMA file with a hex editor.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Malvineous



Joined: 13 Mar 2004
Posts: 79
Location: Brisbane, Australia

PostPosted: Mon May 07, 2007 10:32 pm    Post subject: Reply with quote

You're more than welcome to change it as you see fit, but when was the last time you saw uppercase names on a Linux filesystem??? Sure, FAT filesystems store names in uppercase, but the Linux FAT driver converts them to lowercase anyway...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Shadow Master



Joined: 20 Oct 2006
Posts: 129
Location: Santiago, Chile

PostPosted: Tue May 08, 2007 2:12 pm    Post subject: Reply with quote

I'll fix that strange decission in the LModKeen 2.5 release. I'll also include a proper filename normalizer in the enxt release.

I release now LModKeen 2:
- Source code & binaries: http://shadowm2006.sitesled.com/src/lmodkeen2-rel1.tar.bz2
- Windows binary: http://shadowm2006.sitesled.com/lmodkeen2-rel1-win32.zip

This version is now the first Windows port of ModKeen 2.0.1. Includes integrated (automatically used) FIN2BMP functionality. This is also the second Linux port of ModKeen.2.0.1.

Have fun!

EDIT: if you hesitate to download it because of the supposedly unresolvable bug I mentioned above, well, I inform you that I resolved it after 4 hours of research and tests with Windows 98 and Wine. :P

HOWEVER, I still need volunteers for writing a Win32 native Mingw32 makefile, and the MacOS X port if someone's interested in it (it should require a new makefile, nothing more, or ncurses doesn't run on Mac OS X?).
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
grafix



Joined: 29 Oct 2004
Posts: 208

PostPosted: Tue May 08, 2007 5:47 pm    Post subject: Reply with quote

I wouldn't mind helping out with the OS X port, since I've already managed to compile LModKeen 1 and 2 on my Mac. The makefile will need a complete rewrite, though - is it being generated by Eclipse at the moment? It won't work for me, so I just run gcc manually.
Back to top
View user's profile Send private message
Shadow Master



Joined: 20 Oct 2006
Posts: 129
Location: Santiago, Chile

PostPosted: Tue May 08, 2007 7:00 pm    Post subject: Reply with quote

It's generated by Eclipse, yes, although I replaced some parts so that it's not dependent on my own computer.

It builds fine on a Linux machine that doesn't have Eclipse installed, so I'm 100% sure that the provided makefile is ok.

EDIT: Ah, mac! Disregard the text abovev.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Shadow Master



Joined: 20 Oct 2006
Posts: 129
Location: Santiago, Chile

PostPosted: Tue May 22, 2007 7:50 pm    Post subject: Reply with quote

Well, this project's (LModKeen) still maintained by me, however, there are bad news: it's name is no longer LModKeen.

Why? Because I initially named it LModKeen after "Linux's ModKeen". However, some people convinced me to port it to the Windows platform later, and the result (Lmodkeen 2) is not only a Linux port, but also a Windows port. So it's name should've been "LWModKeen" (Linux+Windows ModKeen) or something like that. Plus the enhancements and stuff that are coming with the versions 2.2 and 3.0, I decided to change its name to "EModKeen", the "Enhanced ModKeen".

So, this is another pre-announcement, but it's for EModKeen versions 2.1 and 2.9. The deadline should be around December of this year; now that the community has a stable Windows Modkeen 2.0.1 (Lmk 2, my little present for you all), and it's gaining some users, it's time to modernize the existing utilities, and with utilities I mean ModKeen 2.0.1, TEDSetup, Fin2BMP. All of them have been exhaustively tested, used and perhaps even abused, so it's time to integrate all of them into a single tool... EModKeen.

Starting from now, the version numbering system will be the same as most open-source software, thus 2.0, 2.2, 2.4, 2.6 and so on, are for stable (final-user) releases. 2.1, 2.3, 2.5, etc., stand for unstable releases that should not be used by final users. By "final users" I mean all those who actually want to create a mod. The unstable releases are just for me, the testers and those who want to study other mods, etc.

EModKeen 2.1.x are the alpha and beta versions for EModKeen 2.2, while 2.9.x are the alpha and betas for EModKeen 3.

What's coming soon in EModKeen 2.2 then?

- Will use only lowercase filenames (sorry Linux LModKeen users... if any; you'll have to rename your stuff with a provided script).
- TED Setup integrated for semi-transparent import/export operations on Keen: Galaxy mods. Semi- because I might add a new command line parameter in order to avoid confusion, such as --prepmaps.
- Separate carmackization.
- Keen Dreams support is really, really supposed to be finished for this one.
- Audio.ckx -> audiohed.ckx + audiot.ckx operation might be added, but I can't promise anything about it. (At least I already know where the audiodct.ckx contents are stored in the exe.)

And in EModKeen 3:

- Everything noted above.
- Bio Menace and Dangerous Dave 2 support.
- Everything ported to C++ for extensibility, portability, usability, etc.

Any comments, suggestions and spam for pressing me to do all this before December, go to shadowm 2006 at gm@il d0tz c0mz.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
levellass



Joined: 11 Oct 2006
Posts: 2046
Location: Ngaruawahia New Zealand

PostPosted: Wed May 23, 2007 5:24 am    Post subject: Reply with quote

*Gasp!*

Emo'd Keen!


This sounds great; it'll remove all those other now uneeded applications!
Back to top
View user's profile Send private message
ckguy



Joined: 14 Oct 2003
Posts: 467
Location: Charlestown, RI

PostPosted: Wed May 23, 2007 11:27 am    Post subject: Reply with quote

Sounds really nice!

[edit:] Woohoo, my 314th post!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Keen: Modding Forum Index -> ModKeen All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group