Hey guys, I have a WORKING simple combat system that where you click on the enemy and the hero throws a punch. I have the code under "any click on character," however it doesn't work when the cursor is in Walk mode. How do I change it so that it does?
I'd like to have it so that when you click on the zombie the hero throws a punch, even in Walk mode. As it is it only works in the other modes, which means you have to cycle through to the walk mode to move and then back to any other mode to fight, which works okay, it's just akward (plus the zombie gets many free hits while you're fiddleing with the mouse trying to cycle back to hit him.) I suppose I could put it under a key press, I'd just much rather not involve the keyboard if possible.
Here's my code, if anyone's interested. Once I figure out how to arm weapons I'll post the whole thing so that other noobie people like myself can use it.
// script for character3: Any click on character
if (character[BIFFY].x > character[ZOMBIE].x){
SetGlobalInt(15,1);//hero's attack variable
AnimateCharacter (2,5,3,0);//hero throws punch
PlaySound (7);}
if (character[BIFFY].x < character[ZOMBIE].x){
SetGlobalInt(15,1);//same as above but the punch is in the other direction
AnimateCharacter (2,4,3,0);
PlaySound (7);}
I'd like to have it so that when you click on the zombie the hero throws a punch, even in Walk mode. As it is it only works in the other modes, which means you have to cycle through to the walk mode to move and then back to any other mode to fight, which works okay, it's just akward (plus the zombie gets many free hits while you're fiddleing with the mouse trying to cycle back to hit him.) I suppose I could put it under a key press, I'd just much rather not involve the keyboard if possible.
Here's my code, if anyone's interested. Once I figure out how to arm weapons I'll post the whole thing so that other noobie people like myself can use it.
// script for character3: Any click on character
if (character[BIFFY].x > character[ZOMBIE].x){
SetGlobalInt(15,1);//hero's attack variable
AnimateCharacter (2,5,3,0);//hero throws punch
PlaySound (7);}
if (character[BIFFY].x < character[ZOMBIE].x){
SetGlobalInt(15,1);//same as above but the punch is in the other direction
AnimateCharacter (2,4,3,0);
PlaySound (7);}