Search found 10 matches

by kdy8591
Thu May 04, 2023 8:28 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]I hope the number changes every time I press the textbutton.
Replies: 2
Views: 186

[SOLVED]I hope the number changes every time I press the textbutton.

define b = 0 define c = 0 define d = 0 define e = 0 screen a(): python : if e == 0 : b = 1 c = b + e d = 0 vbox : text "[b] [c] [d] [e]" textbutton "1" : action SetVariable ("b", b+1) textbutton "2" : action SetVariable ("c", c-1) textbutton "3...
by kdy8591
Wed Apr 19, 2023 12:46 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] I want to print out random numbers in random text(Additional Questions)
Replies: 4
Views: 340

Re: I want to print out random numbers in random text(Additional Questions)

I'm sorry. I wasn't used to using site. And I don't know how to use !ti. text "[a1!ti]" align (.5, .6) The dice part disappeared as a result of the run. I guess it's because the + "({})" format(n) align(.5, .6) part is omitted. define dice_list = [_("I roll the dice! [dice1 ...
by kdy8591
Tue Apr 18, 2023 9:32 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] I want to print out random numbers in random text(Additional Questions)
Replies: 4
Views: 340

[Solved] I want to print out random numbers in random text(Additional Questions)

I asked you a question before, but I have more questions https://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=66478&p=559966#p559966 define dice_list = [_(_("I roll the dice! [dice1 + dice2 + 5] You roll the dice, too"), _("it's my turn [dice1 + dice2 + 2] It's your turn"...
by kdy8591
Mon Apr 17, 2023 9:54 pm
Forum: Ren'Py Questions and Announcements
Topic: I want to print out random numbers in random text
Replies: 2
Views: 292

Re: [SOLVED] I want to print out random numbers in random text

Thank you. It's settled clearly. I want to ask a harder question define dice_list = [_("I roll the dice! [dice + 5] You roll the dice, too"), _("it's my turn [dice + 2] It's your turn"), _("victory! [dice + 1] Do you think you can you win?")] I want to put [dice] in the...
by kdy8591
Mon Apr 17, 2023 10:59 am
Forum: Ren'Py Questions and Announcements
Topic: I want to print out random numbers in random text
Replies: 2
Views: 292

I want to print out random numbers in random text

define dice_list = ["I roll the dice! (dice1 + dice2 + 1)", "it's my turn (dice1 + dice2 + 2)", "victory! (dice1 + dice2 + 3)"] ######### dice1 and dice2 are below. ######### I want to put random numbers in ( ) and calculate screen button_1 () : textbutton "dialog...
by kdy8591
Tue Apr 11, 2023 11:54 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]I want to press the button and add 10 to the elements in the list.
Replies: 4
Views: 260

Re: I want to press the button and add 10 to the elements in the list.

Thank you so much!
It has been resolved.

SetField(who, "HP", who.HP+10)

This code works without errors.

P.S. 2) The text comes out well.
by kdy8591
Tue Apr 11, 2023 11:08 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]I want to press the button and add 10 to the elements in the list.
Replies: 4
Views: 260

Re: I want to press the button and add 10 to the elements in the list.

Thank you for your answer. But I've already tried it. action SetVariable ("who.HP", who.HP+10) 위의 코드는 'NameError: The variable who.Hp does not exist' action SetVariable (who.HP, who.HP+10) 본래 코드는 "AttributeError: 'int' object has no attribute 'rpartition'" action SetVariable (&qu...
by kdy8591
Tue Apr 11, 2023 10:26 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]I want to press the button and add 10 to the elements in the list.
Replies: 4
Views: 260

[SOLVED]I want to press the button and add 10 to the elements in the list.

I want to add 10 to HP when I press the button. The target is in the list in a class state. init python : class p_creat : p_list = [] def __init__(self, name, HP, turn): self.name = name self.HP = HP self.turn = turn p_creat.p_list.append(self) p1 = p_creat("1p", 0, 0) p2 = p_creat("2...