Toggling Certain Actions With Keys [SOLVED]

Started by ma2003, Wed 18/06/2008 20:17:52

Previous topic - Next topic

ma2003

Okay, I'm trying to get my character to toggle into a crawling position via a VIEW.

View 3 (standing view)



View 8 (crawling view)



Basically, my character will run around, and I tap SPACE BAR and be able to toggle from standing, to a crawling pose. (ala metal gear solid) or (as another example)... bring out a handgun by tapping and toggling Q (ala Flashback).

I assume a good way to do this is by using Views, and I'm trying to find a way to toggle from view 3 to view 8, and then back to view 3 if I wanted, all by using the same key SPACE BAR (keycode 32).

I believe I have enough knowledge to learn about how this could be done.

I can create a simple crawl mode by doing the obvious:

Code: ags


if (keycode==32) {
 cBob.Lockview(8)
}


However, of course, I can't toggle back to the standing pose by pressing the SPACE BAR.

....if anyone could help out. I would appreciate it very very much. Thank you.





GarageGothic

Code: ags
if (keycode==32) {
 if (cBob.View == 3) cBob.ChangeView(8);
 else if (cBob.View == 8) cBob.ChangeView(3)
}

ma2003

...and you type it like its easy..

It worked, of course. Thanks alot GarageGothic.


SMF spam blocked by CleanTalk