Gamestudio Links
Zorro Links
Newest Posts
Ranger by Robert Pardo - now for Zorro
by TipmyPip. 06/29/26 13:47
Tradestation Multi-sessions??
by walt_Schwarz. 06/27/26 12:32
Z9 getting Error 058
by jcl. 06/26/26 14:07
ZorroGPT
by TipmyPip. 06/24/26 18:31
Lapsa's very own thread
by Lapsa. 06/20/26 18:18
Z12 live performance
by jcl. 06/19/26 11:21
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 7,268 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Ephraim, Student_64151, Koti, curry, DeepxKalsi
19220 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