Firstly a big thank you to Ashen with helping me with this module.
Fading Objects, Characters & Gui's Non Blocking.
FadingThingsNonBlocking.zip Current version 2.29
Requirements:- AGS 2.70 +
This Module is for fading objects, characters & Gui's Non Blocking function, in that you don't have to wait for these functions to finish before something else happens.
So you can fade in or out an object while messages are spoken for example.
-----------------------------------------------------------------------
This module allows for upto and including 50 different Objects, 300 different Characters and 50 different Gui's to be faded in/out simultaneously or staggered with the timer control. (Per Room)
This is reset PER ROOM.
At the moment the current ags limits are:
20 objects per room
300 characters
50 GUIs
-----------------------------------------------------------------------
This module uses the script O-names for all the commands.
-----------------------------------------------------------------------
Command examples:-
Code: ags
-----------------------------------------------------------------------
Objects & Gui's with a transparency of 100 will be turned off automatically
NPC Characters with a transparency of 100 will be moved to Room (-1). But NOT the player Character.
-----------------------------------------------------------------------
VALUE = Transparency: -
Fade Objects, Characters & Gui's In/Out by value which can be any value between 0 and 100.
0 = visible
Any number between = ghosting
100 = invisible
-----------------------------------------------------------------------
SPEED: -
Setting the speed of fading.
-20 = Even Faster etc..
-1 = Fast etc..
0 = normal
1 = slow
2 = slower
3 = even slower etc..
-----------------------------------------------------------------------
TIMER:-
Timer is like a fuse on a bomb in that say you entered the figure 250, this will count down to 0 (zero) and then execute the command.
Entering the number 0 (zero) will execute straight away. (You cannot enter minus figures).
Also if you don't need the timer but want to use the new coordinates then just enter 0 (zero) for the timer.
-----------------------------------------------------------------------
OBJECTS: -
Objects now don't need to be ticked visible and have transparency set to 100 before use.
Instead you can leave the objects unticked so they are turned off, and then just use the FadeObjectIn function
as turning an object on is dealt within the function.
The FadeObjectOut function now turns objects OFF automatically if transparency = 100.
Commands:-
FadeObjectIn_NoBlock(oWax, 0, 0, 250);
Will fade the object Wax in, totally visble,speed normal with a 250 timer delay.
-----------------------------------------------------------------------
CHARACTERS: -
If characters are already starting in room 5 for example you will have to set that characters transparency
in that room, using a run-script under (Before Fadein) e.g.
character[EGO].Transparency =100; // Invisible
or
cEgo.Transparency = 100; // Invisible
Or you can have that character to start in room (-1) or from another room and just use the FadeCharacterIn function
and all transparencies are dealt with e.g.
Commands:-
FadeCharacterIn_Noblock (cEgo, 0, 0);
This will fadein character EGO totally visible using normal speed.
Also you can set where if needed new X and Y positions of a character when fading in,
this is an optional command, so you don't need to set these if you want to use the previous coordinates.
e.g.
FadeCharacterIn_Noblock (cEgo, 0, 0, 0, 100, 150);
If you want to use the new coordinates, BUT not the Timer then you must enter a number
for the Timer function like 0 (zero) for immediate executions.
This will fadein character EGO totally visible using normal speed, zero Timer and place the character
at the new given co-ordinates.
Now also if NPC characters are totally invisible (100) they are moved automatically to Room (-1).
-----------------------------------------------------------------------
GUI's
Added the ability to fade in/out gui's
Commands:-
FadeGuiOut_NoBlock(gMaingui, 100, 0);
Will fade out the gui totally invisible with normal speed.
FadeGuiIn_NoBlock(gMaingui, 0, 0, 250);
Will fade in the gui totally visible using normal speed with a delay.
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Version History:
2.29 Changed Max Characters to 300 per room.
2.28 Fixed game pausing while skip cutscene is used, lowered define values of
Objects,Characters and Gui's per room to speed up module.
2.27 Fixed typo error at line #168. (Thanks Scorpiorus).
2.26 Added support of fading in/out of GUI's.
2.25 Changed module name to "FadingThingsNonBlocking".
2.24 Bug Fix - Able to constantly repeate fade in/out of Objects
and Characters under room repeatedly execute.
2.23 Bug Fix - Characters and Objects now fade into current room
properly with Timer function.
2.22 Characters can now use optional new coordinates when
fading in or use orignial coordinates.
2.21 Objects with a transparency of 100 will be turned off
automatically.
2.20 NPC Characters with a transparency of 100 will be moved to
room(-1). But NOT the player Character.
2.19 Characters are now able to be faded in from another room
to player room. No need to set transparency before hand.
2.18 Objects can now be turned on within fade in function.
No need to set transparency before hand.
2.17 Bug Fix - Fading in/out works when game is being skipped,
for example by the enter key.
2.16 Too many things to list.
Fading Objects, Characters & Gui's Non Blocking.
FadingThingsNonBlocking.zip Current version 2.29
Requirements:- AGS 2.70 +
This Module is for fading objects, characters & Gui's Non Blocking function, in that you don't have to wait for these functions to finish before something else happens.
So you can fade in or out an object while messages are spoken for example.
-----------------------------------------------------------------------
This module allows for upto and including 50 different Objects, 300 different Characters and 50 different Gui's to be faded in/out simultaneously or staggered with the timer control. (Per Room)
This is reset PER ROOM.
At the moment the current ags limits are:
20 objects per room
300 characters
50 GUIs
-----------------------------------------------------------------------
This module uses the script O-names for all the commands.
-----------------------------------------------------------------------
Command examples:-
FadeObjectIn_NoBlock(oWax, 0, 0);
FadeObjectIn_NoBlock(oWax, 0, 0, 250);
FadeObjectOut_NoBlock(oWax, 100, 0);
FadeCharacterIn_Noblock (cEgo, 0, 0);
FadeCharacterIn_Noblock (cEgo, 0, 0, 0, 100, 150);
FadeCharacterOut_Noblock (cEgo, 100, 0);
FadeGuiOut_NoBlock(gMaingui, 100, 0);
FadeGuiIn_NoBlock(gMaingui, 0, 0, 250);
-----------------------------------------------------------------------
Objects & Gui's with a transparency of 100 will be turned off automatically
NPC Characters with a transparency of 100 will be moved to Room (-1). But NOT the player Character.
-----------------------------------------------------------------------
VALUE = Transparency: -
Fade Objects, Characters & Gui's In/Out by value which can be any value between 0 and 100.
0 = visible
Any number between = ghosting
100 = invisible
-----------------------------------------------------------------------
SPEED: -
Setting the speed of fading.
-20 = Even Faster etc..
-1 = Fast etc..
0 = normal
1 = slow
2 = slower
3 = even slower etc..
-----------------------------------------------------------------------
TIMER:-
Timer is like a fuse on a bomb in that say you entered the figure 250, this will count down to 0 (zero) and then execute the command.
Entering the number 0 (zero) will execute straight away. (You cannot enter minus figures).
Also if you don't need the timer but want to use the new coordinates then just enter 0 (zero) for the timer.
-----------------------------------------------------------------------
OBJECTS: -
Objects now don't need to be ticked visible and have transparency set to 100 before use.
Instead you can leave the objects unticked so they are turned off, and then just use the FadeObjectIn function
as turning an object on is dealt within the function.
The FadeObjectOut function now turns objects OFF automatically if transparency = 100.
Commands:-
FadeObjectIn_NoBlock(oWax, 0, 0, 250);
Will fade the object Wax in, totally visble,speed normal with a 250 timer delay.
-----------------------------------------------------------------------
CHARACTERS: -
If characters are already starting in room 5 for example you will have to set that characters transparency
in that room, using a run-script under (Before Fadein) e.g.
character[EGO].Transparency =100; // Invisible
or
cEgo.Transparency = 100; // Invisible
Or you can have that character to start in room (-1) or from another room and just use the FadeCharacterIn function
and all transparencies are dealt with e.g.
Commands:-
FadeCharacterIn_Noblock (cEgo, 0, 0);
This will fadein character EGO totally visible using normal speed.
Also you can set where if needed new X and Y positions of a character when fading in,
this is an optional command, so you don't need to set these if you want to use the previous coordinates.
e.g.
FadeCharacterIn_Noblock (cEgo, 0, 0, 0, 100, 150);
If you want to use the new coordinates, BUT not the Timer then you must enter a number
for the Timer function like 0 (zero) for immediate executions.
This will fadein character EGO totally visible using normal speed, zero Timer and place the character
at the new given co-ordinates.
Now also if NPC characters are totally invisible (100) they are moved automatically to Room (-1).
-----------------------------------------------------------------------
GUI's
Added the ability to fade in/out gui's
Commands:-
FadeGuiOut_NoBlock(gMaingui, 100, 0);
Will fade out the gui totally invisible with normal speed.
FadeGuiIn_NoBlock(gMaingui, 0, 0, 250);
Will fade in the gui totally visible using normal speed with a delay.
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Version History:
2.29 Changed Max Characters to 300 per room.
2.28 Fixed game pausing while skip cutscene is used, lowered define values of
Objects,Characters and Gui's per room to speed up module.
2.27 Fixed typo error at line #168. (Thanks Scorpiorus).
2.26 Added support of fading in/out of GUI's.
2.25 Changed module name to "FadingThingsNonBlocking".
2.24 Bug Fix - Able to constantly repeate fade in/out of Objects
and Characters under room repeatedly execute.
2.23 Bug Fix - Characters and Objects now fade into current room
properly with Timer function.
2.22 Characters can now use optional new coordinates when
fading in or use orignial coordinates.
2.21 Objects with a transparency of 100 will be turned off
automatically.
2.20 NPC Characters with a transparency of 100 will be moved to
room(-1). But NOT the player Character.
2.19 Characters are now able to be faded in from another room
to player room. No need to set transparency before hand.
2.18 Objects can now be turned on within fade in function.
No need to set transparency before hand.
2.17 Bug Fix - Fading in/out works when game is being skipped,
for example by the enter key.
2.16 Too many things to list.