Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Sun May 19, 2013 4:34 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Fri Aug 20, 2010 4:18 pm 
Regular
User avatar

Joined: Wed Jul 07, 2010 5:49 pm
Posts: 188
Location: Pacific Northwest
Completed: Mobile Food Madness, Super Otome Quest
I am making version 1.0 of RenTweet available now that 6.11.0 is official.

Attachment:
Rentweet-1.0.zip [8.25 MiB]
Downloaded 100 times


RenTweet is a framework which is built upon the Tweepy Python library, and allows for Twitter status updates within games. The purpose is to allow players to update their friends about their progress in a game, and at the same time will hopefully help to promote your game and Ren'Py.

As Twitter no longer allows for simple authentication (storing a username and password), this framework uses OAuth to handle authentication. The auth information provided once a user approves the application is stored in a persistent variable. RenTweet is released under the MIT license, which means that you are welcome to use it in your games or modify it as you see fit.

Usage:
RenTweet is only supported with Ren'Py 6.11.0, as it makes use of the new screen functionality.

To play the short Demo included, unzip the RenTweet folder and place it within your Ren'Py projects directory to play it. On the demo game's main menu, you should see a "Twitter Options" menu option where you can configure Twitter (this can also be set up while right clicking during the game). If you have done this, it will prompt you to send a Twitter status update towards the end of the demo.

To utilize the framework in your own games, copy the files listed in the README.txt to your own project's folder and make the necessary adjustments to the rentweet_game_info method.

If you want to register your game as as its own Twitter app, which I highly recommend if you are making a commercial project and/or you make heavy modifications to this code, you must also modify the rentweet_public_keys to use your own API keys.

To send a status update from within the game, simply use the following code:
Code:
$ Rentweet.tweet("<Your Tweet>")

This will automatically check if or not the user is set up for Twitter, and if so, prompt them to permit the update. (They will not see anything if they haven't configured Twitter.)

I am currently looking for feedback and suggestions on any functionality / performance improvements, as well as any bug reports you might have. There are a few things I would like to improve about the Framework in updated releases, but at the moment it is fully functional for basic status updates. I will probably be improving the documentation when I get the chance to be a bit more friendly.

_________________
Don't Blame Me. I Voted for Vermin Supreme.


Top
 Profile Send private message  
 
PostPosted: Fri Aug 20, 2010 11:12 pm 
Miko-Class Veteran

Joined: Fri Dec 16, 2005 5:21 pm
Posts: 621
Location: Canada
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Wow... this could be really useful. Combining this with hashtags and achievements would be really cool.

_________________
Fading Hearts is RELEASED
http://www.sakurariver.ca


Top
 Profile Send private message  
 
PostPosted: Sat Aug 21, 2010 9:21 am 
Megane Procrastinator
User avatar

Joined: Fri Mar 28, 2008 4:54 am
Posts: 3524
Location: Yogyakarta, Indonesia.
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul
Projects: Re:Set Zero, Morpheandir Tales, The Alliance
Organization: Memento-Mori VNs, Team Sleepyhead
Darn, I hope I have twitter. All I have is facebook :D

_________________
ImageImageImage
JESUS CHRIST, GOOGLING HOW TO UNRAR STUFF IS EASIER THAN WAITING FOR 1000 DAYS FOR A REPLY. SRSLY.


Top
 Profile Send private message  
 
PostPosted: Sat Aug 21, 2010 10:28 am 
Regular
User avatar

Joined: Wed Jul 07, 2010 5:49 pm
Posts: 188
Location: Pacific Northwest
Completed: Mobile Food Madness, Super Otome Quest
azureXtwilight wrote:
Darn, I hope I have twitter. All I have is facebook :D


I am considering the possibility of adding Facebook support or making a similar framework for it in the future, but my current focus is on Twitter.

_________________
Don't Blame Me. I Voted for Vermin Supreme.


Top
 Profile Send private message  
 
PostPosted: Sat Aug 21, 2010 11:58 am 
Regular
User avatar

Joined: Thu Apr 16, 2009 9:18 am
Posts: 173
Completed: The Stolen Diamond Ring
Projects: Happy Memories: Azalea Town, Princess Battles
LordShiranai wrote:
I am considering the possibility of adding Facebook support or making a similar framework for it in the future

That would be most appreciated!


I just tried the framework and it looks very promising. However, the demo crashed after launching a browser window and I got this error:
Code:
I'm sorry, but an uncaught exception occurred.

error: Event queue full

While running game code:
 - script at line 784 of renpy-6.11.0/common/00library.rpy
 - python at line 786 of renpy-6.11.0/common/00library.rpy.
 - script at line 18 of C:\renpy-6.11.0\Rentweet/game/rentweet.rpy
 - python at line 27 of C:\renpy-6.11.0\Rentweet/game/rentweet.rpy.
 - python at line 238 of C:\renpy-6.11.0\Rentweet/game/rentweet.rpy.

_________________
Otome Games
Image


Top
 Profile Send private message  
 
PostPosted: Sat Aug 21, 2010 2:47 pm 
Regular
User avatar

Joined: Wed Jul 07, 2010 5:49 pm
Posts: 188
Location: Pacific Northwest
Completed: Mobile Food Madness, Super Otome Quest
Thanks for the report. I have a couple more questions on this area since I can't seem to reproduce this issue:

1. What platform are you running the game from?

2. Did the browser window actually open? (It sounds like it probably didn't.)

3. Were you launching the option from the title screen menu, or within the game (right clicking)?

4. Was this the very first time you tried to configure Twitter? Or had you gone through the game several times, possibly used
rollback, etc.?

5. Also, just to be sure, are you using the released version of 6.11.0?

_________________
Don't Blame Me. I Voted for Vermin Supreme.


Top
 Profile Send private message  
 
PostPosted: Sat Aug 21, 2010 9:23 pm 
Regular
User avatar

Joined: Thu Apr 16, 2009 9:18 am
Posts: 173
Completed: The Stolen Diamond Ring
Projects: Happy Memories: Azalea Town, Princess Battles
LordShiranai wrote:
1. What platform are you running the game from?

Windows XP

LordShiranai wrote:
2. Did the browser window actually open? (It sounds like it probably didn't.)

It did. I even got the PIN.
But the weird part is, RenTweet launched not one but two browsers - Opera and Explorer (Firefox was already running in the background). Nothing happened in Opera (no twitter-related tabs opened), and http://twitter.com/oauth/authorize?oaut ... P0u2oSPZzU opened in Explorer.

LordShiranai wrote:
3. Were you launching the option from the title screen menu, or within the game (right clicking)?

Within the game.

LordShiranai wrote:
4. Was this the very first time you tried to configure Twitter? Or had you gone through the game several times, possibly used
rollback, etc.?
The first time.

LordShiranai wrote:
5. Also, just to be sure, are you using the released version of 6.11.0?
Yes.

_________________
Otome Games
Image


Top
 Profile Send private message  
 
PostPosted: Sat Aug 21, 2010 11:55 pm 
Regular
User avatar

Joined: Wed Jul 07, 2010 5:49 pm
Posts: 188
Location: Pacific Northwest
Completed: Mobile Food Madness, Super Otome Quest
Okay thanks for the info.

Very weird that it is opening multiple browser windows, as the function being called to do it is supposed to open the default web browser on the OS (not all installed browsers) per the Python documentation (http://docs.python.org/library/webbrowser.html). I am not 100% sure that the multiple browser thing is the cause of the problem, or something else entirely.

Since I have yet to reproduce it, I will continue to research this.

_________________
Don't Blame Me. I Voted for Vermin Supreme.


Top
 Profile Send private message  
 
PostPosted: Sun Aug 22, 2010 1:25 am 
Regular
User avatar

Joined: Thu Apr 16, 2009 9:18 am
Posts: 173
Completed: The Stolen Diamond Ring
Projects: Happy Memories: Azalea Town, Princess Battles
LordShiranai wrote:
I am not 100% sure that the multiple browser thing is the cause of the problem, or something else entirely.

Since I have yet to reproduce it, I will continue to research this.

I tried several times, the result was always the same. Then I set Firefox to be the default browser (before it was Opera) and it works now - no crashing, even got "Visited Times Square with Rosa!" posted on my twitter account.
Perhaps the function opening a browser window only has problems with Opera? (Although this still wouldn't explain why did it open Explorer on top of that).

_________________
Otome Games
Image


Top
 Profile Send private message  
 
PostPosted: Sun Aug 22, 2010 9:24 am 
Veteran
User avatar

Joined: Mon May 24, 2010 5:40 am
Posts: 224
Location: Lahore, Pakistan
Projects: Bloodlust Crusade RPG Game
It could be possible that you didn't have a default browser set???

_________________
The true measure of a man is what he does with his power.


Top
 Profile Send private message  
 
PostPosted: Sun Aug 22, 2010 9:27 am 
Regular
User avatar

Joined: Wed Jul 07, 2010 5:49 pm
Posts: 188
Location: Pacific Northwest
Completed: Mobile Food Madness, Super Otome Quest
rinrin wrote:
LordShiranai wrote:
I am not 100% sure that the multiple browser thing is the cause of the problem, or something else entirely.

Since I have yet to reproduce it, I will continue to research this.

I tried several times, the result was always the same. Then I set Firefox to be the default browser (before it was Opera) and it works now - no crashing, even got "Visited Times Square with Rosa!" posted on my twitter account.
Perhaps the function opening a browser window only has problems with Opera? (Although this still wouldn't explain why did it open Explorer on top of that).


I'm glad that you got it to work. It could be an issue with Opera, or could be a messed up default browser setting in the OS somehow. I'm still not sure why it manifested the way it did (filling the error queue), but I will plan on doing some testing with my default browser settings later today to see if I can make the problem reoccur for me and figure out the best fix/workaround.

This is the one area where I would prefer to be using basic authentication for Twitter (which no longer works). Having a user leave the application to go to a web site is annoying, but at the moment I don't seem to have any other option.

_________________
Don't Blame Me. I Voted for Vermin Supreme.


Top
 Profile Send private message  
 
PostPosted: Sat Aug 28, 2010 9:39 am 
Regular
User avatar

Joined: Wed Jul 07, 2010 5:49 pm
Posts: 188
Location: Pacific Northwest
Completed: Mobile Food Madness, Super Otome Quest
Update on the reported crash: I finally did get the chance to reproduce the issue in a VM. It appears that there clearly is a problem with Opera as the default browser in Windows. This crash does not seem to happen for me if any other browser is set to default. It seems that whatever the underlying Python web browser library is doing is causing the event queue to fill, but only with Opera set to the default.

A possible workaround for Opera users:

1. Set IE as the Default Browser.
2. Set Opera BACK to the Default Browser.

After doing this, I have not been able to reproduce the issue again. The issue may be that something is just somewhat off with how Opera sets itself as the default browser in Windows if you set it up during the Opera install. I could be wrong on this, and I am continuing to work out he issue.

_________________
Don't Blame Me. I Voted for Vermin Supreme.


Top
 Profile Send private message  
 
PostPosted: Mon Jun 25, 2012 9:17 pm 
Newbie

Joined: Wed May 25, 2011 12:37 pm
Posts: 7
I got the following error after adding my own API keys. The included ones didn't work, but didn't crash either, help?

Quote:
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/rentweet.rpy", line 18, in script
File "game/rentweet.rpy", line 27, in python
File "game/rentweet.rpy", line 262, in python
AttributeError: 'module' object has no attribute 'TweepException'

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "/home/peter/Software/renpy-6.13.12/renpy/execution.py", line 265, in run
node.execute()
File "/home/peter/Software/renpy-6.13.12/renpy/ast.py", line 632, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide)
File "/home/peter/Software/renpy-6.13.12/renpy/python.py", line 972, in py_exec_bytecode
exec bytecode in globals, locals
File "game/rentweet.rpy", line 27, in <module>
t = Rentweet.tw_authenticate()
File "game/rentweet.rpy", line 262, in tw_authenticate
except tweepy.TweepException as x:
AttributeError: 'module' object has no attribute 'TweepException'

Linux-3.2.0-25-generic-x86_64-with-debian-wheezy-sid
Ren'Py 6.13.12.1728


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Workingdrag13


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group