Page 1 of 1

[Solved]Problem with new mechanics

Posted: Thu Jul 12, 2018 11:00 am
by zabuzaeldemonio
Greetings, first should explain the situation,

I'm creating the concept of mobile in the visual novel, and I'm stuck in the contact interface. Since as the story progresses, more contacts are added (some before and others after, depending on the decisions of the player).

The problem is that I do not have an effective way to control that, I tried with if but many times the same contact was repeated, or empty gaps remained.

Therefore, is there any way to add the contacts in the order that the player got them?

I show you a piece of the interface:

Code: Select all

screen contactos:
    use navi
    add "gui/movil/contactos.jpg"
    
    imagebutton auto "gui/movil/hideo_%s.png" xpos 750 ypos 330 focus_mask True
    imagebutton auto "gui/movil/sayuri_%s.png" xpos 750 ypos 420 focus_mask True
    
    

Re: Problem with new mechanics

Posted: Thu Jul 12, 2018 11:54 am
by Chekhov
Are you sure you want to give each contact a location? I guess you could do it that way, kinda like a map where you discover new locations.

You also have the option of putting them into a menu with conditions: https://www.renpy.org/doc/html/menus.html (see the "if drank tea" at the bottom).

Otherwise you could do it like the tutorial shows with unlocking locations, if I'm not mistaken.

edit: I see I have not read quite as clearly; you want to put them in the order you discover them. I guess I would do it with python where I have a list of:

Code: Select all

$ discovered_people = []
Then when I have that empty list I would add the newly discovered person at the end:

Code: Select all

$ discovered_people.append("Jason")
to keep track of the people as the player meets them (make sure to add a way to check if the name is already in the list before adding it, like:)

Code: Select all

init python:
	if "jason" in discovered_people:
		"You already have jason in your contact list"
	else:
		"You add jason to your contact list"
		discovered_people.append("Jason")
And finally I would write something to display it one by one.

Re: Problem with new mechanics

Posted: Thu Jul 12, 2018 12:00 pm
by rames44
If your game maintained a list of the contacts that had been encountered, in the order they were encountered, your screen could iterate thru that list, adding image buttons for each character in the list. If the image buttons were inside a vbox, they would be listed vertically in the order encountered.

Is that what you’re trying to accomplish?

Re: Problem with new mechanics

Posted: Thu Jul 12, 2018 2:13 pm
by zabuzaeldemonio
I think your proposal is quite similar to the method I was doing.

Code: Select all

 $ phone1 = True
And then analyze the options

Code: Select all

    if phone1:
        imagebutton auto "gui/movil/hideo_%s.png" xpos 750 ypos 330 focus_mask True
    if phone2:
        imagebutton auto "gui/movil/sayuri_%s.png" xpos 750 ypos 420 focus_mask True
If I'm wrong, tell me why I can not see the difference.

Re: Problem with new mechanics

Posted: Thu Jul 12, 2018 3:43 pm
by zabuzaeldemonio
Okey i find a way to solve this, thanks to all