any idea of making USER ACCOUNT in main menu on the game.?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Mjhay
Regular
Posts: 61
Joined: Sat Jan 16, 2021 2:29 pm
Location: Philippines
Contact:

any idea of making USER ACCOUNT in main menu on the game.?

#1 Post by Mjhay » Wed Jan 20, 2021 8:24 am

any idea of making user account in main menu screen.?

i'm planning to make user account in the game so that the user can CREATE, DELETE AND UPDATE their account on the game.
is it possible to make it? is that make sense?

what should i do first? need your guidance.
i really appreciate your help THANKS :)

User avatar
Amethysts
Regular
Posts: 40
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#2 Post by Amethysts » Wed Jan 20, 2021 10:56 am

If you're planning on making an online game, it is possible that it makes sense.
And you're lucky : Requests python package is supported by Ren'Py since 7.4.0 (but I haven't tested it yet)


But it's very complicated (sorry to destroy your dreams :( ) for various reasons:
- It requires a server
- HTTP and server communication knowledge
- And anyway, players don't like creating an account, they just want to play...

User avatar
Mjhay
Regular
Posts: 61
Joined: Sat Jan 16, 2021 2:29 pm
Location: Philippines
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#3 Post by Mjhay » Wed Jan 20, 2021 11:47 am

Amethysts wrote:
Wed Jan 20, 2021 10:56 am
If you're planning on making an online game, it is possible that it makes sense.
And you're lucky : Requests python package is supported by Ren'Py since 7.4.0 (but I haven't tested it yet)


But it's very complicated (sorry to destroy your dreams :( ) for various reasons:
- It requires a server
- HTTP and server communication knowledge
- And anyway, players don't like creating an account, they just want to play...
ow is that so. i taught it can .. :(
and im making a offline game .
but thanks, now i know :)

uhm, how about before the main menu the user will create new game and input player's name and after that the main menu will appear?
is that makes sense now? haha :D

is it possible now? :)

User avatar
Amethysts
Regular
Posts: 40
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#4 Post by Amethysts » Wed Jan 20, 2021 2:57 pm

Yes, just asking user name is a great idea :)

https://www.renpy.org/doc/html/input.html

use something to ask the player name before main screen

Code: Select all

define me = Character("[persistent.name]")

label splashscreen:
	
	python:
		if not persistent.name:	# if not already set, asks for name. If it is already set, will pass
    			persistent.name = renpy.input("What is your name?", length=32)
    			persistent.name = persistent.name.strip()

    		if not persistent.name: 	# user enters nothing
         		persistent.name = "Default Name"

label start:
	# Your code
The "persistent." will make it saved for the next time you enter the game. Try without you'll see the difference :)

User avatar
Mjhay
Regular
Posts: 61
Joined: Sat Jan 16, 2021 2:29 pm
Location: Philippines
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#5 Post by Mjhay » Wed Jan 20, 2021 3:16 pm

Amethysts wrote:
Wed Jan 20, 2021 2:57 pm
Yes, just asking user name is a great idea :)

https://www.renpy.org/doc/html/input.html

use something to ask the player name before main screen

Code: Select all

define me = Character("[persistent.name]")

label splashscreen:
	
	python:
		if not persistent.name:	# if not already set, asks for name. If it is already set, will pass
    			persistent.name = renpy.input("What is your name?", length=32)
    			persistent.name = persistent.name.strip()

    		if not persistent.name: 	# user enters nothing
         		persistent.name = "Default Name"

label start:
	# Your code
The "persistent." will make it saved for the next time you enter the game. Try without you'll see the difference :)
thanks for that, :) but why its getting error? its said " Tab character are not allowed in Renpy's Script.
where should i put this code ? Sorry :(
i put it above the label start:

User avatar
Amethysts
Regular
Posts: 40
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#6 Post by Amethysts » Wed Jan 20, 2021 4:00 pm

It's just a whitespace issue.

viewtopic.php?t=37243

Whitespace can be represented as 4 spaces or a tab symbol (\t).

Try re-indenting with your editor (removing all whitespaces and then reindenting)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3406
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#7 Post by Imperf3kt » Wed Jan 20, 2021 5:35 pm

Amethysts wrote:
Wed Jan 20, 2021 4:00 pm
Whitespace can be represented as 4 spaces or a tab symbol (\t).
In python, yes, but not in renpy, you must use four spaces with renpy, it doesn't accept tabs, which is why this error is appearing.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Latest Blackjack updates

User avatar
Amethysts
Regular
Posts: 40
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#8 Post by Amethysts » Wed Jan 20, 2021 5:38 pm

Yes I meant that I may have given a code with both tabs and spaces, and I'm sorry about that.

But thanks for the details, it's actually interesting :)

User avatar
Mjhay
Regular
Posts: 61
Joined: Sat Jan 16, 2021 2:29 pm
Location: Philippines
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#9 Post by Mjhay » Wed Jan 20, 2021 5:50 pm

Amethysts wrote:
Wed Jan 20, 2021 5:38 pm
Yes I meant that I may have given a code with both tabs and spaces, and I'm sorry about that.

But thanks for the details, it's actually interesting :)
it works now :D
i tried to recode it again and it works.
thanks! really appreciate your help!

User avatar
Mjhay
Regular
Posts: 61
Joined: Sat Jan 16, 2021 2:29 pm
Location: Philippines
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#10 Post by Mjhay » Thu Feb 25, 2021 1:58 am

Amethysts wrote:
Wed Jan 20, 2021 2:57 pm
Yes, just asking user name is a great idea :)

https://www.renpy.org/doc/html/input.html

use something to ask the player name before main screen

Code: Select all

define me = Character("[persistent.name]")

label splashscreen:
	
	python:
		if not persistent.name:	# if not already set, asks for name. If it is already set, will pass
    			persistent.name = renpy.input("What is your name?", length=32)
    			persistent.name = persistent.name.strip()

    		if not persistent.name: 	# user enters nothing
         		persistent.name = "Default Name"

label start:
	# Your code
The "persistent." will make it saved for the next time you enter the game. Try without you'll see the difference :)
how can i make persistent character name on screen?

Code: Select all

$ player_name = ui.text("Please enter your name:", xalign=0.5, yalign=0.4)
$ player_name = ui.input('Dodo', xalign=0.5, yalign=0.5)
$ player_name = ui.interact()
if player_name == '':
    $ player_name = 'Dodo'
how can i make this to persistent ? i like this because it is on screen not on the textbox

User avatar
zmook
Regular
Posts: 170
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: any idea of making USER ACCOUNT in main menu on the game.?

#11 Post by zmook » Thu Feb 25, 2021 10:58 am

Generally, you can make a variable persistent just by prefixing the variable name with "persistent." Ren'py handles the rest.

Code: Select all

$ persistent.player_name = ui.interact()
if persistent.player_name == '':
    $ persistent.player_name = 'Dodo'
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

Post Reply

Who is online

Users browsing this forum: skinnyfitgenes