Tonnyx Member Posts: 140 From: Indiana, USA Registered: 08-02-2005 |
I'm trying to tweak the Bible Dave code to do a project for a friend from the CGDC, and Clint is currently in L.A. doing a job interview. I can't exactly ask him right now. ![]() I am doing a pretty basic level that focuses just on jumping, and dodging guavas. I would like it so that, if self.num_bibles < 3, then you can't exit. I've gotten that part down so far, but when the character hits the exit trigger, he keepts getting the message again and again, until, ever so slowly, he makes it to the next square. In pseudocode, that part looks something like this: exit Trigger: If you couldn't tell, I actually don't "know" any python, or pygame stuff. I can edit levels, and add dialogs if I have some example code, but that's about it. Thanks in advance. ------------------ |
|
samw3![]() Member Posts: 542 From: Toccoa, GA, USA Registered: 08-15-2006 |
I'm sure Joe should be the one answering this. Maybe this post should be taken as a recommendation for the Bible Dave engine. Three ways I can think of to fix it: ------------------ |
|
Xian_Lee![]() Member Posts: 345 From: Registered: 03-15-2006 |
I haven't looked into the Bible Dave code, but I can do that tonight. I was trying to find something on my fifteen minute lunch break, but that finished too soon. Hopefully someone who worked on the project can help you, but I'll look into it tonight if necessary. ------------------ "He who walks in integrity walks securely, |
|
Tonnyx Member Posts: 140 From: Indiana, USA Registered: 08-02-2005 |
Hmm. Unfortunately Joe (I'm assuming you mean Joe Q.), is on his way to a missions conference right now and won't be back until Sunday. Do you know how to implement those suggestions that you mentioned? As I said, I know no python, and I'm not familiar with the Bible Dave code, so I haven't the faintest clue how to go about any of that. Thanks for your input! Anyone want to take it up from here? ------------------ [This message has been edited by tonnyx (edited March 03, 2007).] |
|
samw3![]() Member Posts: 542 From: Toccoa, GA, USA Registered: 08-15-2006 |
I've downloaded the source, what file are you adding to? A level.py? Can you post or pm me your code? ------------------ |
|
samw3![]() Member Posts: 542 From: Toccoa, GA, USA Registered: 08-15-2006 |
I hope this works. I don't have a python interpreter on this system.
------------------ |
|
Xian_Lee![]() Member Posts: 345 From: Registered: 03-15-2006 |
Sorry I wasn't able to get to this last night. I saw Sam's post, thought it good, and reduced the priority I placed on looking into this. Anyway, like I said, Sam's code looks good. I'm just going to throw a few ideas in that reflect my understanding of what you want. I haven't tested this code, so I don't know that it will actually work, but it should work in theory. <BLOCKQUOTE><table width=80% border=0 bgcolor="#FFFFF" CELLPADDING="2" CELLSPACING="2"><TR><TD><font size="3" face="Courier" color="#000000"><pre> /* I don't know if "/*" is valid in Python, but I mean to indicate that, # Modify OnExit as follows I don't know the specifics regarding the name of the player object, so that would be necessary for putting in place off "dave" above. I'm not sure what the BiblesCollected counter is actually called, so that would be a necessary fix. However, I think that this should more or less do what it is you want it to. Good luck! EDIT: HTML is not enabled for me, so the formatting didn't carry over. Sorry about that. I'll leave the HTML in place in case you want to paste it somewhere and view it as it should be. ------------------ "He who walks in integrity walks securely, [This message has been edited by Xian_Lee (edited March 03, 2007).] [This message has been edited by Xian_Lee (edited March 03, 2007).] |
|
Jari![]() Member Posts: 1471 From: Helsinki, Finland Registered: 03-11-2005 |
In addition to above suggestion here's yet another way to do it, using two triggers:
When dave enters trigger #1 the dialog is displayed once if he doesnt have enough bibles. And when he enters trigger #2 he is being sent to the next level if he has at least 3 Bibles
[This message has been edited by jari (edited March 03, 2007).] |
|
Tonnyx Member Posts: 140 From: Indiana, USA Registered: 08-02-2005 |
Wow, guys, thanks so much for all your help! The prize goes to Xian_Lee for implementing something I could understand. All the ideas were great, though. I think if Clint were implementing this, he'd use Jari's code, but I have to confess I didn't quite understand it. This is what happens when you try to tweak code in a language and a program you don't know much about. ![]() g.player.rectx, self.player.rectx, g.player.rect.x, and so on, until it turned out that what I needed was self.player.rect.x Hooray! Samw3, thanks for the quick response, and your willingness to help. That was really encouraging, just to know that somebody was willing to think about it and offer ideas. I was feeling pretty desperate yesterday, and it helped to have something to wrestle with, rather than thrashing blindly. You guys are awesome. ------------------ [This message has been edited by tonnyx (edited March 03, 2007).] |
|
Xian_Lee![]() Member Posts: 345 From: Registered: 03-15-2006 |
Awesome. I'm glad to have been of some help. I've only briefly toyed with Python and PyGame. Honestly, I don't like the formatting of Python (in that there are no braces, and that indentation is what determines what code belongs to which if/while, function, class, etc.), but I definitely can see its usefulness and ease of use with a little practice. Anyway, it sounds like you managed to get something to work for your modifications, yes? That's what's important. Well, again, I'm glad to have offered my services, limited and derivative of Sam's work as they may have been. ------------------ "He who walks in integrity walks securely, |