How would I put in a fighting move when you click on an enemy?
AGS Help*>Text script functions>Character functions.
AnimateCharacter will likely suit.
*Use program menubar or just open the .chm file.
The character interaction editor is prolly the easiest way to trigger it.
Under the appropriate interaction, have something like,
MoveCharacter(EGO,character[ENEMY].x,character[ENEMY].y);
while(character[EGO].walking){Wait(1);}
if(AreCharactersColliding(EGO,ENEMY)){AnimateCharacter(EGO,attackViewNum);}
That may not work as is (I haven't tried that sort of thing myself), and isn't very realistic, but it's something to fiddle with.
I don't remember the exact command for getting the coordinates, but here's the main idea: I'd get the cursor y-coordinate, and compare it to the y-coordinate of the character clicked. Then add the fighting move to the character interaction on whatever cursor mode you use for fighting.
For example:
if (cursor y-axis - clicked character y-axis) < 10
{
//low punch/kick here
}
elseif ((cursor y-axis - clicked character y-axis) > 20) && ((cursor y-axis - clicked character y-axis) < 40)
{
//middle punch/kick here
}
elseif (cursor y-axis - clicked character y-axis) < 10
{
//high punch/kick here
}
mouse.x and mouse.y give the x and y coords of the mouse
character[charid].x and character[charid].y give the x and y coords of a character.
So... I would make a string of character moves enter in the above code and set the y and x coordinates? Then to kill the character what code would I use?
character[ENEMY].room=-1;
Thanks After, one final question, how would i make it so when they see me they shoot?
perhaps use a region, and if the main char is on a region, engage the shooting
Okay, thanks.