A fullscreen overlay of animation
by Bogo Giertler · in Torque Game Engine · 05/14/2009 (10:27 am) · 4 replies
Hi,
I probably have a typical beginner's question - is there any way to add an animation as a fullscreen overlay to the game? I have it ready in SWF format, but at worst I could use a still frames in PNG (it's a series of semitransparent images; I want to use them as a fullscreen health meter, something similar to the Mirror's Edge health concept). I would prefer a Torque Script solution, as I am not allowed to touch the engine part (I'm just a GUI designer).
Also, while it seems easy to manipulate the single bitmaps on the screen, I am looking for a way of delaying the changes (e.g. a 0.5s interval between the load of the splash screen and change of an image), to create a faux animation. Any ideas on how to do that? Or maybe there is a better way of adding animations?
Thank you in advance :)
Bogo
I probably have a typical beginner's question - is there any way to add an animation as a fullscreen overlay to the game? I have it ready in SWF format, but at worst I could use a still frames in PNG (it's a series of semitransparent images; I want to use them as a fullscreen health meter, something similar to the Mirror's Edge health concept). I would prefer a Torque Script solution, as I am not allowed to touch the engine part (I'm just a GUI designer).
Also, while it seems easy to manipulate the single bitmaps on the screen, I am looking for a way of delaying the changes (e.g. a 0.5s interval between the load of the splash screen and change of an image), to create a faux animation. Any ideas on how to do that? Or maybe there is a better way of adding animations?
Thank you in advance :)
Bogo
#2
I have however just one more question.
Firstly, how can I obtain a handle on the character that is being used by the player to probe its health? I looked thru documentation, but cannot really find any answer to that question.
Thank you!
05/18/2009 (10:34 am)
Thank you, Michael! That solved most of my problems.I have however just one more question.
Firstly, how can I obtain a handle on the character that is being used by the player to probe its health? I looked thru documentation, but cannot really find any answer to that question.
Thank you!
#3
Sounds more confusing than it really is. This specific area in the docs may help:
Handles and Names
You can call getControlObject()
When a player is created a "player" field(not a variable) is attached to the object. This field can be referenced by use of the "dot" property
Somewhere in the mix a "client" field is created and can also be referenced in the same manner.
And if you're trying to find out the health information of your player object, and you know who/what the "player" is:
Hopefully that wasn't too much information overload, and maybe some of that even made sense... the question was kind of open-ended ;)
05/18/2009 (2:26 pm)
Quote:There's several different ways of determining this, but it really depends on whether you're trying to find the control object, the object ID, or the .player or .client dynamic fields of an object.
how can I obtain a handle on the character that is being used by the player
Sounds more confusing than it really is. This specific area in the docs may help:
Handles and Names
You can call getControlObject()
%player = %this.getControlObject()Then you can do things to %player. %this is this case could be the client connection or even an object.
When a player is created a "player" field(not a variable) is attached to the object. This field can be referenced by use of the "dot" property
%client.player
Somewhere in the mix a "client" field is created and can also be referenced in the same manner.
And if you're trying to find out the health information of your player object, and you know who/what the "player" is:
%maxDamage = %player.getDatablock().maxDamage; // figure out the max damage by reading the datablock %damageLevel = %player.getDamageLevel(); // get the current amount of damage sustained %curHealth = %maxDamage - %damageLevel; // determine the current amount of health %curHealth = mceil(%curHealth);// get rid of the decimal results to make it human readable
Hopefully that wasn't too much information overload, and maybe some of that even made sense... the question was kind of open-ended ;)
#4
You actually laid it out perfectly clear. So far I was using a nasty hack by attaching my function to the ::onDamage, checking if damage was caused to the bot (by isBot function) and just scheduling the function for screen updates from there on. Thanks to your explanation now I can make a kosher version :D
Thank you!
05/18/2009 (9:41 pm)
Michael, thank you!You actually laid it out perfectly clear. So far I was using a nasty hack by attaching my function to the ::onDamage, checking if damage was caused to the bot (by isBot function) and just scheduling the function for screen updates from there on. Thanks to your explanation now I can make a kosher version :D
Thank you!
Associate Michael Hall
Distracted...
You can find some good information to further help you on the TDN GUI/Getting Started page, there are several resources/references that could be invaluable for what you're wanting to do.