Page 15 of 19

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Tue Sep 24, 2013 3:51 pm
by DesertFox
---

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Mon Oct 07, 2013 8:32 pm
by Jake
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?
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.

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Sun Oct 13, 2013 11:17 pm
by azureXtwilight
I am wondering if there's a way to "unlearn" a skill under a certain "if" condition?

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Mon Oct 14, 2013 2:55 am
by Jake
azureXtwilight wrote:I am wondering if there's a way to "unlearn" a skill under a certain "if" condition?
To remove a skill from a fighter in the current build, you should be able to call:

Code: Select all

myFighter.UnregisterSkill(mySkill)
Bear in mind that the 'mySkill' you pass in there is the entire skill instance - the same thing that you passed in when you registered that skill on that fighter in the first place.

Caveats:
- Only the name of the skill that you pass in gets used, so if you have two skills with the same name, then you may accidentally remove another one instead
- This will only remove the first registration of a skill with that name that the system comes across, so if you registered the same skill on a fighter five times you need to remove it five times as well.


Also remember you can always have a condition on the skill class itself to make it unavailable in certain circumstances if you just want to disable it under certain conditions - UnregisterSkill removes it from that fighter permanently, and if you want it back you have to call RegisterSkill again.

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Sun Oct 20, 2013 8:22 am
by azureXtwilight
Got this error:

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

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Sun Oct 20, 2013 3:18 pm
by Jake
azureXtwilight wrote:Got this error
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.


OK, if you haven't written any custom code in any skill class' RegisterFighter or SetUpFighter methods, then you're fine. All you'll need to do is open engine-fighters.rpy, go to line 153, and add in the following code:

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)
            
        
It's a bit hackier than the next-release version, but it should work if you're not customising those two methods I mentioned above. The code around that area should then look like this:

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)
with the new method inserted in the middle.




If you have customised any RegisterFighter or SetUpFighter methods on any skills in such a way that the method would produce undesired effects if run a second time, then you'll have to either wait for the next release or just add your condition into the IsAvailable check on that skill and put up with it appearing in the skill menu but not being selectable.

Sorry!

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Sun Oct 27, 2013 7:23 pm
by azureXtwilight
Thank you!

Oh, I got this error mid-game. I wonder what caused it...

http://i.imgur.com/owMEKeK.jpg

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Mon Oct 28, 2013 3:52 am
by Jake
azureXtwilight wrote:Oh, I got this error mid-game. I wonder what caused it...

What happens in Ryuudou.rpy on line 210? It looks like the facing is being set on a fighter who isn't yet in a battle - if that's the case, you'll need to add fighters to a battle (using AddFighter in the usual way) before you can set their facing, because their facing only means anything in the context of a battlefield.

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Thu Nov 21, 2013 10:02 am
by Alitza
Hello

I tried to share inventory from shop module with personal inventory from equip module but still stuck :cry: . When I buy something in shop module it does not appear in equip module .

can you explain what am I doing wrong please ?

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

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Thu Nov 21, 2013 7:35 pm
by Tsundere Lightning
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?

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Thu Nov 21, 2013 8:53 pm
by Jake
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])
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:

Code: Select all

    show screen equip_select(equipment=jackinv, fighters=[jack])

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Thu Nov 21, 2013 9:01 pm
by Jake
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?
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:

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.

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Fri Nov 22, 2013 7:07 am
by Alitza
Thanks alot Jake.
works fine now :D

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Fri Nov 22, 2013 5:25 pm
by Tsundere Lightning
Jake wrote:
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?
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:

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.
Going to try this now. Thank you! It helps that Focus-consuming attacks never cost MP, at least not in my game.

EDITED WITH A QUESTION:
Is the "Magic" stat you have as the default in the engine a parallel stat to Attack, or is it just maximum MP? Because if it's just max MP, then I'm going to need to alter spells to deal damage off a different stat.

Re: RPG Battle Engine - Alpha 7.5, downloads in first post

Posted: Sun Dec 01, 2013 11:00 am
by PeterTehDumb
Hello,

I'm only here to ask about the license. As I'm new with CC License terms.

Here's my question :
Am I allowed to place a donate button to cover up some image material's funds for a VN?
This VN will be free to play though.