View Full Version : How to make objects disappear and reappear (without using transparency) & other Q's.
MoarDesu
03-30-2007, 08:57 PM
I'm in the works of making a Mortal-Kombat-type game (currently planning character moves, etc.) with pop-culture characters, but I need some questions answered first...
1. Is it possible to create a system where the second player can be an NPC? If so, how? I'd really hate to make it a 2-player only game. :(
Edit: I just found [choose true: probability of true] in Seldom Used Properties. I might be able to mess around with this enough to make this happen, but if anyone has any tips, it would be greatly appreciated. :)
2. Is it possible to make objects disappear from the game (without using transparency) and reappear later? I'd rather not use transparency since I'd think it would bog down a computer having all of what I'm planning up at once.
Edit: ^ Answered.
3. How can I edit skins of characters already in the Alice Gallery?
Edit: ^ Answered.
4. Is there a way to have multiple keys activate a method? (Such as for a cheat code)
Thanks for such a wonderful program. :D
DickBaldwin
03-30-2007, 10:37 PM
You can make an object disappear by setting its isShowing property to false. Set the property value to true later to make it reappear.
Dick Baldwin
MoarDesu
03-30-2007, 11:54 PM
You can make an object disappear by setting its isShowing property to false. Set the property value to true later to make it reappear.
Dick Baldwin
Grazie. :)
Will this help the player's computer any or just make it disappear?
I know what it's like to have bad hardware, so I don't want to make this bad for the player.
Granted, I probably won't be releasing this on the internet that much, but if there's any friends of mine who want to play, I don't want it to slow down the gameplay too much.
DickBaldwin
03-31-2007, 12:43 AM
Well, I really don't know the answer to your question, but I can give my best guess.
Actually, this paragraph is not a guess, this is a fact. Unlike Java and other OOP languages, it is not possible to create or to destroy objects at runtime in Alice. Therefore, any object that you create and add to the world when you originally create the world will be there for the duration of the game, even if some or all of those objects are not needed at some point in the game and are not visible. That means that as a minimum, they will be consuming memory.
Now, this is a guess. Beyond memory consumption, the next question is will the existence of the invisible objects consume processor cycles to any significant degree? If it were me writing the program, as soon as I make an object invisible, I would move it off into a known location somewhere in space far away from the visible scene. That would prevent it from having any physical interaction with any of the objects that are moving around in the scene. My guess is that if you park it far away from the visible scene, it won't have any reason to consume much, if any processor resources while it is parked there. But again, that is just a guess. In any event, even if it doesn't help to move it out into space, it shouldn't hurt.
On the other hand, since Alice does not allow objects to be created or destroyed at runtime, you don't have too many choices. You have to deal with all of the objects somehow whether you currently need them or not. So I believe I would make un-needed objects invisible and park them out in space somewhere. Then when I need them later, I could retrieve them from space and make them visible again.
As a side note, after making the objects invisible, I would probably call the setPointOfView method on each object to align it with the world and then move it out into a known location in space. That way, I would have the ability to bring it back from space later and cause it to land in a specific position relative to the center of the world.
Dick Baldwin
MoarDesu
03-31-2007, 03:39 PM
Well, I really don't know the answer to your question, but I can give my best guess.
Actually, this paragraph is not a guess, this is a fact. Unlike Java and other OOP languages, it is not possible to create or to destroy objects at runtime in Alice. Therefore, any object that you create and add to the world when you originally create the world will be there for the duration of the game, even if some or all of those objects are not needed at some point in the game and are not visible. That means that as a minimum, they will be consuming memory.
Now, this is a guess. Beyond memory consumption, the next question is will the existence of the invisible objects consume processor cycles to any significant degree? If it were me writing the program, as soon as I make an object invisible, I would move it off into a known location somewhere in space far away from the visible scene. That would prevent it from having any physical interaction with any of the objects that are moving around in the scene. My guess is that if you park it far away from the visible scene, it won't have any reason to consume much, if any processor resources while it is parked there. But again, that is just a guess. In any event, even if it doesn't help to move it out into space, it shouldn't hurt.
On the other hand, since Alice does not allow objects to be created or destroyed at runtime, you don't have too many choices. You have to deal with all of the objects somehow whether you currently need them or not. So I believe I would make un-needed objects invisible and park them out in space somewhere. Then when I need them later, I could retrieve them from space and make them visible again.
As a side note, after making the objects invisible, I would probably call the setPointOfView method on each object to align it with the world and then move it out into a known location in space. That way, I would have the ability to bring it back from space later and cause it to land in a specific position relative to the center of the world.
Dick Baldwin
Alright, again, thank you. :)
DrJim
03-31-2007, 08:28 PM
For an answer to your question on changing skins, see the thread http://www.alice.org/community/showthread.php?t=638 .
This is a very useful way to "customize" the Alice objects. :)
MoarDesu
03-31-2007, 09:52 PM
For an answer to your question on changing skins, see the thread http://www.alice.org/community/showthread.php?t=638 .
This is a very useful way to "customize" the Alice objects. :)
Thank you. :)