Dungeon Crawl RPG Framework

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
Eiliya
Regular
Posts: 148
Joined: Tue Dec 04, 2012 6:21 am
Contact:

Re: Dungeon Crawl RPG Framework 2.0

#76 Post by Eiliya » Wed Mar 19, 2014 12:20 pm

Quick question, am I allowed to use this for commersial projects?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1849
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: Dungeon Crawl RPG Framework 2.0

#77 Post by Donmai » Wed Mar 19, 2014 2:16 pm

Eiliya wrote:Quick question, am I allowed to use this for commersial projects?
Quick answer :wink:
nyaatrap wrote:This framework is in the public domain.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Eiliya
Regular
Posts: 148
Joined: Tue Dec 04, 2012 6:21 am
Contact:

Re: Dungeon Crawl RPG Framework 2.0

#78 Post by Eiliya » Thu Mar 20, 2014 6:21 am

I will assume that means yes :-)

Never mind the spoiler, I got it to work after playing around abit with it.
Here's another question, then.

I've created my dungeon (using placeholder images cause I suck at drawing) and I'd very much like to combine this with Jakes Battle Engine. More specifically, I would like the random encounters in my dungeon (which has been created from this framework) to connect with the Active Time Gauge type of battle from Jakes Engine.

Here's my coding. The first one is basically just the original script from this thread, with a remade map and the battle-tag calling a different label. I want it to generate random encounters of dwarves, but I get no encounters at all T_T.

Code: Select all

label start:
    
    python:

        attack = Skill("Attack", "attack", 70, 20)
        escape = Skill("Escape", "escape")

        hero = Actor("Hero",100, [attack,escape])
        goblin = Actor("Goblin",40, [attack])

        woods=Stage([
            "11111111111111111111",
            "11000010000111101111",
            "11010000000001100011",
            "11011000000001111001",
            "10010000000000111101",
            "11110000111110001101",
            "11110000111110000001",
            "11111000111110000111",
            "11111000110110000111",
            "11111110000000010111",
            "11111111110111110011",
            "11111100000101111011",
            "11111101011100000011",
            "11111000001111100001",
            "11111011100010101101",
            "11111011111010000101",
            "11100011111011111101",
            "11101111111000001101",
            "11101111111111001101",
            "11111111111111111111",
            ])
            
    $ here=Coordinate(woods,8,10,1,0) 
    call dungeon
    call random_woods_battle
Here's the code for the random encounter generator, incase something is wrong here.

Code: Select all

label random_woods_battle:
    $ d100 = renpy.random.randint(1, 100)
    if d100 >= 15:
        call woods_dwarf1
    elif d100 =< 70:
        call woods_dwarf3
    else:
        call woods_dwarf2
        
label woods_dwarf1:
    
    # I know these work and I have all the relevant engine-scripts, so I cut this out to save space in my post.

    return
    
label woods_dwarf2:
    
    # I know these work and I have all the relevant engine-scripts, so I cut this out to save space in my post.

    return
    
label woods_dwarf3:
    
    # I know these work and I have all the relevant engine-scripts, so I cut this out to save space in my post.
    
    return

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Dungeon Crawl RPG Framework 2.0

#79 Post by nyaatrap » Thu Mar 20, 2014 8:25 pm

in the dungeon.rpy,

Code: Select all

        # Check events. If it happens, call a label or jump out to a label.
        if here.stage.enemy is not None and renpy.random.random()< .2:
            call battle(player=hero, enemy=here.stage.enemy)
is the lines where a battle label is called inside of dungeon crawling. Rewrite this statements.

Eiliya
Regular
Posts: 148
Joined: Tue Dec 04, 2012 6:21 am
Contact:

Re: Dungeon Crawl RPG Framework 2.0

#80 Post by Eiliya » Sat Mar 22, 2014 9:32 am

Thanks, Nyaatrap :-)

Can I ask something else? Let's say I wanted a tile in the dungeon to lead out of the dungeon, or maybe have a special event on it. How do I code that?

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Dungeon Crawl RPG Framework 2.0

#81 Post by nyaatrap » Tue Mar 25, 2014 10:37 am

There are several ways to do it.
One simple example is layout "x" instead of "0" on the map, then add a following line on the dungeon.rpy:

Code: Select all

if here.stage.map[here.y][here.x] == "x":
    jump label_x_event

Eiliya
Regular
Posts: 148
Joined: Tue Dec 04, 2012 6:21 am
Contact:

Re: Dungeon Crawl RPG Framework 2.0

#82 Post by Eiliya » Tue Mar 25, 2014 5:41 pm

nyaatrap wrote:There are several ways to do it.
One simple example is layout "x" instead of "0" on the map, then add a following line on the dungeon.rpy:

Code: Select all

if here.stage.map[here.y][here.x] == "x":
    jump label_x_event
It's really late here right now, but I will take a look at this tomorrow and see if I can get it to work. Thanks alot for the feedback :-)

JaxxyLupei
Regular
Posts: 30
Joined: Tue Apr 08, 2014 10:34 pm
Projects: Dance With Me? (A date sim)
Location: NY
Contact:

Re: Dungeon Crawl RPG Framework 2.0

#83 Post by JaxxyLupei » Thu Jul 17, 2014 10:07 pm

Is there a way to use the battle system minus the dungeon crawler aspect? I'm working on a date sim where there are fighting scenes during some bits.

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: Dungeon Crawl RPG Framework

#84 Post by DaFool » Tue Feb 17, 2015 2:26 pm

I was able to add more depth to the dungeon by using right3, left3, front3 since I felt the dungeon kinda felt wonky without being able to see more than two corridors down.

Code: Select all

label dungeon:
    # To start exploring, call or jump to this label
    # To exit, create an event which has return or jump statement.
    
    while True:
        # Calculate relative coordinates
        python:            
            turnright=Coordinate(here.stage, here.y,here.x, here.dx,-here.dy)
            turnleft=Coordinate(here.stage, here.y, here.x, -here.dx,here.dy)
            turnback=Coordinate(here.stage, here.y,here.x, -here.dy,-here.dx)
            right0=Coordinate(here.stage, here.y+here.dx,here.x-here.dy, here.dy,here.dx)
            left0=Coordinate(here.stage, here.y-here.dx,here.x+here.dy, here.dy,here.dx)
            front1=Coordinate(here.stage, here.y+here.dy,here.x+here.dx, here.dy,here.dx)
            right1=Coordinate(here.stage, front1.y+front1.dx,front1.x-front1.dy, here.dy,here.dx)
            left1=Coordinate(here.stage, front1.y-front1.dx,front1.x+front1.dy, here.dy,here.dx)
            front2=Coordinate(here.stage, front1.y+front1.dy,front1.x+front1.dx, here.dy,here.dx)
            right2=Coordinate(here.stage, front2.y+front2.dx,front2.x-front2.dy, here.dy,here.dx)
            left2=Coordinate(here.stage, front2.y-front2.dx,front2.x+front2.dy, here.dy,here.dx)    
            front3=Coordinate(here.stage, front2.y+front2.dy,front2.x+front2.dx, here.dy,here.dx)
            right3=Coordinate(here.stage, front3.y+front3.dx,front3.x-front3.dy, here.dy,here.dx)
            left3=Coordinate(here.stage, front3.y-front3.dx,front3.x+front3.dy, here.dy,here.dx)  
            
               
        # Composite background images. Try-except clauses are used to prevent the List Out of Index Error
        scene
        show floor
        python:
            for i in ["left3", "right3", "front3", "left2", "right2", "front2", "left1", "right1", "front1", "left0", "right0"]:
                try:
                    j=globals()[i]
                    if j.stage.map[j.y][j.x]=="1":
                        renpy.show(i)
                except:
                    pass
I even got strafing to work

Code: Select all

        if right0.stage.map[right0.y][right0.x] is not "1":        
            textbutton ">" action Return(value=right0) xcenter .8 ycenter .5
        if left0.stage.map[left0.y][left0.x] is not "1":        
            textbutton "<" action Return(value=left0) xcenter .2 ycenter .5
though it turns out the JP PC dungeon crawlers just use 4 keys unintuitively.

Now, this code is simply brilliant and I only got to use it now but it's just so nice and simple.

EDIT: Got keymap to work, it's so simple!

Code: Select all

#don't forget to disable screenshot using     $ config.keymap['screenshot'].remove('s')

screen move:
    # Screen which shows move buttons and a minimap 
    
    fixed style_group "move":
        if front1.stage.map[front1.y][front1.x] is not "1":
            textbutton "↑" action Return(value=front1)  xcenter .5 ycenter .4
        textbutton "→" action Return(value=turnright) xcenter .6 ycenter .5
        textbutton "↓" action Return(value=turnback) xcenter .5 ycenter .6
        textbutton "←" action Return(value=turnleft) xcenter .4 ycenter .5

        if front1.stage.map[front1.y][front1.x] is not "1":
            key "w" action Return(value=front1)
        key "d" action Return(value=turnright)
        key "s" action Return(value=turnback)
        key "a" action Return(value=turnleft)
I would really, really like to be able to use alternate wall tiles and have the dungeon remember them. Just purely aesthetics. But the dungeon remembers only whole blocks, not individual wall panels.

Jamiefox234
Newbie
Posts: 5
Joined: Mon Jan 11, 2016 9:11 pm
Tumblr: None
Deviantart: None
Github: None
Skype: None
Soundcloud: None
Contact:

Re: Dungeon Crawl RPG Framework

#85 Post by Jamiefox234 » Fri Jan 15, 2016 1:32 pm

Hi im new to renpy, I just wanted to know how to would create multiple enemies in one area, like final fantasy for example, or just encounter different enemies besides a goblin. Also can you explain in full detail how to set up the events in the dungeon, because I set x in the map, and used the same code you gave in the other post, but the event still does not occur. I just want something like a boss battle to happen in a particular area of the map.

User avatar
Sehaf
Regular
Posts: 49
Joined: Thu Feb 25, 2010 9:22 pm
Projects: Demon Lord & Yuki Academy
Location: Sweden
Contact:

Re: Dungeon Crawl RPG Framework

#86 Post by Sehaf » Tue Mar 29, 2016 2:49 am

So, regarding the "is it allowed to use in commercial game" question is still not really that answered as not everyone knows the exact extent of 'public domain'.
(Nor did a google search really answer my question either other then that is is free to use. but not outside the scope of for own use.)

Though my real question is a bit more topic related, as I try to use the code, I only get an error saying:

[code]
While running game code:
File "game/script.rpy", line 6, in script
python:
File "game/script.rpy", line 26, in <module>
enemy=goblin)
TypeError: __init__() got an unexpected keyword argument 'enemy'[/code]

After looking around a bit I have found that this is a compability issue with another skript of phyton that I use, though I do not know how to work around it as I do not know of where exactly the issue lie.


ignore the tiny text, found the problem and fixed it.
I'm a GameMaker!
My Portfolio: http://www.bluepipestudio.com

era27
Newbie
Posts: 6
Joined: Thu May 12, 2016 5:52 am
Contact:

Re: Dungeon Crawl RPG Framework

#87 Post by era27 » Thu May 12, 2016 5:57 am

Hi, thanks for this. I am having fun playing around with it.

However, I am having an issue with it. I want to copy the "dungeon" and "battle" scripts into my came so that I can incorporate them into my visual novel. For example, the player chooses to enter a cave, and then dungeon is called.

The dungeon loads just fine, but as I walk through the dungeon, the battle script never gets called. I have copied the relevent code from script.rpy into my script.rpy and moved dungeon.rpy and battle.rpy into my folder. Is there something I am missing that enables the battle.rpy to be called at random?

Thanks

User avatar
Matala
Newbie
Posts: 1
Joined: Fri Sep 25, 2015 6:11 pm
Completed: OCD Dungeon Explorer, Dashing Paladin
Projects: Harsh Winter
Organization: Lab 8-13
Contact:

Re: Dungeon Crawl RPG Framework

#88 Post by Matala » Tue Jul 26, 2016 5:53 am

Question!
I'm trying to make something of a visible exit with this code and was wondering what might be the best way of getting that to work.

What I've currently got:

for i in ["front3","left3","right3", "left2", "right2", "front2", "left1", "right1", "front1", "left0", "right0"]:
try:
j=globals()
if j.stage.map[j.y][j.x]=="1":
renpy.show(i)
elif j.stage.map[j.y][j.x]=="2":
renpy.show("exit2")

And the map is setup up as such:

stage1=Stage([
"11111111111",
"11111011x01",
"11000000001",
"11110111101",
"2w000000001",
"11111111111",
],
)

The x and the w are just event markers. x is a treasure and w is the trigger to get players out of the dungeon.
I feel like I'm missing something simple here but I just can't quite seem to get what I'm missing, haha.

BinaryLion
Newbie
Posts: 1
Joined: Thu Feb 25, 2016 5:22 pm
Contact:

Re: Dungeon Crawl RPG Framework

#89 Post by BinaryLion » Sat Oct 29, 2016 7:25 pm

Thank you very much ! With your framework I started to make RPG, inspired by old Might and Magic and Shin Megami Tensei games. But sorry, currently it is so short and text only in Russian - but I want to make version in English language in future.

To Matala: "exit2", even if you named it like this, is just one picture, so you will get same look of that exit from near or far distances. Try to make different pictures of exit or use Transform to be sure that exit will be look as it should be from different PoVs.
Attachments
rpg2.png
Screenshot of crawler
rpg.png
Screenshot of battle

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

Re: Dungeon Crawl RPG Framework

#90 Post by Luxliev » Tue Jun 06, 2017 2:58 pm

Wonderful framework.

There is one bug in Ren'py version 6.99.12.
You can get wall hack (you can move through walls and all arrows are available even though you're facing a wall). I don't know what triggers it.
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

Post Reply

Who is online

Users browsing this forum: No registered users