sorry just a scripting issue that always confuses me

Hi im new to panda3D and i couldnt find any threads on this. How would i go about doing an attack combo? I would like to map multiple attacks to the same keys to make gameplay easier for the user. What i mean is i would like to use one key, like the spacebar for example so you would have to tap the spacebar multiple times to complete an attack combo. I learned alot from the python sample scripts that came with the game but i dont think they touch this issue. I apologize if this question has been asked before. I searched the forums but i honestly would know the right words to look up. If there is already a thread like this and you would rather not answer the same question over again, i’d appreciate it if you directed me to the thread or gave m som helpful keywords i could look up.

Thank you for your time.

pretty simple. you could add a variable. lets say comboState = 0
if you attack. check the comboState variable. if its 0 play attack1 and increase comboState by 1. if comboState has the value 1 , play attack2 and increase by 1 again … and so on…
once the combo ended or the combo breaks, set the comboState to 0 again.

Thank you i always come across this problem in every game engine. I really appreciate this information.

One more thing. Does the panda engine blend animations together? Would my character smoothly transition back to the default pose if i were to stop in the middle of a combo?

it can blend animations as far as i know. i never used this function thought. animation features in blender are quite awsome :slight_smile: you can even blend multiple animations of single body-parts if i remember correctly.

EDIT: see the manual :slight_smile: -> https://www.panda3d.org/manual/index.php/Actor_Animations

If i were to make combo state equal 1, how would i define how long it equaled 1 before it equaled 0 again?

you could create a task which does that for you.
a do-later task would suit this purpose.
https://www.panda3d.org/manual/index.php/Tasks

create a do-later-task when you increase the value, but be sure to delete all previously created ones.

there might be a few more ways to do this. but thats the first one which comes to my mind :slight_smile:

Thank you, i think i understand now.

Another thing. When i press the key down to increase the combo state by 1 will it continue to increase if i hold the key down or will it only increase each time i hit the key?

best way to find out is to just try it!

use little print statements to see what is going on.

My workspace is full of scripts where i try a new features all by itself then integrate it into my game.

You can just create a simple file with :

import panda ...
base.accept('a',presA)
def pressA():
     print "pressed a"
run()

for testing.