Enerccio has questions

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.
Message
Author
User avatar
Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

Enerccio has questions

#1 Post by Enerccio » Sun Nov 19, 2006 3:45 pm

I am working with basic dse tutrial and please how to make a something like when day=7 special event takes place and event table even not appeard. Arigato. :D
Last edited by Enerccio on Mon Nov 20, 2006 5:17 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 15446
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#2 Post by PyTom » Sun Nov 19, 2006 3:50 pm

in main.rpy, after label day, you can add a check that sees what day it is, does something special, and then jumps back to day.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

#3 Post by Enerccio » Sun Nov 19, 2006 3:59 pm

PyTom wrote:in main.rpy, after label day, you can add a check that sees what day it is, does something special, and then jumps back to day.
Thanks. :D
And if i want to make like each 7 day there will be no school?

User avatar
PyTom
Ren'Py Creator
Posts: 15446
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#4 Post by PyTom » Sun Nov 19, 2006 4:15 pm

You need to change the contents of dp_period_names, dp_period_vars, and dp_period_acts each day so that it reflects the activities that are available each day.

(I suspect this will be easier when I write the new tokimeki-style DSE, which focus more on action selection rather then day planning.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Watercolorheart
Eileen-Class Veteran
Posts: 1308
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

#5 Post by Watercolorheart » Sun Nov 19, 2006 4:56 pm

PyTom wrote:(I suspect this will be easier when I write the new tokimeki-style DSE, which focus more on action selection rather then day planning.)
Yay. Does that mean it'll be easier to read and comprehend?

I always loved the DSE engine, but I couldn't think my way through all the programming required.
I'm not even the same person anymore

User avatar
PyTom
Ren'Py Creator
Posts: 15446
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#6 Post by PyTom » Sun Nov 19, 2006 5:03 pm

BCS wrote:Yay. Does that mean it'll be easier to read and comprehend?
The goal is to make it easier and less magical. But that doesn't mean it will be totally easy... Dating sims are complicated, compared to visual novels, and at least some fraction of that complexity will need to be exposed to the developer.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#7 Post by monele » Sun Nov 19, 2006 5:55 pm

BCS wrote:I always loved the DSE engine, but I couldn't think my way through all the programming required.
If you have a thorough project behind this, remember there are coders to hire ;). At least that's one thing I'm sure to succeed in compared to graphics and story :)

User avatar
Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

#8 Post by Enerccio » Sun Nov 19, 2006 6:41 pm

PyTom wrote:in main.rpy, after label day, you can add a check that sees what day it is, does something special, and then jumps back to day.
in main.rpy and events.rpy you can use all things like in script.rpy (ie showing backgrounds, playing music, moving characters...)

User avatar
Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

#9 Post by Enerccio » Sun Nov 19, 2006 7:06 pm

I got this problem:
when i compile script all is right but when i play it and click on new game:

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

TypeError: 'tuple' object is not callable

While executing game script on line 49 of c:\Documents and Settings\Enerccio\Desktop\renpy\Shikigami Academy/game/day_planner.rpy.
While executing python code on line 76 of c:\Documents and Settings\Enerccio\Desktop\renpy\Shikigami Academy/game/day_planner.rpy.

-- Full Traceback ------------------------------------------------------------

  File "c:\Documents and Settings\Enerccio\Desktop\renpy\renpy\bootstrap.py", line 164, in bootstrap
  File "c:\Documents and Settings\Enerccio\Desktop\renpy\renpy\main.py", line 231, in main
  File "c:\Documents and Settings\Enerccio\Desktop\renpy\renpy\execution.py", line 97, in run
  File "c:\Documents and Settings\Enerccio\Desktop\renpy\renpy\ast.py", line 379, in execute
  File "c:\Documents and Settings\Enerccio\Desktop\renpy\renpy\python.py", line 837, in py_exec_bytecode
  File "c:\Documents and Settings\Enerccio\Desktop\renpy\Shikigami Academy/game/day_planner.rpy", line 76, in <module>
TypeError: 'tuple' object is not callable

While executing game script on line 49 of c:\Documents and Settings\Enerccio\Desktop\renpy\Shikigami Academy/game/day_planner.rpy.
While executing python code on line 76 of c:\Documents and Settings\Enerccio\Desktop\renpy\Shikigami Academy/game/day_planner.rpy.

Ren'Py Version: Ren'Py 5.6.3a

Code: Select all

day_planner
# This contains code for the new day planner. You probably
# don't want to change this file, but it might make sense to
# change many of the variables or styles defined here from
# other files.

init -100:

    python:

        # A window placed behind the day planner (empty).
        style.create('dp_window', 'window')
        style.dp_window.ypos = 300
        style.dp_window.yanchor = 'top'

        # The grid containing the three choices in the day planner.
        style.create('dp_grid', 'default')
        style.dp_grid.xfill = True
        
        # Windows containing the groups of choices in the day planner.
        style.create('dp_choice', 'default')
        style.dp_choice.xpos = 0.5
        style.dp_choice.xanchor = 'center'

        # Action buttons.
        style.create('dp_button', 'button')
        style.create('dp_button_text', 'button_text')

        style.create('dp_done_button', 'button')
        style.create('dp_done_button_text', 'button_text')

        style.dp_done_button.ypos = 0.95
        style.dp_done_button.yanchor = 'bottom'
        
        # Labels.
        style.create('dp_label', 'default')
        style.dp_label.xpos = 0.5
        style.dp_label.xanchor = 'center'

        # The amount of padding between the label and the action
        # in a choice.
        dp_padding = 12 

        # The amount of padding between the choices and done.
        dp_done_padding = 32

        # The title of the done button.
        dp_done_title = "Done Planning Day"

[b]    python:[/b]

        # A list of the periods of the day that are present in the
        # day planner. This can be changed at runtime.
        dp_period_names = [ "Morning", "Afternoon", "Evening" ]

        # A list of variables that will take the selected choices
        # for each of the periods named above.
        dp_period_vars = [ "morning_act",
                           "afternoon_act",
                           "evening_act", ]

        # A map from the period names to a list of the activities
        # available for that period. This may be conputed before
        # each call to day_planner. Each entry is a tuple, where
        # the first element is the name shown to the user, and the
        # second is the name assigned to the variable for that
        # period.
        dp_period_acts = {        
            'Morning': [
            ( 'School', "class" ),
            ( 'Train', "train"),
            ( 'Cut Class', "cut"),
            ],
            
            'Afternoon': [
            ( 'Study', "study" ),
[b]            ( 'Train', "trainev" ),[/b]
            ( 'Fight Hollows', "hollow" ),
            ( 'Hang Out', "hang" ),
            ],
            
            'Evening' : [
            ( 'Study', "cut"),
            ( 'Guard job', "work"),
            ( 'Train Magic', "magic" ),
            ( 'Play Games', "play" ),
            ],
            }

        

# We assume that the various period variables have been assigned
# default values by this point.
label day_planner:

    call dp_callback from _call_dp_callback_1

    python hide:

        renpy.choice_for_skipping()

        ui.window(style='dp_window')
        ui.vbox(dp_done_padding)

        ui.grid(len(dp_period_names), 1, xfill=True, style='dp_grid')

        # True iff every period has a valid value.
        can_continue = True

        for period, var in zip(dp_period_names, dp_period_vars):

            ui.window(style='dp_choice')
            ui.vbox()

            _label_factory(period, "dp")
            ui.null(height=dp_padding)

            valid_value = False

            for label, value in dp_period_acts[period]:

                def clicked(var=var, value=value):
                    setattr(store, var, value)
                    return True

                valid_value |= getattr(store, var) == value

                _button_factory(label, "dp",
                                selected = getattr(store, var) == value,
                                clicked=clicked)

            can_continue &= valid_value

            ui.close()

        ui.close()

        if can_continue:
            clicked = lambda : False
        else:
            clicked = None
            
        _button_factory(dp_done_title, "dp_done",
                        clicked = clicked )

        ui.close()

        
    if ui.interact():
        jump day_planner

    return 

black text is the where the error is.
Can anyone help please :(

User avatar
PyTom
Ren'Py Creator
Posts: 15446
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#10 Post by PyTom » Sun Nov 19, 2006 10:57 pm

Are you sure the comma is there on lines 75 and 76? This error is almost always caused by a missing comma.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

#11 Post by Enerccio » Mon Nov 20, 2006 8:51 am

In renpy is fun that each time you amke dsomething wrong the error is tottaly wrong - like when i do not have one word error wos actualy talking about something very other.... very funny :lol: :lol: :lol:

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#12 Post by mikey » Mon Nov 20, 2006 8:57 am

I'm not sure about what you want (to say), but I'm around quite often, you can formulate the request in Slovak and I'll translate it so that you can fix the problem quicker if you need to. Less of a hassle, probably.

User avatar
Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

#13 Post by Enerccio » Mon Nov 20, 2006 9:46 am

mikey wrote:I'm not sure about what you want (to say), but I'm around quite often, you can formulate the request in Slovak and I'll translate it so that you can fix the problem quicker if you need to. Less of a hassle, probably.
Takze napriklad ked nieco zle napisem:
priklad:
$ zanjutsu = Stat('Zanjutsu', 5, 200) som napisal
$ zanjutsu = ('Zanjutsu', 5, 200)

a hra mi vyhodila v uplne inom riadku kde bol tento kod ze
$ shown_stats = [ zanjutsu, hakuda, hohou, kidou, shikai, bankai, relax ]
ze neexistuje premennna Hodou ktoru som len raz pouzil aj to som ju potom zmazal (lebo spravne je hohou)
cize chyba uplne odveci ktora vobec nesuvisela....

druhy priklad:
pridal som
$ event("cut3", "act == 'cut' and relax >= 50", event.choose_one('cut'), priority=200)

a

label cut3:

"I cut class, and spend the morning drinking in the bar. Unfortunately you got sick..."
$ hohou.value -= 15
$ kidou.value -= 15
$ shikai.value -= 10
$ relax.value -= 30

return

a mne to vypisovalo chybu ze nie je definovana premenna intelligence cize dalsia chyba uplne odveci... :lol: :lol: :lol:
(a v tom druhom dokonca ani neviem kde je chyba...)

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#14 Post by mikey » Mon Nov 20, 2006 10:08 am

So, the translation:

----------------------------------
So when I write something wrong, for instance:

Code: Select all

    $ zanjutsu = Stat('Zanjutsu', 5, 200) 
I wrote as

Code: Select all

    $ zanjutsu = ('Zanjutsu', 5, 200) 
And the game reported an error in a different line number:

Code: Select all

   $ shown_stats = [ zanjutsu, hakuda, hohou, kidou, shikai, bankai, relax ]

that there doesn't exist the variable Hodou, which I have used only once, and deleted it afterwards (because correctly it's hohou)
So a completely unrelated error [message].


---

Another example:
I added

Code: Select all

$ event("cut3", "act == 'cut' and relax >= 50", event.choose_one('cut'), priority=200)
and

Code: Select all

   label cut3: 
 "I cut class, and spend the morning drinking in the bar. Unfortunately you got sick..."
$ hohou.value -= 15
$ kidou.value -= 15
$ shikai.value -= 10
$ relax.value -= 30

return 
and it kept reporting the error that the intelligence variable is not defined., so another competely unrelated error :lol:
In the second [example], I don't even know where the actual error is.

----------------------------------

Hope this helps. From my limited experience, sometimes it helps to delete the .rpyc files when you made changes that don't seem to show.

Also, I have noticed that you can get a lot of errors when your files are in capitals, SCRIPT.RPY isn't the same as script.rpy.

But these are just my general obvservations, better to wait for proper help. Good luck. :P

User avatar
Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

#15 Post by Enerccio » Mon Nov 20, 2006 10:15 am

I do that and no effect. In first erro when i corrected with word Stat error dissapeard, but in second one i dont know what is wrong...
Thx Mikey for translation :) I hope to see you in manga.sk forums :D

Post Reply

Who is online

Users browsing this forum: Jackkel Dragon, Nikel, rayminator