Black screen

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Re: Black screen

Postby D'Lanor » Tue Mar 18, 2008 7:29 am

Ok, I figured out why the fni files that PyPRP writes are wrong.

Current uruprp_export.py code:
Code: Select all
    #generate the funny file
    print "Writing %s" %(agename + ".fni")
    initxt=alcFindBlenderText("init")
    fnitxt=""
    for line in initxt.asLines():
        fnitxt=fnitxt + line + "\n"
    if fnitxt!="":
        age.setInit(fnitxt)


It is the old Carriage return/Linefeed on Windows thing again. So we need to add a \r (Carriage return). The function which writes the age file already adds this btw.

My fix:
Code: Select all
    #generate the funny file
    print "Writing %s" %(agename + ".fni")
    initxt=alcFindBlenderText("init")
    fnitxt=""
    for line in initxt.asLines():
        fnitxt=fnitxt + line + "\r\n"
    fnitxt=fnitxt[:-2]
    if fnitxt!="":
        age.setInit(fnitxt)


I also stripped the stuff that is added after the last line. This will make sure that no fni file is written when there is no fni info, instead of a fni file with an empty line as it does now. And which may be causing the problem reported here: viewtopic.php?f=10&t=1402

Edit: added to the SVN contrib section now.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Black screen

Postby D'Lanor » Fri Mar 21, 2008 10:27 am

Bump. Could one of the developers evaluate my contribution and merge it to the trunk?
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Black screen

Postby Robert The Rebuilder » Fri Mar 21, 2008 11:46 am

You might have better luck re-posting your request in the PYPRP forum, D'Lanor.
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Re: Black screen

Postby D'Lanor » Fri Mar 21, 2008 12:30 pm

Maybe, but I shouldn't have to post on the forum at all if it is on the SVN. You cannot miss a revision there if you use a proper SVN client.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Black screen

Postby Paradox » Fri Mar 21, 2008 4:05 pm

Ack. Sorry D'Lanor.
Usually I'm the one that looks over small fixes and merges them, or pokes other people to check them and merge them. I assure you that your fix is correct and that it will be merged as soon as I recover my PyPRP repo from my corrupt drive (hopefully sometime this evening).
Paradox
 
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: Black screen

Postby D'Lanor » Fri Mar 21, 2008 4:15 pm

Thanks. :)
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Black screen

Postby D'Lanor » Sun Mar 30, 2008 1:22 am

Paradox, you have not implemented my second fix for the "empty" fni file: fnitxt=fnitxt[:-2]

This strips the carriage return and linefeed characters which are added after the last line. If you do not strip those characters then the next condition if fnitxt!="": will never be true and a fni file will be written even if there is nothing in the init text. This fni file only contains a new line and it will cause a warning message to pop up when loading the age.

I have re-submitted this fix to the SVN contrib.

Edit: I have no idea why you removed this, but there is no need for a fni file to end with a new line. If you look at the Cyan fni files you will see that not all of them have a new line at the end.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Black screen

Postby Nadnerb » Sun Mar 30, 2008 3:43 pm

People really shouldn't be using empty .fni files.. it will just cause the settings from the previous age to carry over, and that is a Bad Thingâ„¢ Besides, anyone who has created a new book with a recent version of the plugin will not have an empty .fni file, because the new book script automatically creates it for them.
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Black screen

Postby D'Lanor » Sun Mar 30, 2008 5:43 pm

Actually not every age has a fni file. There are Cyan ages which do not have one. Ages inherit fni settings from the previously loaded fni file. So if an age can only be reached from another age which already has the correct settings then you do not need a fni file.

Now if I wanted to do some nitpicking I could mention that it does not make sense to set an if-statement which is never true. And that it is a bad habit not to clean up string appendages after for-statements. But then again, the bug is not that serious. And I can still implement the fix in my local copy. ;)
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Previous

Return to Building

Who is online

Users browsing this forum: No registered users and 7 guests

cron