Search found 99 matches

by Human Bolt Diary
Sat Feb 01, 2014 3:15 am
Forum: Ren'Py Questions and Announcements
Topic: Best way to sort a list?
Replies: 19
Views: 2251

Re: Best way to sort a list?

Here's a modified example that removes the need for "while True:", but I'm afraid I don't know quite enough about the consequences of "renpy.restart_interaction()" to say if this is correct. It's not correct and while loop is not required for this class to work in any way or form. It was there to p...
by Human Bolt Diary
Fri Jan 31, 2014 8:30 pm
Forum: Ren'Py Questions and Announcements
Topic: Best way to sort a list?
Replies: 19
Views: 2251

Re: Best way to sort a list?

Here's a modified example that removes the need for "while True:", but I'm afraid I don't know quite enough about the consequences of "renpy.restart_interaction()" to say if this is correct. init python: from random import shuffle from copy import copy class SortContainer(Action): """ Sorts an itera...
by Human Bolt Diary
Fri Jan 31, 2014 3:41 pm
Forum: Ren'Py Questions and Announcements
Topic: Best way to sort a list?
Replies: 19
Views: 2251

Re: Best way to sort a list?

init python: from random import shuffle from copy import copy class SortContainer(Action): """ Sorts an iterable container on key parameter. """ def __init__(self, container, key=None): self.container = container self.key = key def __call__(self): for key in renpy.store.__dict__: if renpy.store.__d...
by Human Bolt Diary
Fri Jan 31, 2014 11:53 am
Forum: Ren'Py Questions and Announcements
Topic: Best way to sort a list?
Replies: 19
Views: 2251

Best way to sort a list?

Hi everybody, Let's say I want a button that sorts a list. Would the best way to approach that be something like extending the Action class with python's sorted function: class SortList(Action): def __init__(self, list, *args): self.my_list = list def getKey(self,item): return item def__call__(self)...
by Human Bolt Diary
Wed Dec 04, 2013 11:11 am
Forum: Ren'Py Questions and Announcements
Topic: Saving variables changed in a currently shown screen
Replies: 9
Views: 2968

Re: Saving variables changed in a currently shown screen

How about saving variables in a file? This is rough code, so: Create folder "resources" in "game" and create file "res.dat" inside. Variables are stored as: key value example: val False valentine Purple val_walo Red Keys and Values are placed into a Dictionary and read/written to the file as needed....
by Human Bolt Diary
Mon Oct 28, 2013 3:54 am
Forum: Ren'Py Questions and Announcements
Topic: Top-Down Perspective / Old School RPGs in Ren'Py?
Replies: 1
Views: 688

Top-Down Perspective / Old School RPGs in Ren'Py?

Has anyone tried making a Top-Down game? Now I know this isn't what Ren'Py's designed for, but I've been playing around with Ren'Py's Displayables to create a basic demo. Right now there's movement using the arrow keys, tile-based collision, layers, and a very basic camera. I've tried to annotate th...
by Human Bolt Diary
Sat Oct 19, 2013 9:08 pm
Forum: Ren'Py Questions and Announcements
Topic: help!!! problem with menus label and jumps
Replies: 2
Views: 994

Re: help!!! problem with menus label and jumps

What's on line 511 of your script.rpy?
by Human Bolt Diary
Fri Oct 11, 2013 1:52 am
Forum: Ren'Py Cookbook
Topic: Tile based Sprite Sheets
Replies: 0
Views: 2735

Tile based Sprite Sheets

TileSpriteSheet() is a class to split a large image (the sprite sheet) into a list of smaller images. It requires every sprite to be the same size and spaced evenly on the sheet, making it limited to simple tile based sprite sheets. At some point I may add support for sprites of different sizes and ...