Re: RPG Battle Engine - Alpha 7.5, downloads in first post
Posted: Tue Sep 24, 2013 3:51 pm
---
Supporting creators of visual novels and story-based games since 2003.
https://lemmasoft.renai.us/forums/
Unfortunately, my day job and other paying work has to take priority - so as to when the next version will be released, the answer is "when it's done". I'm looking forward to getting back to it and finishing it off, but I can't say with any certainty when that will be... so go ahead, ask away and I'll answer as best I can in the context of the currently-released version.DesertFox wrote: When are you planning to release?
I have one or two more queries, mainly about customization. Should I wait or are you okay to answer them now?
To remove a skill from a fighter in the current build, you should be able to call:azureXtwilight wrote:I am wondering if there's a way to "unlearn" a skill under a certain "if" condition?
Code: Select all
myFighter.UnregisterSkill(mySkill)
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/ryuudou.rpy", line 581, in script
File "game/ryuudou.rpy", line 582, in python
AttributeError: 'PlayerFighter' object has no attribute 'UnregisterSkill'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\renpy-6.14.1-sdk\renpy\execution.py", line 288, in run
node.execute()
File "C:\renpy-6.14.1-sdk\renpy\ast.py", line 718, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\renpy-6.14.1-sdk\renpy\python.py", line 1297, in py_exec_bytecode
exec bytecode in globals, locals
File "game/ryuudou.rpy", line 582, in <module>
ryuu.UnregisterSkill(Library.Skills.MikRy)
AttributeError: 'PlayerFighter' object has no attribute 'UnregisterSkill'
Windows-7-6.1.7601-SP1
Ren'Py 6.15.7.374
A Ren'Py Game 0.0
Sorry, yes! I apparently didn't actually have a clean release of 7.5 in the project that I'd labelled as a clean release of 7.5, and that method isn't in 7.5 after all.azureXtwilight wrote:Got this error
Code: Select all
# Remove a skill from this fighter's list of abilities
def UnregisterSkill(self, skill):
if (skill.Name in self._skillHandlers):
del self._skillHandlers[skill.Name]
self._skills = {}
for s in self._skillHandlers.values():
s.RegisterFighter(self)
Code: Select all
# Add a skill to this fighter's list of abilities
def RegisterSkill(self, skill):
if (skill.Name in self._skillHandlers) == False:
self._skillHandlers[skill.Name] = skill
skill.RegisterFighter(self)
# Remove a skill from this fighter's list of abilities
def UnregisterSkill(self, skill):
if (skill.Name in self._skillHandlers):
del self._skillHandlers[skill.Name]
self._skills = {}
for s in self._skillHandlers.values():
s.RegisterFighter(self)
# State methods
def getFaction(self):
return self._faction
def setFaction(self, val):
self._faction = val
Faction = property(getFaction, setFaction)
azureXtwilight wrote:Oh, I got this error mid-game. I wonder what caused it...
Code: Select all
init python:
top_bar = Frame('gfx/top_bar.png', 7, 8)
style.vscrollbar.top_bar = top_bar
style.vscrollbar.bottom_bar = top_bar
style.vscrollbar.thumb = 'gfx/thumb.png'
style.vscrollbar.xminimum = 14
style.vscrollbar.xmaximum = 14
label inv_test:
python:
# Here we're using the 'portrait' parameter to define a headshot of the character for use in UIs
jack = PlayerFighter("Jack", portrait="gfx/jack.png", Health=100, Look=1, Lewd=1)
money = 10000
jackinv = BattleInventory()
# The shop's inventory is stored in a BattleInventory instance - same as the player's
# party inventory.
shopInventory = BattleInventory()
# To add a quantity of equipment, call the 'AddItem' method with two parameters -
# the item itself, and the number to add.
shopInventory.AddItem(Library.Equipment.Dress)
shopInventory.AddItem(Library.Equipment.Panties)
shopInventory.AddItem(Library.Equipment.Boots)
money = renpy.call_screen("rpg_shop", partyInventory=jackinv, shopInventory=shopInventory, currency="Gold", money=money, fighters=[jack])
# Let's go through all the stuff we bought:
invItems = []
for i in jackinv.GetItems():
# i[0] is the name
# i[1] is the quantity
# i[2] is the item instance (in case you need it)
itemString = str(i[1]) + " " + i[0]
if i[1] > 1:
itemString = itemString + "s"
invItems.append(itemString)
invString = ", ".join(invItems)
"You bought: [invString]"
show screen equip_select(partyInventory=jackinv, fighters=[jack])
pause
jump mainmenu
Your problem is in the line of code I left in the quote above - the equip_select screen expects the inventory to be passed in with the parameter name "equipment". If you change it to the following, it looks like it should work:Alitza wrote: When I buy something in shop module it does not appear in equip module .
Code: Select all
show screen equip_select(partyInventory=jackinv, fighters=[jack])
Code: Select all
show screen equip_select(equipment=jackinv, fighters=[jack])
This is all off the top of my head, and it's late and I'm tired so apologies if I miss something or I'm not clear enough:Tsundere Lightning wrote:I'm working on something with Focus as well as MP. It's supposed to start at 10 and go up by 5 each time a Fighter Attacks or Skips, then cap at 100. Then you can spend it on special abilities.
How would you implement this?
Going to try this now. Thank you! It helps that Focus-consuming attacks never cost MP, at least not in my game.Jake wrote:This is all off the top of my head, and it's late and I'm tired so apologies if I miss something or I'm not clear enough:Tsundere Lightning wrote:I'm working on something with Focus as well as MP. It's supposed to start at 10 and go up by 5 each time a Fighter Attacks or Skips, then cap at 100. Then you can spend it on special abilities.
How would you implement this?
For the stat, I would suggest adding it in the first place with a value of 100, which by default sets the maximum value for that stat to be 100. Then you can set it directly to 10 immediately after creating the fighter to set the initial level.
For the skills, I'd suggest implementing your own skill handler classes - take a look at the AttackSkill and SkipSkill classes in engine-skills.rpy for examples (or maybe inherit from them). I'd then alter the PerformAction method to add 5 to the Focus stat alongside all the other stuff it does (or with inheritance; add 5 then call the implementation on the parent class), then on your special-ability skill classes, just put a check in IsAvailable to check the Focus stat is high enough alongside the check for MPs or whatever other requirements you have for that skill.