Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old September 19, 2011, 01:12   #151
s0be
Apprentice
 
Join Date: Jan 2008
Posts: 96
s0be is on a distinguished road
Quote:
Originally Posted by Timo Pietilš View Post
I just downloaded the 3.2 borg source in my computer, and it looks to me that all of the files have windows-type EOL. (CR/LF).

I'm not sure why borg8.c would be any different than rest of the files.
Because I needed to patch it for including objects/foo.h instead of foo.h. Alternatively, I could have added objects/ to the include search path in the makefile, but I went for the less intrusive approach. It's just a difference in the behavior of the windows vs linux compilers.
s0be is offline   Reply With Quote
Old September 19, 2011, 07:22   #152
Timo Pietilš
Prophet
 
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,096
Timo Pietilš is on a distinguished road
Quote:
Originally Posted by s0be View Post
Because I needed to patch it for including objects/foo.h instead of foo.h. Alternatively, I could have added objects/ to the include search path in the makefile, but I went for the less intrusive approach. It's just a difference in the behavior of the windows vs linux compilers.
Ah, this is not the official code, but your patching that causes this behavior. Then APWhite doesn't need to do a thing.

Couldn't you fix the EOL in linux for that file to match rest of the files? My linux-fu is a bit rusty, but I recall that there is some command line thingamodo that can do that with single command to huge bulk of the files at once.
Timo Pietilš is offline   Reply With Quote
Old September 19, 2011, 12:21   #153
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Timo Pietilš View Post
Ah, this is not the official code, but your patching that causes this behavior. Then APWhite doesn't need to do a thing.

Couldn't you fix the EOL in linux for that file to match rest of the files? My linux-fu is a bit rusty, but I recall that there is some command line thingamodo that can do that with single command to huge bulk of the files at once.
I think sed is what you mean - very powerful, but requires arcane skill to use ...
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old September 19, 2011, 14:45   #154
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
You can install dos2unix which just does this (turns windows CRLF into unix LF).

You can use sed as so: sed -ire 's#\r$##' Makefile.win

There are many other ways to accomplish this.

To find all filenames in DIR with windows line endings you can do:

grep -rl --binary-files=without-match $'\r' DIR

To find each line in FILE with windows line ending you can do (prefixed by line number with -n):

grep -n $'\r' FILE

I'm hoping to get CRLF out of Angband's code base eventually, and will need help keeping it from sneaking back in.

P.S. These commands all work in bash on *nix (Linux, OSX, BSD, etc). I assume they'll work in Cygwin/Windows too but I'm not sure.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old September 20, 2011, 05:24   #155
s0be
Apprentice
 
Join Date: Jan 2008
Posts: 96
s0be is on a distinguished road
Quote:
Originally Posted by d_m View Post
You can install dos2unix which just does this (turns windows CRLF into unix LF).

You can use sed as so: sed -ire 's#\r$##' Makefile.win

There are many other ways to accomplish this.

To find all filenames in DIR with windows line endings you can do:

grep -rl --binary-files=without-match $'\r' DIR

To find each line in FILE with windows line ending you can do (prefixed by line number with -n):

grep -n $'\r' FILE

I'm hoping to get CRLF out of Angband's code base eventually, and will need help keeping it from sneaking back in.

P.S. These commands all work in bash on *nix (Linux, OSX, BSD, etc). I assume they'll work in Cygwin/Windows too but I'm not sure.
Yeah, but when I was doing it, it was quick n' dirty. The way I append the patches (echo -e "PATCH1\n$(diff -u ..... )ENDPATCH1" >> makeborg.sh, from memory, so don't quote me on it) didn't make it immediately apparent that there was an endline issue. I either had to pull and re-do the whole script, or just say you have to wget it rather than editing a file and copy/pasting it in.
s0be is offline   Reply With Quote
Old September 27, 2011, 22:48   #156
s0be
Apprentice
 
Join Date: Jan 2008
Posts: 96
s0be is on a distinguished road
I'm running a randart borg, and now that one has made it to end game, I've noticed it's artifact collection overlaps with the previous iteration's artifacts. Where/how does the borg respawn? I'd like to re-randomize the artifacts if possible per iteration (to keep my interest).
s0be is offline   Reply With Quote
Old September 28, 2011, 23:43   #157
APWhite
Adept
 
APWhite's Avatar
 
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
APWhite is on a distinguished road
Quote:
Originally Posted by s0be View Post
I'm running a randart borg, and now that one has made it to end game, I've noticed it's artifact collection overlaps with the previous iteration's artifacts. Where/how does the borg respawn? I'd like to re-randomize the artifacts if possible per iteration (to keep my interest).
Fixed it today. I'll upload it later. It is an easy fix in borg9.c resurrect_borg(void).

Code:
#ifdef GJW_RANDART
    /* Hack -- seed for random artifacts */
    seed_randart = randint1(0x10000000);

    /* Randomize the artifacts */
    if (adult_rand_artifacts)
    {
		do_randart(seed_randart, TRUE);
    }
#endif
Must be changed to:
Code:
    /* Hack -- seed for random artifacts */
    seed_randart = randint1(0x10000000);

    /* Randomize the artifacts */
    if (OPT(adult_randarts)) do_randart(seed_randart, TRUE);
    }
I tested it using ^zR then 035^aC and compared the artifacts created. They had different names and attributes. Both were weapons. If you do this, the borg needs to be in the dungeon, since artifacts are not created in town.
APWhite is offline   Reply With Quote
Old September 29, 2011, 02:31   #158
s0be
Apprentice
 
Join Date: Jan 2008
Posts: 96
s0be is on a distinguished road
Quote:
Originally Posted by APWhite View Post
Fixed it today. I'll upload it later. It is an easy fix in borg9.c resurrect_borg(void).

Code:
#ifdef GJW_RANDART
    /* Hack -- seed for random artifacts */
    seed_randart = randint1(0x10000000);

    /* Randomize the artifacts */
    if (adult_rand_artifacts)
    {
		do_randart(seed_randart, TRUE);
    }
#endif
Must be changed to:
Code:
    /* Hack -- seed for random artifacts */
    seed_randart = randint1(0x10000000);

    /* Randomize the artifacts */
    if (OPT(adult_randarts)) do_randart(seed_randart, TRUE);
    }
I tested it using ^zR then 035^aC and compared the artifacts created. They had different names and attributes. Both were weapons. If you do this, the borg needs to be in the dungeon, since artifacts are not created in town.
your borg_projectable function prototype changed, adding a fifth param (bool) which is causing compile failures.
s0be is offline   Reply With Quote
Old September 29, 2011, 14:42   #159
s0be
Apprentice
 
Join Date: Jan 2008
Posts: 96
s0be is on a distinguished road
After fixing the compile error, the borg is bombing out with:

Code:
# Performing defence type 22 with value 10
# Aborting (normal abort).
# Removing keypress hook
s0be is offline   Reply With Quote
Old September 29, 2011, 16:25   #160
s0be
Apprentice
 
Join Date: Jan 2008
Posts: 96
s0be is on a distinguished road
Quote:
Originally Posted by s0be View Post
After fixing the compile error, the borg is bombing out with:

Code:
# Performing defence type 22 with value 10
# Aborting (normal abort).
# Removing keypress hook
This is not an 'always' failure, just in certain spots. Next time I find one, I'll exit out, snag the save file and post it (assuming it happens immediately after restartup still). In some cases, ^zz solves it, in most I have to move a square and do ^zz, and in one case (near a zoo) none of these worked.
s0be is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
(not) running into molds half Vanilla 12 May 24, 2009 09:04
Re-thinking running (away) buzzkill Development 2 March 8, 2009 08:42
3.1 running bug Faust Vanilla 0 January 11, 2009 16:16
Disturbs when running. Zero Vanilla 1 June 19, 2008 16:30
Anyone running the nightlies... takkaria Vanilla 3 July 13, 2007 16:54


All times are GMT +1. The time now is 12:36.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.