Fighting Style

Started by Red_Armadillo, Fri 21/11/2003 07:23:34

Previous topic - Next topic

Red_Armadillo

How would I put in a fighting move when you click on an enemy?
PEPSI kicks Coca~Cola's Butt!

After

#1
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.

Reno Caspain

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
}

scotch

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.

Red_Armadillo

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?
PEPSI kicks Coca~Cola's Butt!

After

character[ENEMY].room=-1;

Red_Armadillo

Thanks After, one final question, how would i make it so when they see me they shoot?
PEPSI kicks Coca~Cola's Butt!

Scummbuddy

perhaps use a region, and if the main char is on a region, engage the shooting
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Red_Armadillo

PEPSI kicks Coca~Cola's Butt!

SMF spam blocked by CleanTalk