Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, Aku_Aku, 7th_zorro, Ayumi), 1,080 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Kingdom Hearts Movement - LMB & RMB combo #293827
10/14/09 06:16
10/14/09 06:16
Joined: Aug 2009
Posts: 13
W
WoYoSensei Offline OP
Newbie
WoYoSensei  Offline OP
Newbie
W

Joined: Aug 2009
Posts: 13
Hi
I try modify a little this code by adding a LMB & RMB combination (LMB - left mouse button, RMB - right mouse button). I have something like this:


player.c

Code:
if(mouse_left == 0 && mouse_left_press == 1)		mouse_left_press = 0;
		if(mouse_left == 1 && mouse_left_press == 0 && my.animblend >= stand) 
		{
			mouse_left_press = 1;
			my.blendframe = punch_a;
			if(my.jumping_mode == 1) 	airborne_punch = 1;
			else								airborne_punch = 0;
			my.movement_mode = 1;
			combo_continue = 0;
		}
		if(mouse_right == 0 && mouse_right_press == 1)	mouse_right_press = 0;
		if(mouse_right == 1 && mouse_right_press == 0 && my.animblend >= stand)
		{
			mouse_right_press = 1;
			my.blendframe = punch_f;
			if(my.jumping_mode == 1) 	airborne_punch = 1;
			else								airborne_punch = 0;
			my.movement_mode = 1;
			combo_continue = 0;
		}
	}
	//
	if(my.movement_mode == 1) 
	{
		if(my.jumping_mode != 10)										my.jumping_mode = 0;
		else if(my.animate >= 60 && my.animblend >= stand)		my.jumping_mode = 0;
		//
		if(mouse_left == 0 && mouse_left_press == 1)
			mouse_left_press = 0;
		if(mouse_left == 1 && mouse_left_press == 0 && my.animate >= 30 && combo_continue == 0) 
		{	mouse_left_press = 1; combo_continue = 1; }
		if(mouse_right == 0 && mouse_right_press == 1)
			mouse_right_press = 0;
		if(mouse_right == 1 && mouse_right_press == 0 && my.animate >= 30 && combo_continue == 0) 
		{	mouse_right_press = 1; combo_continue = 2; }
	}
	//
	if(my.movement_mode == 2) 
	{
		my.jumping_mode = 0;
		if(mouse_left == 0 && mouse_left_press == 1)
			mouse_left_press = 0; 
		if(mouse_left == 1 && mouse_left_press == 0 && my.animate >= 30 && combo_continue == 0) 
		{	mouse_left_press = 1; combo_continue = 1; }
		if(mouse_right == 0 && mouse_right_press == 1)
			mouse_right_press = 0; 
		if(mouse_right == 1 && mouse_right_press == 0 && my.animate >= 30 && combo_continue == 0) 
		{	mouse_right_press = 1; combo_continue = 2; }
	}
}



and animation.c

Code:
ent_animate(my,"punch_b",100,0);
				my.animate = 100;
				my.blendframe = stand;
				if(my.moving == 1) 
				{
					if(key_shift == 1)		my.blendframe = walk;
					else							my.blendframe = run; 
				}
				if(combo_continue == 1) 
				{
					combo_continue = 0;
					my.blendframe = punch_c;
				}
				else
					my.movement_mode = 0;
				if (combo_continue == 2)
				{
					combo_continue = 0;
					my.blendframe = punch_f;	
				}
				else
					my.movement_mode = 0;
				
			}



How`s it working? Not working, that`s a problem... Well, it should be working something like this:
when I have a punch_b animation and press LMB, then combo_continue = 1 and play animation punch_c, and when I press RMB then set combo_continue = 2 and play animation punch_f, after that finish the sequence. It`s simple, but I don`t know why it`s not working smirk Can anybody help me resolve this problem? Thank you and sorry for my english. I hope you can understand me.

Last edited by WoYoSensei; 10/14/09 06:25.
Re: Kingdom Hearts Movement - LMB & RMB combo [Re: WoYoSensei] #293883
10/14/09 15:20
10/14/09 15:20
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

A suggestion :

add {...} Winged brackets to enclose instruction lists in your
if

They are not needed if you have one instruction. In your code you have
more than one line of instructions per if

as in
else
airborne_punch = 0;
my.movement_mode = 1;
combo_continue = 0;


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: Kingdom Hearts Movement - LMB & RMB combo [Re: Ottawa] #294315
10/18/09 09:59
10/18/09 09:59
Joined: Aug 2009
Posts: 13
W
WoYoSensei Offline OP
Newbie
WoYoSensei  Offline OP
Newbie
W

Joined: Aug 2009
Posts: 13
It`s working but... not working... I mean, it`s working only when I hold one of mouse button and one of movement keys after second animation - punch_b. But it`s not working anyway... pls help. I`m stuck...

Re: Kingdom Hearts Movement - LMB & RMB combo [Re: WoYoSensei] #294332
10/18/09 14:14
10/18/09 14:14
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Are you using all the code that is posted?
Are you trying to modify it?

My suggestion is to make the code work before you try to modify it?


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: Kingdom Hearts Movement - LMB & RMB combo [Re: Ottawa] #294345
10/18/09 15:54
10/18/09 15:54
Joined: Aug 2009
Posts: 13
W
WoYoSensei Offline OP
Newbie
WoYoSensei  Offline OP
Newbie
W

Joined: Aug 2009
Posts: 13
No, no, no. I give you the link in my first post. This is Original Kingdom Hearts Movement code converted from A6 to A7. Here is the link: http://www.coniserver.net/wiki/index.php/Original_Kingdom_Hearts_Movement

Re: Kingdom Hearts Movement - LMB & RMB combo [Re: WoYoSensei] #295021
10/22/09 15:21
10/22/09 15:21
Joined: Aug 2009
Posts: 13
W
WoYoSensei Offline OP
Newbie
WoYoSensei  Offline OP
Newbie
W

Joined: Aug 2009
Posts: 13
Anybody can help me resolve this problem?

Re: Kingdom Hearts Movement - LMB & RMB combo [Re: WoYoSensei] #295077
10/22/09 21:19
10/22/09 21:19
Joined: Oct 2009
Posts: 33
A
AlexH Offline
Newbie
AlexH  Offline
Newbie
A

Joined: Oct 2009
Posts: 33
I think before you try to resolve this silly little "problem" you're having you should first understand the code you're trying to modify. Try to rebuild the Movement system in your own project, for two reasons:

1.) You'll know exactly how it works because you made it and won't have to ask everyone else for help every time you come to a problem with modifying it.

2.) The given Movement example is coded rather poorly not to mention slightly outdated functions/variables used in it.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1