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.
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.)
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...
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.
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.
- 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
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.
Peblo Custom ratings must be 50 characters or less
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?"