Page 1 of 1

Library Books and Banners

PostPosted: Sat Aug 01, 2009 5:04 pm
by Jamey
Hi all, I have a request for the next version of the offline KI. This feature is very easy to implement, and a little change to the .age file is all it takes :D I'm asking this request since it can be a bit of a hastle to do this every time a new offline KI version comes out.

Ok, in the city's .age file you'll see the following lines:
Code: Select all
Page=islmLibBanners00Vis,59,1
Page=islmLibBanners02Vis,60,1
Page=islmLibBanners03Vis,61,1
Page=LibraryAhnonayVis,56,1
Page=LibraryErcanaVis,58,1
Page=LibraryGarrisonVis,54,1
Page=LibraryKadishVis,57,1
Page=LibraryTeledahnVis,55,1


Take out ALL of the
Code: Select all
,1


It will look like this afterward:

Code: Select all
Page=islmLibBanners00Vis,59
Page=islmLibBanners02Vis,60
Page=islmLibBanners03Vis,61
Page=LibraryAhnonayVis,56
Page=LibraryErcanaVis,58
Page=LibraryGarrisonVis,54
Page=LibraryKadishVis,57
Page=LibraryTeledahnVis,55


Save the .age file.

Now when you go to the Library, you will see this :D
Show Spoiler


Can you guys make this small change please? :)

Re: Library Books and Banners

PostPosted: Sun Aug 02, 2009 12:44 am
by diafero
I am opposed to changing it in the age file since that will force the change for everyone, and there might be people - myself included - who don't like to see these additional books and banners. However, there already is a command "/getlibrarybooks", which you can run when you are in the city, and which will have almost the same result - almost because I disabled two of the books which would act weird when clicking on them. That change is not permanent though as there is no SDL var controlling these books.

Re: Library Books and Banners

PostPosted: Sun Aug 02, 2009 1:04 am
by D'Lanor
diafero, you can make it permanent by paging them in through city.py like the userKI did.

Re: Library Books and Banners

PostPosted: Sun Aug 02, 2009 1:29 am
by diafero
Well, but how can I easily make that configurable? I want it to be permanent only for those who chose to get it.

Re: Library Books and Banners

PostPosted: Sun Aug 02, 2009 9:55 am
by Tsar Hoikas
Create a chronicle that the command will modify. city.py can check that.

Re: Library Books and Banners

PostPosted: Sun Aug 02, 2009 11:19 am
by D'Lanor
Or just create the SDL variable islmLibraryBannersVis and make city.py respond to it. Here is what I did in my installation.

Code: Select all
    def OnServerInitComplete(self):
        #your bahro stuff here
        try:
            ageSDL.setFlags('islmLibraryBannersVis', 1, 1)
            ageSDL.sendToClients('islmLibraryBannersVis')
            ageSDL.setNotify(self.key, 'islmLibraryBannersVis', 0.0)
            banners = ageSDL['islmLibraryBannersVis'][0]
            if banners:
                self.ILoadLibBanners(1)
        except:
            print "ERROR!  Couldn't find Library Banners sdl"


    def OnSDLNotify(self, VARname, SDLname, playerID, tag):
        #your bahro stuff here
        if (VARname == 'islmLibraryBannersVis'):
            val = ageSDL['islmLibraryBannersVis'][0]
            self.ILoadLibBanners(val)


    def ILoadLibBanners(self, state):
        pages = []
        pages += ['islmLibBanners00Vis',
         'islmLibBanners02Vis',
         'islmLibBanners03Vis']
        vault = ptVault()
        entry = vault.findChronicleEntry('JourneyClothProgress')
        if (type(entry) == type(None)):
            PtDebugPrint('DEBUG: city.ILoadLibBanners: No JourneyClothProgress chronicle')
        else:
            ageChronRefList = entry.getChildNodeRefList()
            for ageChron in ageChronRefList:
                FoundJCs = ''
                ageChild = ageChron.getChild()
                ageChild = ageChild.upcastToChronicleNode()
                FoundJCs = ageChild.chronicleGetValue()
                length = len(FoundJCs)
                if (length == 7):
                    if (ageChild.chronicleGetName() == 'Garrison'):
                        pages += ['LibraryGarrisonVis']
                    elif (ageChild.chronicleGetName() == 'Kadish'):
                        pages += ['LibraryKadishVis']
                    elif (ageChild.chronicleGetName() == 'Teledahn'):
                        pages += ['LibraryTeledahnVis']

        if state:
            PtPageInNode(pages)
        else:
            for page in pages:
                PtPageOutNode(page)

There is some extra stuff from the userKI which only showed the books for those who had finished the age.

Re: Library Books and Banners

PostPosted: Mon Aug 03, 2009 7:43 am
by diafero
Cool, thanks a lot D'Lanor :)
I wonder what else I missed from the UserKI because I only looked at the xKI file... *tries to find the sources again, they must be somewhere on this HD :D *

Re: Library Books and Banners

PostPosted: Mon Aug 03, 2009 3:04 pm
by Tsar Hoikas
D'Lanor wrote:Or just create the SDL variable islmLibraryBannersVis and make city.py respond to it. Here is what I did in my installation.

Code: Select all
    def OnServerInitComplete(self):
        #your bahro stuff here
        try:
            ageSDL.setFlags('islmLibraryBannersVis', 1, 1)
            ageSDL.sendToClients('islmLibraryBannersVis')
            ageSDL.setNotify(self.key, 'islmLibraryBannersVis', 0.0)
            banners = ageSDL['islmLibraryBannersVis'][0]
            if banners:
                self.ILoadLibBanners(1)
        except:
            print "ERROR!  Couldn't find Library Banners sdl"


    def OnSDLNotify(self, VARname, SDLname, playerID, tag):
        #your bahro stuff here
        if (VARname == 'islmLibraryBannersVis'):
            val = ageSDL['islmLibraryBannersVis'][0]
            self.ILoadLibBanners(val)


    def ILoadLibBanners(self, state):
        pages = []
        pages += ['islmLibBanners00Vis',
         'islmLibBanners02Vis',
         'islmLibBanners03Vis']
        vault = ptVault()
        entry = vault.findChronicleEntry('JourneyClothProgress')
        if (type(entry) == type(None)):
            PtDebugPrint('DEBUG: city.ILoadLibBanners: No JourneyClothProgress chronicle')
        else:
            ageChronRefList = entry.getChildNodeRefList()
            for ageChron in ageChronRefList:
                FoundJCs = ''
                ageChild = ageChron.getChild()
                ageChild = ageChild.upcastToChronicleNode()
                FoundJCs = ageChild.chronicleGetValue()
                length = len(FoundJCs)
                if (length == 7):
                    if (ageChild.chronicleGetName() == 'Garrison'):
                        pages += ['LibraryGarrisonVis']
                    elif (ageChild.chronicleGetName() == 'Kadish'):
                        pages += ['LibraryKadishVis']
                    elif (ageChild.chronicleGetName() == 'Teledahn'):
                        pages += ['LibraryTeledahnVis']

        if state:
            PtPageInNode(pages)
        else:
            for page in pages:
                PtPageOutNode(page)

There is some extra stuff from the userKI which only showed the books for those who had finished the age.


I guess I still have the thought process of "zOMG NO TOUCHIE THE SDL!!!"

Ah, the nostalgia.