[SOLVED] Layer-Question

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Yeto
Newbie
Posts: 18
Joined: Sun Sep 04, 2011 5:11 am
Contact:

[SOLVED] Layer-Question

#1 Post by Yeto »

Hi friends,
I am progging an "old-school-3D-RPG" and it went fine so long. Everything is shown in the right order, I added a day-night-cycle (it works perfect).

Now I try to "light" a candle or torch in the night. At the moment I only reduce the darkness, but a torch (or candle) should have a "lightcircle" around the party. I read many things about layer, but trying to add more layer gives the error:
Exception: Trying to add something to non-existent layer 'transient'.
What I did, was adding the line:
config.layers = [ 'master', 'mittelayer', 'nahlayer' 'transient', 'screens', 'overlay']
at the end of my options.rpy (I found this tipp in the internet). Well, it doesn't seem to work...

The following idea I had:

Code: Select all

screen world():
    imagemap:
        ground 'images/bg/interface.png'
        hover ''
        alpha False
        add "bg/actionleiste 1.png" ypos 532
        add "welt/himmel/himmel [showBG[0]] [numBG].png" xpos 136 ypos 136
        add "welt/boden/boden [showBG[1]] [numBG].png" xpos 136 ypos 332
        $ entfernung = 8
        $ rechtsLinks = 0
        $ temp1 = ""

        if party[activeParty].stadt == "Wildnis":
            $ KARTE = 2000
        else:
            $ KARTE = 50

        if party[activeParty].blickrichtung == "norden":
            if party[activeParty].position[0] + entfernung < KARTE and party[activeParty].position[1] + rechtsLinks < KARTE:
                $ temp = worldData[PARTYisINarea][party[activeParty].position[0] + entfernung][party[activeParty].position[1] + rechtsLinks]
            else:
                $ temp = -1
        elif party[activeParty].blickrichtung == "süden":
            if party[activeParty].position[0] >= entfernung and party[activeParty].position[1] + rechtsLinks < KARTE:
                $ temp = worldData[PARTYisINarea][party[activeParty].position[0] - entfernung][party[activeParty].position[1] + rechtsLinks]
            else:
                $ temp = -1
 ...
         if temp in WAND:
            add "wand/Gra[temp]88.png" xpos 460 ypos 326   #Wand mitte(8)
            
#and so on, until the range of the candle or torch is arrived.
# Then switch to the "mittelayer" and adding the next walls, obstacles or NPC but with less darkness
What went wrong with my new layers?
Maybe I shouldn't use
imagemap:
and instead "show" everything on the screen?
... Do you have any suggestions?
BTW: I use Renpy 7.3.5.606

THX in advance

Yeto
Newbie
Posts: 18
Joined: Sun Sep 04, 2011 5:11 am
Contact:

Re: [SOLVED] Layer-Question

#2 Post by Yeto »

Made it!
I just put some "alpha".bmp's between the different distances.
Now you have the feeling, that it is getting darker in distance...

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Google [Bot]