Gamestudio Links
Zorro Links
Newest Posts
webGL
by Ice2642. 11/17/25 21:27
Camera always moves upwards?
by NeoDumont. 11/17/25 09:56
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (SkinnyApe, TipmyPip), 7,662 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
SkinnyApe, tritom, sheliepaley, Blueguy, blobplayintennis
19179 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