Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help please #219829
08/04/08 21:11
08/04/08 21:11
Joined: Dec 2004
Posts: 11
J
Jonah Offline OP
Newbie
Jonah  Offline OP
Newbie
J

Joined: Dec 2004
Posts: 11
I have two playable characters in my game, which the player is supposed to be able to switch between (EDIT: By pressing Q or E). If the variable jchar = 0, you play as character 1, if jchar = 1, you play as character 2. For some reason, i can't get it to work. I have an entity with this action:
Code:
ACTION character_control {
		IF (jchar == 0){
			IF (key_q == 1){
			jchar = 1;
		}
		}
		ELSE {
			IF (key_e == 1){
				jchar = 0;
		}
	}
}

But when i press Q or E, nothing happens. What could be the problem?

Last edited by Jonah; 08/04/08 22:52.
Re: Help please [Re: Jonah] #219831
08/04/08 21:19
08/04/08 21:19
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline
Senior Member
xbox  Offline
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
Here are is a possible setup that should work if you did it right.

player 1 char_changer player 2
0 _______ 0
| | | |
A |_____| A

All player 1 should have to do is walk into the "changer" and press q and will become player 2

make sure that the player actions have jchar defined in them, other wise it will do nothing.

Re: Help please [Re: xbox] #219832
08/04/08 21:19
08/04/08 21:19
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline
Senior Member
xbox  Offline
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
sorry about the above picture.

Re: Help please [Re: xbox] #219833
08/04/08 21:28
08/04/08 21:28
Joined: Dec 2004
Posts: 11
J
Jonah Offline OP
Newbie
Jonah  Offline OP
Newbie
J

Joined: Dec 2004
Posts: 11
Actually both characters are in the level the same time, you just change which one you control.
EDIT: Got it to do something, now it causes the game to crash.
Here's the current code:
Code:
FUNCTION change_chars() {
	IF (jchar == 0) {
			jchar = 1;
	}
ELSE {
			jchar = 0;
	}

}

ACTION character_control {
				on_q = change_chars();
}


Last edited by Jonah; 08/04/08 22:40.

Gamestudio download | 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