Search found 208 matches

by Nero
Mon Jan 14, 2019 6:29 pm
Forum: Ren'Py Questions and Announcements
Topic: While Loop Causing Game To Freeze
Replies: 4
Views: 210

Re: While Loop Causing Game To Freeze

Oh damn I realised my mistake now I didn't put x value inside the while loop same as all other of my code... Thanks for correcting me now I understand. Oh and yeah it works even without declaring it in separated function it can be all done in main() function. To answer your question yes it does noth...
by Nero
Mon Jan 14, 2019 8:20 am
Forum: Ren'Py Questions and Announcements
Topic: While Loop Causing Game To Freeze
Replies: 4
Views: 210

Re: While Loop Causing Game To Freeze

Yes I did however I made typing mistake when creating example. Thats how I called it if that's what you meant:

Code: Select all

$ Battle.mainBattle()
Tried making x = 0 outside the init python declared global x in within the method still same problem :/
by Nero
Mon Jan 14, 2019 12:10 am
Forum: Ren'Py Questions and Announcements
Topic: While Loop Causing Game To Freeze
Replies: 4
Views: 210

While Loop Causing Game To Freeze

Im doing battle system inside of python however game freezes after i try to run my code. When I do exactly same thing while in renpy scrip game seems to run fine. Where is the problem? init python: class Battle(object): def __init__(self,characters): self.characters = characters @staticmethod def ch...
by Nero
Sat Jan 12, 2019 7:13 pm
Forum: Ren'Py Questions and Announcements
Topic: Need Help With Lists In Python
Replies: 2
Views: 172

Re: Need Help With Lists In Python

Awesome thanks didn't know you could use class directly like that I thought I always need to create a variable for it to be used. Since you used object like that so is there a way object can be used in text renpy without needing to define variable? What i mean is this is how you do it by defining th...
by Nero
Fri Jan 11, 2019 8:20 pm
Forum: Ren'Py Questions and Announcements
Topic: Need Help With Lists In Python
Replies: 2
Views: 172

Need Help With Lists In Python

I will be quick you will understand my problem better if you run this code as I explained it detailed in game script. Now I will try to explain it here what was on my mind when I tried to code this. So basically I have created 2 Players which are inside of the list players=[bob, jack] and 1 Ailment ...
by Nero
Sun Dec 16, 2018 10:14 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]How to check if variable is in self.list
Replies: 4
Views: 144

Re: How to check if variable is in self.list

In my case it does that for example if I have list with 5 (spells) in it and I declared each spell have duration time in class Debuff .. so if I create function that will run every turn (turn based game) and function will do duration -= 1 every time it loops ... if I dont use deepcopy the cooldown d...
by Nero
Sun Dec 16, 2018 7:08 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]How to check if variable is in self.list
Replies: 4
Views: 144

Re: How to check if variable is in self.list

Yeah I know tried it myself but you have idea how to work around it with deepcopy?
by Nero
Sun Dec 16, 2018 12:26 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]How to check if variable is in self.list
Replies: 4
Views: 144

[SOLVED]How to check if variable is in self.list

I was wondering if there is a way I could check if self.list (self.status) holds variable poison. I tried doing it this way but it doesn't work... Any ideas how to fix this problem? init python: class Player(object): def __init__(self,name): self.name = name self.status = [] def add_spell(self, spel...
by Nero
Fri Dec 14, 2018 3:16 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Need help on improving my code with Players and Skills
Replies: 11
Views: 453

Re: Need help on improving my code with Players and Skills

Wow that's some real good teaching effort and explanation right here well done I enjoyed reading this. Case B looks most attractive also even I like that you posted other options of doing this. I used to write noob codes that had 2000 lines and it got old pretty fast that is why I want to do things ...
by Nero
Fri Dec 14, 2018 11:56 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Need help on improving my code with Players and Skills
Replies: 11
Views: 453

Re: Need help on improving my code with Players and Skills

Interesting it works now its first time I see something like this used in code though "from copy import deepcopy" I'm going to read about it on internet. Well it all works now as it should if anyone have more suggestions how to improve the code feel free to post. And thanks for help guys!
by Nero
Fri Dec 14, 2018 10:15 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Need help on improving my code with Players and Skills
Replies: 11
Views: 453

Re: Need help on improving my code with Players and Skills

Okay so I get it Python uses one list as I defined them self.status = status(global list for every player I can see this method can be used somewhere else in my project) instead of using self.status = [] (separated list for each player) . Is it really necessary to have list with list = [None] in it ...
by Nero
Thu Dec 13, 2018 7:03 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Need help on improving my code with Players and Skills
Replies: 11
Views: 453

Re: Need help on improving my code with Players and Skills

Hmm I did something similar like this before but again same problem. It seems it works but problem is that every player get affected by this effect even I gave poison effect to a player2 status list... or maybe I'm appending this the wrong way? Im using this line to append to status "$ player2.statu...
by Nero
Wed Dec 12, 2018 7:02 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Need help on improving my code with Players and Skills
Replies: 11
Views: 453

Re: Need help on improving my code with Players and Skills

I don't know if i needed to inherit from Player class since you said those 2 classes can both be objects then there is no need I guess(im asking because it looks like its needed in "screen battle_test_screen" or maybe im wrong)? I was never before mixing classes like that I used only 1 class and did...
by Nero
Tue Dec 11, 2018 11:38 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Need help on improving my code with Players and Skills
Replies: 11
Views: 453

[SOLVED]Need help on improving my code with Players and Skills

Hey, I just need some advice in improving my current code. Right now I accomplished what I wanted but thing is I did it in very poor way that it gets very frustrating if i decide to have lets say 50+ skills in my game this would be pain to do my way. The idea here is that I got a 3 players which are...
by Nero
Tue Dec 11, 2018 2:33 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]How to put image inside another image without messing up the screen position?
Replies: 2
Views: 165

Re: How to put image inside another image without messing up the screen position?

Ok tried this method it works also. There is other method I thought of not so proud of it but it work. I gave to if player.debuffed else: and added blank image and set its xpos off screen xpos -2000 like so. But using fixed is much more better way of doing it. Thanks.