- Dec 17, 2021
- 61
- 203
Hi,
I am trying to build a user interface that shows character's pictures, 2 stats, and a quest or hint system for each person. Coding is my biggest handicap to making games and it is honestly frustrating. I would really appreciate if someone could just help me make something simple that I could use, and that my players could be satisfied with and hopefully I can just use that for as long as I'm in this hobby.
I am comfortable with the basics of renpy but this is definitely a point of knowledge gap and the learning curve appears steep and I'm hitting fatigue at trying to figure things out independently.
I have being looking through old scripts and I think that I found one that could work for the hint/quest system:
init python:
class Quest( renpy.python.RevertableObject ):
def __init__( self, char ):
self._char = char
self._stages = []
self._iterationsLeft = []
self._actualStage = 0
property
def showStage( self ):
# Let /isFinished/ deal with this, it's better.
if self.isFinished() is True: return "The quest is finished."
return self._stages[self._actualStage][0]
property
def actualStage( self ):
return self._actualStage + 1
property
def iterationLeft( self ):
# Let /isFinished/ deal with this, it's better.
if self.isFinished() is True: return 0
return self._iterationsLeft[self._actualStage]
def addStage( self, task, iteration=1 ):
self._stages.append( ( task, iteration ) )
self._iterationsLeft.append( iteration )
def nextStage( self ):
if self.isFinished() is True: return
self._iterationsLeft[self._actualStage] -= 1
if self._iterationsLeft[self._actualStage] == 0:
self._actualStage += 1
def reset( self ):
self._actualStage = 0
self._iterationsLeft = []
for s in self._stages:
self._iterationsLeft.append( s[1] )
def numberStages( self ):
return len( self._stages )
def updateStage( self, stage, task, iteration=1 ):
if len( self._stages ) <= stage : return
if stage < 0: return
iterationDone = self._stages[stage][1] - self._iterationsLeft[stage]
self._stages[stage] = ( task, iteration )
self._iterationsLeft[stage] = iteration - iterationDone
if self._iterationsLeft[stage] < 1: self._iterationsLeft[stage] = 1
def updateLastStage( self, task, iteration=1 ):
self.updateStage( len( self._stages - 1 ), task, iterarion )
def isFinished( self ):
# Still at least a stage, so it can't be ended.
if self._actualStage + 1 < len( self._stages ): return False
# Above the last stage, so obviously finished.
if self._actualStage + 1 > len( self._stages ): return True
# Else, it will depend if there's still an iteration to do or not.
return self._iterationsLeft[self._actualStage] == 0
I have a few questions related to this above. I just want to make sure I know how to work this.
1. If I had a character quest and wanted to add it, would this be appropriate code during the actual script?
define a = "charA name"
$ charAQuest = Quest( "charA name" )
or
$ aquest = Quest( "charA name" )
2. If I wanted to add another stage, would this be appropriate?
$ charAQuest.addStage( "Assemble in the main hall" )
or
$ a.addstage( "Assemble in the main hall" )
3. How would I get to "Is Finished", like what code would I need to put into the script?
If I could get the above to work, that should be sufficient to walkthrough my game, on top of the other changes I already plan to make to simplify everything including doing away with maps, and just using jump events.
Another area where I would love help, if possible would be including a stats screen which has a portrait and 2 stats from the game. My games have a lot of characters, and if there is a way to simplify this I would greatly appreciate any help. The two stats I'd like to showcase for all characters are Bond and Lust. But rather than using the actual number values, I'd like to just use a string such as below...what could I do to show this?
default CharacterBond = 0
default CharacterBondValue = Null
default CharacterDesire = 0
default CharacterDesireValue = Null
if CharacterBond == 0:
$ CharacterBondValue = "Neutral"
if CharacterBond >= 3:
$ CharacterBondValue = "Devoted"
if CharacterBond >= 2:
$ CharacterBondValue = "Close"
if CharacterBond >= 1:
$ CharacterBondValue = "Friendly"
if CharacterBond <= -1:
$CharacterBondValue = "Distant"
if CharacterBond <= -2:
$ CharacterBondValue = "Rival"
if CharacterBond <= -3:
$ CharacterBondValue = "Enemy"
if CharacterDesire == 0:
$ CharacterDesireValue = "None"
if CharacterDesire >= 2:
$ CharacterDesireValue = "Interested"
if CharacterDesire >= 4:
$ CharacterDesireValue = "Eager"
if CharacterDesire >= 6:
$ CharacterDesireValue = "Obsessed"
if CharacterDesire >= 8:
$CharacterDesireValue = "Desperate"
if CharacterDesire >= 10:
$CharacterDesireValue = "Uninhibited"
So, ideally, I could have a screen that shows a character's picture, these two stats, and a tiny hint/quest line for every character. I would appreciate any help, including even something much simpler or different from this. I just want to make games but I still want to retain some element of complexity and depth to the logic of them...this is so frustrating.
I am trying to build a user interface that shows character's pictures, 2 stats, and a quest or hint system for each person. Coding is my biggest handicap to making games and it is honestly frustrating. I would really appreciate if someone could just help me make something simple that I could use, and that my players could be satisfied with and hopefully I can just use that for as long as I'm in this hobby.
I am comfortable with the basics of renpy but this is definitely a point of knowledge gap and the learning curve appears steep and I'm hitting fatigue at trying to figure things out independently.
I have being looking through old scripts and I think that I found one that could work for the hint/quest system:
init python:
class Quest( renpy.python.RevertableObject ):
def __init__( self, char ):
self._char = char
self._stages = []
self._iterationsLeft = []
self._actualStage = 0
property
def showStage( self ):
# Let /isFinished/ deal with this, it's better.
if self.isFinished() is True: return "The quest is finished."
return self._stages[self._actualStage][0]
property
def actualStage( self ):
return self._actualStage + 1
property
def iterationLeft( self ):
# Let /isFinished/ deal with this, it's better.
if self.isFinished() is True: return 0
return self._iterationsLeft[self._actualStage]
def addStage( self, task, iteration=1 ):
self._stages.append( ( task, iteration ) )
self._iterationsLeft.append( iteration )
def nextStage( self ):
if self.isFinished() is True: return
self._iterationsLeft[self._actualStage] -= 1
if self._iterationsLeft[self._actualStage] == 0:
self._actualStage += 1
def reset( self ):
self._actualStage = 0
self._iterationsLeft = []
for s in self._stages:
self._iterationsLeft.append( s[1] )
def numberStages( self ):
return len( self._stages )
def updateStage( self, stage, task, iteration=1 ):
if len( self._stages ) <= stage : return
if stage < 0: return
iterationDone = self._stages[stage][1] - self._iterationsLeft[stage]
self._stages[stage] = ( task, iteration )
self._iterationsLeft[stage] = iteration - iterationDone
if self._iterationsLeft[stage] < 1: self._iterationsLeft[stage] = 1
def updateLastStage( self, task, iteration=1 ):
self.updateStage( len( self._stages - 1 ), task, iterarion )
def isFinished( self ):
# Still at least a stage, so it can't be ended.
if self._actualStage + 1 < len( self._stages ): return False
# Above the last stage, so obviously finished.
if self._actualStage + 1 > len( self._stages ): return True
# Else, it will depend if there's still an iteration to do or not.
return self._iterationsLeft[self._actualStage] == 0
I have a few questions related to this above. I just want to make sure I know how to work this.
1. If I had a character quest and wanted to add it, would this be appropriate code during the actual script?
define a = "charA name"
$ charAQuest = Quest( "charA name" )
or
$ aquest = Quest( "charA name" )
2. If I wanted to add another stage, would this be appropriate?
$ charAQuest.addStage( "Assemble in the main hall" )
or
$ a.addstage( "Assemble in the main hall" )
3. How would I get to "Is Finished", like what code would I need to put into the script?
If I could get the above to work, that should be sufficient to walkthrough my game, on top of the other changes I already plan to make to simplify everything including doing away with maps, and just using jump events.
Another area where I would love help, if possible would be including a stats screen which has a portrait and 2 stats from the game. My games have a lot of characters, and if there is a way to simplify this I would greatly appreciate any help. The two stats I'd like to showcase for all characters are Bond and Lust. But rather than using the actual number values, I'd like to just use a string such as below...what could I do to show this?
default CharacterBond = 0
default CharacterBondValue = Null
default CharacterDesire = 0
default CharacterDesireValue = Null
if CharacterBond == 0:
$ CharacterBondValue = "Neutral"
if CharacterBond >= 3:
$ CharacterBondValue = "Devoted"
if CharacterBond >= 2:
$ CharacterBondValue = "Close"
if CharacterBond >= 1:
$ CharacterBondValue = "Friendly"
if CharacterBond <= -1:
$CharacterBondValue = "Distant"
if CharacterBond <= -2:
$ CharacterBondValue = "Rival"
if CharacterBond <= -3:
$ CharacterBondValue = "Enemy"
if CharacterDesire == 0:
$ CharacterDesireValue = "None"
if CharacterDesire >= 2:
$ CharacterDesireValue = "Interested"
if CharacterDesire >= 4:
$ CharacterDesireValue = "Eager"
if CharacterDesire >= 6:
$ CharacterDesireValue = "Obsessed"
if CharacterDesire >= 8:
$CharacterDesireValue = "Desperate"
if CharacterDesire >= 10:
$CharacterDesireValue = "Uninhibited"
So, ideally, I could have a screen that shows a character's picture, these two stats, and a tiny hint/quest line for every character. I would appreciate any help, including even something much simpler or different from this. I just want to make games but I still want to retain some element of complexity and depth to the logic of them...this is so frustrating.