Battle Engine - Alpha 6 release, downloads in first post
- usul
- Veteran
- Posts: 415
- Joined: Mon Oct 29, 2007 12:35 pm
- Projects: Teachings of the Buddha, System-Addict, Generation XxX
- Location: Quebec
- Contact:
Re: Battle Engine - Alpha 3 release, downloads in first post
IIRC you simply need to declare your animation in your assets and you simply cal that image instead. As for the bobbing of the image when its turn is up, this is an extra that is called, simply comment it out and you won't get that effect.
"The universe is non-simultaneously apprehended"
— Buckminster Fuller
— Buckminster Fuller
- emihaumut
- Regular
- Posts: 158
- Joined: Fri Jun 27, 2008 12:19 pm
- Projects: Rynspyr.
- Tumblr: emihaumut
- Github: yeewai
- Contact:
Re: Battle Engine - Alpha 3 release, downloads in first post
Thanks for the quick reply! Time for another silly question, lol, where would I call the image?
Re: Battle Engine - Alpha 3 release, downloads in first post
To make it so a particular animation plays just when you attack, you'll need to do a little bit more work, unfortunately - I'm trying to find a really neat way of making this easy for the user to set up, which is why I've not got around to writing a demo for it. Presently, you'll want to do something like this:emihaumut wrote:Thanks for the quick reply! Time for another silly question, lol, where would I call the image?
After declaring the BattleSprite for your fighter, before actually creating the Fighter using that sprite, add a line like this:
Code: Select all
fighterSprite.AddStateTransition('default', 'melee', 'attack animation', 2)
Basically, as the fighter does stuff, various state-change events are sent to the sprite, changing it between states like "moving", "melee", or if they're not doing anything particular, "default". If you call 'AddStateTransition', it adds an animation that plays whenever the sprite is changed from one state to another... so here, we're adding an animation that plays whenever the fighter moves from "default" (doing nothing) to "melee" (making an attack).
Alternatively, if you have a continuous animation for your attacks, like firing a machine gun, you might want to simply:
Code: Select all
fighterSprite.AddStateSprite('melee', 'attack animation')
If you want to know which states are being used and changed between, then:
- uncomment lines 171 and 192 of engine-display.rpy (change the "#print" to "print")
- run Ren'Py with the 'console.exe' in the Ren'Py folder (assuming you're on Windows)
the state transitions it attempts to find and the transitions it uses will be printed out to the console window that gets opened at the same time as the Ren'Py launcher, in a form a bit like this:
Code: Select all
Looking for transition from default to melee
Found transition from default to melee
Looking for transition from melee to default
No transition found.
Server error: user 'Jake' not found
- emihaumut
- Regular
- Posts: 158
- Joined: Fri Jun 27, 2008 12:19 pm
- Projects: Rynspyr.
- Tumblr: emihaumut
- Github: yeewai
- Contact:
Re: Battle Engine - Alpha 3 release, downloads in first post
Hrmmm, the first line of code
didn't seem to work at all for me and the second line
worked, but after the first attack, the animation skips from the first frame to the last.
Code: Select all
fighterSprite.AddStateTransition('default', 'melee', 'attack animation', 2)
Code: Select all
fighterSprite.AddStateSprite('melee', 'attack animation')
Re: Battle Engine - Alpha 3 release, downloads in first post
I'll put some time into checking and writing examples for the state-transition attack animations once I've got the panning work out of the way.
However:
http://lemmasoft.renai.us/forums/viewto ... f=8&t=7860
but it's so far seen no response. You can see the same issue with the spell animations in the various battle demos. If you want to get around it for now, then use the deprecated Animation to define your animations instead of ATL.
If you're not using ATL, then I would examine your Animation declaration and double-check that you're not accidentally setting it up wrong, make sure you've got looping set, etc.
However:
If you're using ATL for your animation, I'm pretty sure is a Ren'Py bug. I started a thread about it here:emihaumut wrote:but after the first attack, the animation skips from the first frame to the last.
http://lemmasoft.renai.us/forums/viewto ... f=8&t=7860
but it's so far seen no response. You can see the same issue with the spell animations in the various battle demos. If you want to get around it for now, then use the deprecated Animation to define your animations instead of ATL.
If you're not using ATL, then I would examine your Animation declaration and double-check that you're not accidentally setting it up wrong, make sure you've got looping set, etc.
Server error: user 'Jake' not found
- emihaumut
- Regular
- Posts: 158
- Joined: Fri Jun 27, 2008 12:19 pm
- Projects: Rynspyr.
- Tumblr: emihaumut
- Github: yeewai
- Contact:
Re: Battle Engine - Alpha 3 release, downloads in first post
Alright, thanks. Using Animation() worked. I thought it was weird that it'd work once and then fail, so I'm going to assume it is renpy at fault too.
Re: Battle Engine - Alpha 3 release, downloads in first post
I had a look - the problem was that I'd told you the wrong starting state. As a fighter acts he's first put into the 'acting' state, so if a skill changes his state the transition will be from 'acting' to (in this case) 'melee', not from 'default' to 'melee'. For a quick-and-dirty example, if you put the following into line 202 of the grid_demo.rpy file (just after 'bobSprite' is defined):Jake wrote:I'll put some time into checking and writing examples for the state-transition attack animations once I've got the panning work out of the way.
Code: Select all
bobSprite.AddStateTransition('acting', 'melee', treeSprite, 1)
(If you're using facings, then you can also specify the 'fromFacing' and 'toFacing' parameters to that, so you can provide animations for attacking in different grid directions or for turning between moves or whatever... but I seem to recall in your thread you'd said something about not wanting to have to do a million animations, so I'm guessing you're probably using the SimpleBattlefield?)
Server error: user 'Jake' not found
Re: Battle Engine - Alpha 3 release, downloads in first post
Hun... so I've been trying to code the battles in the past few days but I haven't got any luck so far . Guess I'm still a newbie at this...
So I want to code a battle like the "active_demo" one. What should I copy/paste and what should I modify?
Everything I do only seems to make new errors to pop-up .
So I want to code a battle like the "active_demo" one. What should I copy/paste and what should I modify?
Everything I do only seems to make new errors to pop-up .
- usul
- Veteran
- Posts: 415
- Joined: Mon Oct 29, 2007 12:35 pm
- Projects: Teachings of the Buddha, System-Addict, Generation XxX
- Location: Quebec
- Contact:
Re: Battle Engine - Alpha 3 release, downloads in first post
I started putting in a background and character sprite and thought I'd share it with you.
"The universe is non-simultaneously apprehended"
— Buckminster Fuller
— Buckminster Fuller
Re: Battle Engine - Alpha 3 release, downloads in first post
Usul - it's looking interesting! Thanks for sharing.
I would recommend starting with the assets.rpy and activedemo.rpy files, and copying that into a new file in your game. Then take the 'audio', 'gfx' and 'scenery' folders, and all the .rpy files starting with 'engine', and put those into your game folder as well. (Personally, I'd recommend creating a new folder called 'engine' and putting the engine*.rpy files in there, to keep them separate).
From there, see if you can run the active demo in your game folder by doing a 'jump active_demo' from somewhere in your game. Once you've got that far, backup your work so far so that you can easily get back to that point, and start making small changes to things like fighter names and stats to see how the changes you make reflect in-game. You can change the graphics and sound effects by editing assets.rpy.
If you have any specific questions, feel free to either ask them here or PM me.
Unfortunately, I've not got around to documentation yet, meaning that the demos are really it for the moment...Abeiramar wrote:Hun... so I've been trying to code the battles in the past few days but I haven't got any luck so far :? . Guess I'm still a newbie at this...
So I want to code a battle like the "active_demo" one. What should I copy/paste and what should I modify?
I would recommend starting with the assets.rpy and activedemo.rpy files, and copying that into a new file in your game. Then take the 'audio', 'gfx' and 'scenery' folders, and all the .rpy files starting with 'engine', and put those into your game folder as well. (Personally, I'd recommend creating a new folder called 'engine' and putting the engine*.rpy files in there, to keep them separate).
From there, see if you can run the active demo in your game folder by doing a 'jump active_demo' from somewhere in your game. Once you've got that far, backup your work so far so that you can easily get back to that point, and start making small changes to things like fighter names and stats to see how the changes you make reflect in-game. You can change the graphics and sound effects by editing assets.rpy.
If you have any specific questions, feel free to either ask them here or PM me.
Server error: user 'Jake' not found
Re: Battle Engine - Alpha 3 release, downloads in first post
Nice wizard sprite =)usul wrote:I started putting in a background and character sprite and thought I'd share it with you.
- usul
- Veteran
- Posts: 415
- Joined: Mon Oct 29, 2007 12:35 pm
- Projects: Teachings of the Buddha, System-Addict, Generation XxX
- Location: Quebec
- Contact:
Re: Battle Engine - Alpha 3 release, downloads in first post
How do you change the state when the character is hurt (damage). There's no perform action for that is there?
"The universe is non-simultaneously apprehended"
— Buckminster Fuller
— Buckminster Fuller
Re: Battle Engine - Alpha 3 release, downloads in first post
Not right now, no - although I probably ought to add a built-in state for it, really.usul wrote:How do you change the state when the character is hurt (damage). There's no perform action for that is there?
In the meantime, you can do it yourself with an Extra, something along the lines of:
Code: Select all
class DamageState(Extra):
def __init__(self, offset=(0,0)):
self._offset = offset
def FighterDamage(self, fighter, damage):
if (damage > 0):
fighter._battle.ChangeFighterState(fighter, "damage")
fighter._battle.ChangeFighterState(fighter, "default")
(Damage less than 0 is actually a healing effect, so it would seem odd to have the hurt anim play when he gets healed!)
Server error: user 'Jake' not found
- usul
- Veteran
- Posts: 415
- Joined: Mon Oct 29, 2007 12:35 pm
- Projects: Teachings of the Buddha, System-Addict, Generation XxX
- Location: Quebec
- Contact:
Re: Battle Engine - Alpha 3 release, downloads in first post
If it's not built in, then something's really weird!! I declared a 'damage' sprite in my game script while trying to figure out where I should add this state, but when I was testing the game, to my surprise the damage sprite was in effect when the character was hit. Perhaps you already built it in and forgot about it!?! Anyhow, declare a sprite that responds to the 'damage' state and you don't need to do anything more!! (in the isometric grid, haven't tested the others).
Here's the pic to prove it, the Warlock just took a hit of Aqua from the water elemental.
Here's the pic to prove it, the Warlock just took a hit of Aqua from the water elemental.
"The universe is non-simultaneously apprehended"
— Buckminster Fuller
— Buckminster Fuller
- usul
- Veteran
- Posts: 415
- Joined: Mon Oct 29, 2007 12:35 pm
- Projects: Teachings of the Buddha, System-Addict, Generation XxX
- Location: Quebec
- Contact:
Re: Battle Engine - Alpha 3 release, downloads in first post
I just realized something about the combat system in the Game Engine, fighters and enemies never miss. Will you be integrating a system where you take into account each character's stats (such as agility, attack, defense) to test whether or not each attack hits or misses? Because right now its pretty much a gamble on which character does the most damage, and how many hit points you have going for you.
"The universe is non-simultaneously apprehended"
— Buckminster Fuller
— Buckminster Fuller
Who is online
Users browsing this forum: No registered users