Search found 9 matches

by Wertous
Thu Feb 20, 2020 11:12 am
Forum: Ren'Py Questions and Announcements
Topic: function works twice
Replies: 3
Views: 129

Re: function works twice

Thank you very much for the advice, but for some reason it doesn’t work for me as you wrote In principle, I also realized that the problem is that the udar_1 variable is checked twice I found a way out by declaring the declaration of the play_1 function before checking the value of the udar_1 variab...
by Wertous
Wed Feb 19, 2020 7:34 pm
Forum: Ren'Py Questions and Announcements
Topic: function works twice
Replies: 3
Views: 129

function works twice

Hello everyone, I had one unforeseen problem In my opinion, in the window I need, when the value of a variable of a certain value, an audio signal should be played I decided that it would be best if the sound I call the function and it will work if the desired value of the variable But the whole pro...
by Wertous
Fri Aug 09, 2019 10:47 am
Forum: Ren'Py Questions and Announcements
Topic: Attempt to integrate two inventory systems
Replies: 6
Views: 307

Re: Attempt to integrate two inventory systems

If I change the cod of the button to textbutton "Equip" action Function( Weapon.equip,selected_item,pc) I get an error unbound method equip() must be called with Weapon instance as first argument ( got revertable List instace instead) as far as I understand the problem is that the click handler does...
by Wertous
Fri Aug 09, 2019 9:29 am
Forum: Ren'Py Questions and Announcements
Topic: Attempt to integrate two inventory systems
Replies: 6
Views: 307

Re: Attempt to integrate two inventory systems

Or if on list inventory screen. rpy on line 122 I change to textbutton "Equip" action Function( selected_item.equip,pc) which is typical for the first system I get an error RevertableList has no attribute equip In general, I tried different options to declare this function - but they all lead to an ...
by Wertous
Fri Aug 09, 2019 9:21 am
Forum: Ren'Py Questions and Announcements
Topic: Attempt to integrate two inventory systems
Replies: 6
Views: 307

Re: Attempt to integrate two inventory systems

In general and in general, the system works fine but there is one problem - namely, equip does not work through the button
received error
While running game code:
unbound method equip_weapon () must be called with Player instance as first argument (got revertable list instance instead
by Wertous
Fri Aug 09, 2019 9:15 am
Forum: Ren'Py Questions and Announcements
Topic: Attempt to integrate two inventory systems
Replies: 6
Views: 307

Re: Attempt to integrate two inventory systems

screept.rpy define player = Character("Rufus",color="#c8c8ff") default pc = Player(15,10,5,3,2,1) default sword = Weapon("sword", 10, 5, "sword") default selected_item= None default Player_inv = Inventory("") label start: #$ Player_inv = Inventory("") $ Player_inv.take(sword) $ Player_inv.take(swor...
by Wertous
Fri Aug 09, 2019 9:14 am
Forum: Ren'Py Questions and Announcements
Topic: Attempt to integrate two inventory systems
Replies: 6
Views: 307

Re: Attempt to integrate two inventory systems

inventory_screen.rpy style slot: background Frame("square",0,0) minimum(80,80) maximum(80,80) xalign 0.5 screen view_nav(inventory): hbox: text "View: " textbutton "Grid" action SetField(inventory, "grid_view", True) textbutton "list" action SetField(inventory, "grid_view", False) screen sort_nav(i...
by Wertous
Fri Aug 09, 2019 9:13 am
Forum: Ren'Py Questions and Announcements
Topic: Attempt to integrate two inventory systems
Replies: 6
Views: 307

Re: Attempt to integrate two inventory systems

inventory.rpy init python: class InventoryItem: def __init__(self, img, value): self.img = img self.value = value class Consumable(InventoryItem): def __init__(self,img,value,hp_gain,mp_gain): InventoryItem.__init__(self,img,value) self.hp_gain = hp_gain self.mp_gain = mp_gain def use(self, target)...
by Wertous
Fri Aug 09, 2019 9:11 am
Forum: Ren'Py Questions and Announcements
Topic: Attempt to integrate two inventory systems
Replies: 6
Views: 307

Attempt to integrate two inventory systems

Hello! I am a new person in this matter I am trying to integrate two inventory systems into one - since in each of them there is not what is in the other So my goal is a displayed inventory list with the ability to put on and take off things from the character, such as weapons, armor and other thing...