click head, feet, belly etc

Started by spook1, Wed 15/03/2006 10:05:40

Previous topic - Next topic

spook1

Is there a way to make specific regions of a character clickable?
E.g. make character touch his hair, feet, etc.
Look at different parts of the body.
To be more specific, I need this for interaction with a vehicle which is defined as a character.
I create some function Check_clicked_spot(), but now I started wondering if such a thing is already by default available in AGS.

regards,

Martijn

Ashen

No, AFAIK this can't be done by default.
I know what you're thinking ... Don't think that.

hedgefield

I was thinking the same thing just recently! E.G. for shoot-outs, you know, head shot, kneecaps, stuff like that  ;D

DoorKnobHandle

#3
For shoot-out sequences you'll have to do so much scripting by yourself, that you might as well add those "character zones" to your script manually.

For the sake of the original question: add a "run script" interaction to the "on any mouseclick" trigger of your character and add something like this:

Code: ags

if ( mouse.y > ( character[CHAR].y - ( CHAR_HEIGHT / 3 ) ) )
{
   // if player clicked on the lower third of the character
}

else if ( mouse.y > ( character[CHAR].y - CHAR_HEIGHT + ( CHAR_HEIGHT / 3 ) )
{
   // if player clicked on the middle third of the character
}

else
{
   // if player clicked on the upper third of the character
}


This should work - just remember to replace the "CHAR" with the script name of the character that you want to perform this script on and "CHAR_HEIGHT" with the size of this character along the y-axis (it's height) in pixels.

SMF spam blocked by CleanTalk