The Daily Click ::. Forums ::. Klik Coding Help ::. 2 player character select
 

Post Reply  Post Oekaki 
 

Posted By Message

Matt Gardner



Registered
  07/10/2002
Points
  14
26th April, 2005 at 16:10:37 -

Is there any way to change an object's qualifiers in the middle of a game?

I'm planning on a two player game with a character select, and the actual sprites are independant of most of the actions, they're just pasted over the objects that detect everything.

I'm wanting to change the qualifiers of the sprites so I could have it set a graphic as player 1 or player 2 without having to make a seperate animated sprite of the same character for each player.
(Instead of changing the objects animations directly in the event editor it would just change the animation of the 'controled by player 1' group or something like that.)

And if anyone has any suggestions on other ways to pull that off, please let me know.

 
It's Gravy!

JJames



Registered
  22/04/2005
Points
  15
26th April, 2005 at 16:27:39 -

Let me get this straight, are you trying to make a platformer (or something similar) two player game? Well in any case...

I don't believe you could change qualifiers in middle of a game but instead, I think you'd best use flags or counters, or, if you're gonna do this over multiple frames, global values. (Or set a global counter, which is an easy way of increasing your global values by one. ) Also, you could use an active object's Alterable Vaules. (Yet another way of increasing the global vaules.)

 
n/a

Matt Gardner



Registered
  07/10/2002
Points
  14
26th April, 2005 at 16:47:58 -

Well, I guess I could add something that checks if a sprite's variable (IsControlledBy or something like that) is equal to whichever number represents the player the event is regarding (let's say... 1), that way I could have it set the Group.sprite animation, but it'll only affect the one where IsControlledBy variable = 1...

Does it work that way?

That'd be a lot of things to paste into events, but it'd still save the filesize from doubling due to having two copies of every sprite.

Or am I even explaining my thoughts well enough to understand, I tend to ramble...

 
It's Gravy!

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
3rd May, 2005 at 21:14:00 -

If you want a character select, you could set aside a few global values (depending on the number of characters you have) and when you choose the character you'd like to play with, have the game test what the global value is. You would have to create an event that will test each global value, but thats not too hard at all. It just takes a few minutes of coding.


I think this will help if its what you were looking for.

 
Image
http://www.kevinhaag.ca

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
3rd May, 2005 at 22:51:24 -

Heres what u do set aside 2 global values for character select lets just say 0 and 1. And player 1 sprites are group GOOD and player 2 sprite are group NEUTRAL.

Begin level
- match global 0 to all objects in group GOOD like 0=wizard 1=fighter then turn on the appropriate sprite's flag 0.
- match global 1 to all objects in group NEUTRAL like 0=wizard 1=fighter then turn on the appropriate sprite's flag 0.
- now whenever you animate or position a sprite simply make sure to check "group GOOD flag on 0" for player 1 and "group NEUTRAL flag on 0" for player 2

And no you can't change qualifiers in the middle of a game

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
4th May, 2005 at 00:42:29 -

You could just set the player control by flag rather than qualifiers. You know, instead of all the Player 1 characters being controlled by Qualifier.good, just set it so that if Flag 1 is on, then character is controlled by Player 1. If Flag 2 is on, then character is controlled by Player 2.

Just make sure that both aren't on at the same time. But then again, it's not a bad idea..

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
4th May, 2005 at 01:39:27 -

Or you could preset the qualifiers ahead of time, if you like to be inefficient.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
   

Post Reply



 



Advertisement

Worth A Click