Page 7 of 7

Re: Dungeon Crawl RPG Framework

Posted: Thu Jul 13, 2017 8:44 am
by ComputerArt.Club
Thank you for this amazing piece of code! I have found it extremely useful! Extremely gracious of you. :)

I encountered a few issues when I tried to implement the script, some of which I solved, others I am still trying to resolve.

My current issue is that after a battle, no matter what the outcome, the story continues - i.e. it is not resetting the game in the event of the character's death. There are no errors being raised. Furthermore, the "Gameover" text is not being rendered either. I want some game over text and then to return to the main menu.

I think that this is the relevant section of code. I have tried changing a few things, also tried adding some narration, but I guess it can't be added there. I also changed the code for hiding the say window as it wasn't working either and I have removed the escape outcome as I am doing something a little different with escape.

Does anyone any ideas or did you have similar issues?
Also, the battles are being called from the "script" file, not the dungeon file. I have not needed a dungeon yet, instead I have battles at key parts of the story.

Code: Select all

    
    # Result
    if _return is "lose":
        #next line hidden as it didn't work  
        #narrator ("You died!")
        #next line is not rendering but has been left in as it may have an important role in the function.
        "Gameover"
        $ renpy.full_restart()
        return
    elif _return is "win":
        "You won"
    elif _return is "escape":
        #next line hidden as it didn't work.
        #narrator ("You escaped!")
        "You escaped"
    hide screen battle_ui
    window show
    #next line hidden as it was not working. Replaced with the above line.
    #show screen screens.say
    $ _rollback=True
    return
    
label _battle(player, enemy):
    # A sub label used in the battle label.
    
    while True: 
        $ player.skill = renpy.call_screen("command_screen")
        $ enemy.skill = renpy.random.choice(enemy.skills)
        #next line hidden as I am using escape differently but I may want to use it or alter it later.
        #if player.skill.type=="escape": 
            #return "escape"
        $ player.attack(player.skill, enemy)
        if enemy.hp < 1:  
            return "win"
        $ enemy.attack(enemy.skill, player)
        if player.hp < 1:
            return "lose"
Thanks again for this!

Re: Dungeon Crawl RPG Framework

Posted: Tue Jul 18, 2017 2:59 am
by ComputerArt.Club
Natalie helped me and solved the problem.

Code: Select all

if _return is "lose":
should be

Code: Select all

if _return == "lose"
Hope this helps someone else too!

Thanks again!

Re: Dungeon Crawl RPG Framework

Posted: Tue Jul 18, 2017 4:19 am
by CalixtheGreat
Going to try this. Maybe I can add this to my game soon. :D

Re: Dungeon Crawl RPG Framework

Posted: Sun Jul 30, 2017 4:18 am
by Luxliev
I've mentioned no clip issue before. If anyone wants to fix it change line:

Code: Select all

if front1.stage.map[front1.y][front1.x] is not "1":
to:

Code: Select all

if front1.stage.map[front1.y][front1.x] != "1":
it is in dungeon.py file

Re: Dungeon Crawl RPG Framework

Posted: Fri Jan 05, 2018 7:20 am
by RustyXXL
Image

Started making my first game using this framework.
Those are temporary assets, prerendered in daz...quality is far from production quality. ;)
I also modified the code to calculate 5 steps. As a result Ihad to go 1 further to the left & right to allow more than 1 wide corridors.
I'll also probably add suport for multiple wall variations, so they don't look quite as boring. I'd also like to split up the floor and ceiling for at least the closest 1 or 2 steps into blocks, so I can do some more stuff with them, and also probably add support for some decorations like pillars etc....

In any case, thanks for your ground work. Sped things up considerably :)

Re: Dungeon Crawl RPG Framework

Posted: Sun May 27, 2018 11:57 am
by Hseo
Nvm, already been mention

Re: Dungeon Crawl RPG Framework

Posted: Sat Jun 09, 2018 5:42 pm
by hyperionthunder
What is the best way to impliment a visible exit, say a gate in place of a wall texture?
My test grid looks like this:

Code: Select all

# "4" means exit to continue, "3" means key, "2" means entrance, "1" means wall, "0" means path.
forestgarden=Stage([
            "1111111111",
            "1111114001",
            "1300011101",
            "1111011001",
            "1000010001",
            "1110111101",
            "1000000001",
            "1010111111",
            "1010000001",
            "1211111111"
            ],
            key="gardenkey",
            enemy=maze_encounter_list)
i have images stored as gateleft2, etc.
i tried to get it to draw different image using this but no dice:

Code: Select all

for i in ["left2", "right2", "front2", "left1", "right1", "front1", "left0", "right0", "gateleft2", "gateright2", "gatefront2", "gateleft1", "gateright1", "gatefront1", "gateleft0", "gateright0", "key"]:
                try:
                    j=globals()[i]
                    if j.stage.map[j.y][j.x]=="1":
                        renpy.show(i)
                    if j.stage.map[j.y][j.x]=="2":
                        renpy.show(i)
                    if j.stage.map[j.y][j.x]=="3":
                        renpy.show(i)
                    if j.stage.map[j.y][j.x]=="4":
                        renpy.show(i)
                except:
                    pass
also i find that whenever the player faces left (west) the event triggers instead of what's directly in front of them when the step on the tile, such as a key
How can I fix that?

[solved] Re: Dungeon Crawl RPG Framework

Posted: Mon Jun 11, 2018 3:47 pm
by hyperionthunder
I solved the issue about displaying different texture based on the different values on the grid.

however I ran into a separate problem in the way the map reports the location of the player. It seem to be reporting the location of the cell directly to the right of the player, not on top of the player's cell. So all the events i wanted to trigger, the player has to face left from that cell to trigger it. is there a workaround to get this to work correctly (as in, the player facing the intended direction to trigger such events?)

edit: turns out the solution is easy:

i found the solution from another forum: viewtopic.php?t=44910

turns out using

Code: Select all

 if here.stage.map[here.y][here.x] == event
works like a charm

Re: Dungeon Crawl RPG Framework

Posted: Thu Sep 06, 2018 10:10 am
by hyperionthunder
I am considering having multiple dungeons and i wish to reuse part of the code.

How do i go about having looks and images for each dungeon?

Re: Dungeon Crawl RPG Framework

Posted: Sun Sep 22, 2019 4:55 am
by orangejuice
Hello, nyaatrap, thank you so much for the framework code, this is a very insightful thread!! ^^

I do have a question regarding the battle system, is there any way I could add a leveling system as well as adding party members to your battle system (like for instance, you could have one party member at the start of the game but add more later)? I've been using this code viewtopic.php?f=51&t=18047&start=15#p395926 for turn based battles but it is without a leveling and party system and just overall limited, but the overall UI, after some adjustments, is ideal for me. though I'm not sure how to best implement/replace the battle system in the codes you provided without doing a lot of trial and error and frankenstein-ing codes.

I am no expert coder by no means, in fact, I'm completely new to this!! So I figured I should ask what would be best to have both this UI and this dungeon code work as one, as well as having that leveling and party system ... Thank you again and sorry if this was already kinda answered in this thread, it's so easy to get lost in code ahhh!!