LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices


Reply
  Search this Thread
Old 10-15-2008, 07:02 PM   #1
darthaxul
Member
 
Registered: Aug 2008
Distribution: Devuan; Gentoo; FreeBSD
Posts: 236

Rep: Reputation: 19
game mod for freedroidrpg


I was trying out the freedroidrpg game but it was terrible gameplay.
Some of the things I wanted like faster regeneration and one item per inventory slot, dieing respawns to town instead of quiting entire game, and some key bindings.
I got some of the code done but the one item per inventory slot was escaping me.
Anyway if anyone wants to try out mods here is script. run it and recompile and install and it should work.

#!/bin/bash
#Changes freedroidrpg 0.11 with some better code
#Run this script with $1 being the directory 'src' of freedroidrpg
cp $1/character.c $1/character.c.orig
cp $1/influ.c $1/influ.c.orig
cp $1/init.c $1/init.c.orig
sleep 3
cat $1/character.c.orig | sed '/Me . health_recovery_rate =/ c\Me . health_recovery_rate = 1.2' > /$1/character.c
cat $1/influ.c.orig | sed '/Me . status = I/ c\//Me . status = INFOUT' > $1/influ.c
cat $1/init.c.orig | sed '/Me . status = I/ c\Me . energy = 20; \n //Me . status = INFOUT' | sed '/append_new_game_message ( _("Game/ c\//append_new_game_message ( _("Game over.\\n") );' |sed '/GameConfig . I/ c\//GameConfig . Inventory_Visible = FALSE;' |sed '/GameConfig . C/ c\//GameConfig . CharacterScreen_Visible = FALSE;' |sed '/GameConfig . M/ c\//GameConfig . Mission_Log_Visible = FALSE;' |sed '/ThouArtDefeatedS/ c\//ThouArtDefeatedSound ( ) ;' |sed '/start_t/ c\//start_tux_death_explosions ( ) ;' | sed '/while ( ( SDL/ c\Teleport ( 0, 30, 56, 0); \n while ( SDL_GetTicks() - now < 1000 * WAIT_AFTER_KILLED ) // && ( GameOver == TRUE ) )' | sed '/GameOver = T/ c\//GameOver = TRUE;' > $1/init.c
 
Old 10-17-2008, 12:41 PM   #2
darthaxul
Member
 
Registered: Aug 2008
Distribution: Devuan; Gentoo; FreeBSD
Posts: 236

Original Poster
Rep: Reputation: 19
inventory size

The images are based on the size, not 100% though. If u scale the boots and the red dilitium crystal to 32x32 using gimp, the item only takes up 1 slot.

Not true with other weapons like the baseball bat , helmet or iron pipe.

This is so confusing why its like that.
 
Old 10-19-2008, 11:06 PM   #3
darthaxul
Member
 
Registered: Aug 2008
Distribution: Devuan; Gentoo; FreeBSD
Posts: 236

Original Poster
Rep: Reputation: 19
closer

I think I found the inventory size thing but its not working right. I made the images 32x32 in the graphics directory. It does indeed shrink the image but the block size is same. check it out here is script.

#!/bin/bash
#Changes freedroidrpg 0.11 with some better code
#Run this script with $1 being the directory 'src' of freedroidrpg
cp $1/blocks.c $1/blocks.c.orig
sleep 3
cat $1/blocks.c.orig | sed '/ItemMap [ item_type ] . inv_image . inv_size . x =/ c\ItemMap [ item_type ] . inv_image . inv_size . x = 1 ; \n //ItemMap [ item_type ] . inv_image . inv_size . x = original_img -> w / 32 ;' | sed '/ItemMap [ item_type ] . inv_image . inv_size . y =/ c\ItemMap [ item_type ] . inv_image . inv_size . y = 1 ; \n //ItemMap [ item_type ] . inv_image . inv_size . y = original_img -> h / 32 ;' | sed '/int target_x/ c\int target_x = 32; \n //int target_x = ItemMap [ item_type ] . inv_image . inv_size . x * 32;' | sed '/int target_y/ c\int target_y = 32; \n //int target_y = ItemMap [ item_type ] . inv_image . inv_size . y * 32;' | sed '/target_x = 6/ c\target_x = 32; \n //target_x = 64;' | sed '/target_y = o/ c\target_y = 32; \n //target_y = original_img -> h * 64.0 / (float)original_img -> w;' | sed '/target_y = 6/ c\target_y = 32; \n //target_y = 64;' | sed '/target_x = o/ c\target_x = 32; \n //target_x = original_img -> w * 64.0 / (float)original_img -> h;' > $1/blocks.c
 
Old 10-21-2008, 08:54 PM   #4
darthaxul
Member
 
Registered: Aug 2008
Distribution: Devuan; Gentoo; FreeBSD
Posts: 236

Original Poster
Rep: Reputation: 19
here is final

I dont know if I broke anything using this script but here is final; it compiled and everything when i tried it.
edith yea i never needed to resize images.

#!/bin/bash
#Changes freedroidrpg 0.11 with some better code
#Run this script with $1 being the directory 'src' of freedroidrpg
cat -b $1/character.c | perl -pe 's/^\s+//' > $1/character.c.orig
cat -b $1/influ.c | perl -pe 's/^\s+//' > $1/influ.c.orig
cat -b $1/init.c | perl -pe 's/^\s+//' > $1/init.c.orig
cat -b $1/blocks.c | perl -pe 's/^\s+//' > $1/blocks.c.orig
sleep 3
echo begin character
cat $1/character.c.orig | sed '/324/ c\buffer Me . health_recovery_rate = 0.6;' > $1/character.c
echo begin influ
cat $1/influ.c.orig | sed 863d > $1/influ.c
echo begin init
cat $1/init.c.orig | sed 2115,2119d | sed 2154d | sed '/start_t/ c\buffer Me . energy = 20; \n buffer ThouArtDefeatedSound ( ) ; \n buffer append_new_game_message ( _("Tux got toasted.\\n") );' | sed '/2161/ c\buffer Teleport ( 0, 30, 56, 0); \n buffer while ( SDL_GetTicks() - now < 1000 * WAIT_AFTER_KILLED )' > $1/init.c
echo begin blocks
cat $1/blocks.c.orig | sed 149,178d | sed '/if the siz/ c\buffer ItemMap [ item_type ] . inv_image . inv_size . y = 1 ; \n buffer ItemMap [ item_type ] . inv_image . inv_size . x = 1 ;' > $1/blocks.c
sleep 3
echo begin awkchar
cat $1/character.c | awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28, $29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53, $54,$55,$56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70,$71,$72,$73,$74,$75,$76,$77,$78, $79,$80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$90}' > $1/character.c.orig
echo begin awkinflu
cat $1/influ.c | awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28, $29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53, $54,$55,$56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70,$71,$72,$73,$74,$75,$76,$77,$78, $79,$80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$90}' > $1/influ.c.orig
cat $1/init.c | awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28, $29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53, $54,$55,$56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70,$71,$72,$73,$74,$75,$76,$77,$78, $79,$80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$90}' > $1/init.c.orig
echo begin awkblock
cat $1/blocks.c | awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28, $29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53, $54,$55,$56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70,$71,$72,$73,$74,$75,$76,$77,$78, $79,$80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$90}' > $1/blocks.c.orig
sleep 3
echo begin cpfinal
cp $1/character.c.orig $1/character.c
cp $1/init.c.orig $1/init.c
cp $1/influ.c.orig $1/influ.c
cp $1/blocks.c.orig $1/blocks.c

Last edited by darthaxul; 10-21-2008 at 10:22 PM. Reason: fix error
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 mod vhost_alias - problems with .htaccess mod rewrite d_t_baker Linux - Server 1 08-16-2007 07:32 PM
will you play windows game or linux native game pleasehelpme Linux - Newbie 16 04-29-2007 08:58 PM
How to play java game(like yahoo game) in firefox? Mathsniper Debian 1 01-04-2006 10:00 AM
2D/3D Game EASY Game Development Software tedjordan Linux - Games 1 03-22-2005 06:40 AM
game not receving game list from master server Rnastyracer Linux - Games 2 04-02-2004 10:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games

All times are GMT -5. The time now is 10:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration