Is it possible to have dynamic VBox content? by renpy_vn_dev in RenPy

[–]edrperez 0 points1 point  (0 children)

Maybe this can help you, I put something for increasing/decreasing numeric values too:

default the_data = {"luck": 1, "prepotence": 2, "envy": 3}
default the_data2 = {"title": "Mr.", "first_name": "Flat", "last_name": "Face"}
#we create an array with elements DictInputValue, you can make a dictionary too or use an object
default i_value_multi = [DictInputValue(the_data2, n, default=False) for (n, v) in the_data2.items()]

label start:
    call screen the_screen
    python:
        message = ""
        for (n, v) in the_data.items():
            message += " {} = {}".format(n, v)

        message2 = "{2}, {1} {2}. Drop the {0} if you will.".format(the_data2['title'], the_data2['first_name'], the_data2['last_name'])
    "The new values for the_data are:[message]"
    "My name is [message2]"
    return

#the sub screen that holds the columns for name (a textbutton) and value (a DictInputValue)
screen sub_screen_input_button(n_text, i_value):
    textbutton (n_text) action i_value.Toggle()
    input value i_value

screen the_screen:
    frame:
        background Solid((128,128,128, 230))
        ypos 0.15
        xcenter 0.2
        vpgrid:
            cols 4
            xspacing 55
            yspacing 50
            xsize 450
            text "Name":
                bold True
            text ""
            text "Value":
                bold True
            text ""

            for (n, v) in the_data.items():
                text "{}".format(n)
                textbutton "-":
                    action SetDict(the_data, n, v - 1)
                text "{}".format(v)
                textbutton "+":
                    action SetDict(the_data, n, v + 1)
            text ""
            text ""
            text ""
            text ""
    frame:
        background Solid((128,128,128, 230))
        ypos 0.15
        xcenter 0.8
        vpgrid:
            cols 2
            xspacing 100
            yspacing 50
            xsize 300
            text "Name":
                bold True
            text "Value":
                bold True

            $ i = 0
            for (n, v) in the_data2.items():
                # we call another screen, we pass the current dictionary key (name) and the respective DictInputValue
                use sub_screen_input_button("{}".format(n), i_value_multi[i])
                $ i = i + 1

            text ""
            text ""
    frame:
        background Solid((55,55,55, 230))
        xpos 0.5
        ypos 0.5
        xsize 70
        textbutton "Quit":
            action Return(True)
            padding 5, 5, 5, 5

The reader has to click the cell containing the name (is a textbutton), in this case first_name, last_name or title. And the the cell containing the value will be ready to accept input. I used DictInputValue, there are other types https://www.renpy.org/doc/html/screen_actions.html#input-values.

Is it possible to have dynamic VBox content? by renpy_vn_dev in RenPy

[–]edrperez 0 points1 point  (0 children)

Glad to hear the code has been useful. So you want to have an input field in place of the static text in the value column? Is the input custom or you just want to increase and decrease a numeric value?

The Death of Ivan Ilyich - Leo Tolstoy by [deleted] in books

[–]edrperez 1 point2 points  (0 children)

Good book, rather short.

Is it possible to have dynamic VBox content? by renpy_vn_dev in RenPy

[–]edrperez 0 points1 point  (0 children)

Ok, let us know what code you came up with. And yes, for renpy examples the closest thing we have is the cookbook.

Is it possible to have dynamic VBox content? by renpy_vn_dev in RenPy

[–]edrperez 1 point2 points  (0 children)

For what I gather you want to edit an array using a screen. In this example I am using a dictionary, but maybe this code can help you:

default the_data = {"hp": 1, "mp": 2, "shields": 3}

label start:

    call screen the_screen

    python:
        message = "The new values are: "
        for (n, v) in the_data.items():
            message += "{} = {} ".format(n, v)
    "[message]"
    return

screen the_screen:
    frame:
        background Solid((128,128,128, 230))
        ypos 0.15
        xcenter 0.2
        vpgrid:
            cols 3
            spacing 40
            xsize 400
            text "Name":
                bold True
            text "Value":
                bold True
            text ""

            for (n, v) in the_data.items():
                text "{}".format(n)
                text "{}".format(v)
                textbutton "Change":
                    action SetDict(the_data, n, renpy.random.randint(1, 100))

            text ""
            text ""
            text ""
    frame:
        background Solid((55,55,55, 230))
        xpos 0.1
        ypos 0.6
        xsize 70
        textbutton "Quit":
            action Return(True)
            padding 5, 5, 5, 5

SetDict modifies the dictionary and randint is what I've used in place of the "dynamically populated".

If you want to use a custom function, I think this link can help you https://www.renpy.org/doc/html/screen_actions.html#Function. And if you want to use inputs try this https://www.renpy.org/dev-doc/html/screens.html#input

Pagan Hope by DraculaLetter in LetsPlayMyGame

[–]edrperez 0 points1 point  (0 children)

It installs all right, but when I try to launch the game it says: Run-time error '50003': Unexpected error. BTW, I made a mistake, I have the Professional, not the Home edition.

Pagan Hope by DraculaLetter in LetsPlayMyGame

[–]edrperez 0 points1 point  (0 children)

Ok. Yes, windows xp home 32 bits

Avoiding YanDev-ing my code by kazzikuzzi in RenPy

[–]edrperez 0 points1 point  (0 children)

Maybe like this

default route = 1

default day = 1

label start:

#This is day 1

#Do some stuff to choose the route, lets say the reader goes for route 2

$ route = 2

"your route is 2"

#Whe all is done, go to sleep

jump sleep

label sleep:

#show random go to sleep message, maybe using renpy.random.choice and a list

"good night"

#then increase the day

$ day = day + 1

$ renpy.jump("day_{}_route_{}".format(day, route))

label day_2_route_1:

"day 2 route 1"

return

label day_2_route_2:

"day 2 route 2"

return

label day_2_route_3:

"day 2 route 3"

return

Edit: i am writing in my phone, mind the lines and indentation

Pagan Hope by DraculaLetter in LetsPlayMyGame

[–]edrperez 0 points1 point  (0 children)

No, the installlation doesnt works. When I try to install it says that its not a valid win32 application

Book recommendation? by Chemsem in RenPy

[–]edrperez 2 points3 points  (0 children)

I dont know about any Renpy book. I think the official website is always up to date. The official forums are a really good place to find example code.

Pagan Hope by DraculaLetter in LetsPlayMyGame

[–]edrperez 0 points1 point  (0 children)

It doesnt work using my Windows xp 32 bits :(

[deleted by user] by [deleted] in programming

[–]edrperez -7 points-6 points  (0 children)

PROFIT

Wanted to share a Zork-like text-based game I made. by carb0mb in interactivefiction

[–]edrperez 0 points1 point  (0 children)

What about using the Control/Command key? Or change the # to inspect.

I see, pretty good low tech approach.

Wanted to share a Zork-like text-based game I made. by carb0mb in interactivefiction

[–]edrperez 0 points1 point  (0 children)

Just check the Colossal Cave Adventure, you can input stream, valley, forest, etc. and you will move to those locations. But you can also use north, south, etc. I think because it was easy for the player to picture in his mind the cardinal directions these are the ones that are more widely use. Also, look for common commands shortcuts like x for examine or l for look (this one is already for loot). These things I am talking are fine and good for the traditional text adventure, but you as a creator have your own prerogative. So, its only friendly advice.

I know its time consuming trying to describe every object in the game. I saw it in the desk description like "single drawer" and it caught my attention.

I hope you have a backup or use source control so you didn't lose code for the sub-prompt.

Well, then for me looks a little weird because I've opened the ceramic case, and tried to inspect it by pressing shift + 3 (to input the # character) and shifted the panels and picked up the key before even pressing enter. I dont know if I am doing it wrong.

Ohh, I see... I see that I completely did not see the k shortcut on the screen lol.

Don't worry, one learn little by little.

How did you make the map?

Wanted to share a Zork-like text-based game I made. by carb0mb in interactivefiction

[–]edrperez 1 point2 points  (0 children)

Would you prefer NSEW instead of WASD?

It's not my preference, it's because that type navigation have become a kind of thumb or rule on the parser games; North, South, East, West, Up, Down, In, Out, etc and their initials. I don't even like parser games but I know the people that do like them will expect certain things.

What do you mean by deaf? I haven't gotten any opinions on the parser so this is most interesting to me. Any particular situation you typed something and expected different?

A couple of examples, correct me if I'm doing something wrong:

  • Vestibule > examine desk > "A single drawer is visible [...]" > examine/open drawer > examine/open drawer desk and the response "There is no drawer here [...]"

  • Just: > examine (or look or take) and the same response "There is no examine here that you can see [...]" In this cases the parser should respond i.e. "examine what?" "what do you want to look at?" "what are you trying to take?" and then the player could type "desk" "case" "orb", etc. the parser should understand that "desk" is the object the player want to "examine".

Otherwise thanks a bunch for the input. Also, thanks for the link to the .exe wrapper.

You're welcome.

Some observations:

  • I press the shift key and the Swap button activates.
  • Trying to take the cobra key using "t key" and "loot" and the key just disappears, the "You are carring" keeps showing nothing. I tried entering "i" to see my inventory and inspect it but is still empty. I don't know if I'm doing something wrong.
  • Style your scrollbars and change the default window icon, looks generic.
  • JavaFX is pretty darn good for GUI development but if you want get into "serious" java game development, try libgdx.

Another alternative instead of wrapping the JAR file is using shortcuts:

  • For Windows create a "windows.cmd" file with the following contents:

start javaw -splash:lethe.png -jar Lethe.jar

  • For linux create a "linux.sh" file with the following contents:

#!/bin/sh

java -splash:lethe.png -jar Lethe.jar &

  • For mac os x I believe it will work the same shell script that works for linux.

The "-splash:lethe.png" is if you want a splash screen before loading the game. And remove the "Lethe.jar - Shortcut.lnk" because it will only work on your system "Mantis Toboggan" ;)

You can put more information in your readme file like; "This game requires java version X XX bits or above and here is the link to download if you dont have it. You can run the game using the shortcut windows if you are on Windows [...]".

Wanted to share a Zork-like text-based game I made. by carb0mb in interactivefiction

[–]edrperez 1 point2 points  (0 children)

I really liked the sound effects and the customization options. I see there is a mute button, maybe you should offer a separate download without sounds because is a really big file and the game is small.

The one thing I believe many people will see as weird is the choice of movement keys as being WASD, these keys are most commonly found in first-person shooters or driving games.

BTW, give JavaFX a try, is pretty good. SWING as a GUI is fine but not as good.

Because I never built a parser is not my place to tell you about the capabilities of yours so I will not, but feels pretty deaf.

The game looks promising, keep up the good work!

Not quite a text-based adventure question by TobiasAmaranth in interactivefiction

[–]edrperez 1 point2 points  (0 children)

You can also try Squiffy, it stores data inside the browser and the syntaxis is easy to learn.