Library Books and Banners

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

Library Books and Banners

Postby Jamey » Sat Aug 01, 2009 5:04 pm

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? :)
KI#46415
Jamey
 
Posts: 528
Joined: Sat Oct 20, 2007 8:32 pm
Location: Chicago, IL

Re: Library Books and Banners

Postby diafero » Sun Aug 02, 2009 12:44 am

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.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Library Books and Banners

Postby D'Lanor » Sun Aug 02, 2009 1:04 am

diafero, you can make it permanent by paging them in through city.py like the userKI did.
"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: Library Books and Banners

Postby diafero » Sun Aug 02, 2009 1:29 am

Well, but how can I easily make that configurable? I want it to be permanent only for those who chose to get it.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Library Books and Banners

Postby Tsar Hoikas » Sun Aug 02, 2009 9:55 am

Create a chronicle that the command will modify. city.py can check that.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Library Books and Banners

Postby D'Lanor » Sun Aug 02, 2009 11:19 am

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.
"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: Library Books and Banners

Postby diafero » Mon Aug 03, 2009 7:43 am

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 *
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Library Books and Banners

Postby Tsar Hoikas » Mon Aug 03, 2009 3:04 pm

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.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia


Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron