Module: FadingThings

Started by Lazarus, Thu 26/10/2006 09:51:51

Previous topic - Next topic

Lazarus

This module will be replacing my previous module called "Fading Objects & Characters" as I've now updated it.

This module will now Fade in/out Objects, Characters and Gui's

FadingThings.zip
Current version:- 2.25

Requirements:- AGS 2.70 +

This module uses the script O-names for all the commands.

This Module is for fading Objects, Characters & Gui's with a blocking function, in that you have to wait for these functions to finish before something else happens.

Commands:-
Code: ags

FadeObjectOut(oWax, 100, 1);
FadeObjectIn(oWax, 0, 1);

FadeCharacterIn (cEgo, 0, 1); 
FadeCharacterIn (cEgo, 0, 1, 100, 150); 
FadeCharacterOut (cEgo, 100, 1); 

FadeGuiOut(gMaingui, 100, 1);
FadeGuiIn(gMaingui, 0, 1);


TRANSPARENCY: -
Fade Objects, Gui's & Characters In/Out by value which can be any value between 0 and 100.
0 = visible
50 = ghost
100 = invisible

SPEED: -
Set speed of Fading can be set from 1 upwards, setting 0 (Zero) or minus numbers will default to one.
-10 = Defaults to 1
   0 = Defaults to 1
   1 = normal
   2 = slow
   3 = slower etc..
-----------------------------------------------------------------------
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.

*Edit*
With regards to the player Character if it's transparency = 100
they will stay in the current room totally invisible.

-----------------------------------------------------------------------

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.

FadeObjectOut(oWax, 100, 1);
Will fade out the object totally invisible with normal speed.

FadeObjectIn(oWax, 0, 1);
Will fade in the object totally visible using normal speed.
-----------------------------------------------------------------------

CHARACTERS: -
If characters are 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 you can have that character to start in room (-1) and just use the FadeCharacterIn function and all transparencies are dealt with e.g.

Commands:-
FadeCharacterIn (cEgo, 0, 1);
This will fadein character EGO totally visible using normal speed.

Also you can set where if needed the X and Y position 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 (cEgo, 0, 1, 100, 150);

This will fadein character EGO totally visible using normal speed and place the character at the new given co-ordinates.
-----------------------------------------------------------------------

GUI's
Added the ability to fade in/out gui's

Commands:-
FadeGuiOut(gMaingui, 100, 1);
Will fade out the gui totally invisible with normal speed.

FadeGuiIn(gMaingui, 0, 1);
Will fade in the gui totally visible using normal speed.
-----------------------------------------------------------------------
-----------------------------------------------------------------------

Version History:

2.25 Added check so zero or negative numbers for Speed defaults to one.

2.24 Renamed module from "Fading Objects & Characters" to "FadingThings".

2.23 Added functions for fading Gui's in/out.
*Currently using AGS Editor 2.70 (Build 2.70.601)*

Dave Gilbert

Awesome!  My game has lots of ghosts in it, so this will definitely come in handy.

gypsysnail

Double awesome!! Mine will have ghosts and a few other fading things including fading steps! Exiting! Thank you for this module, definitely will use it and put you in the credits, Lazarus. :)
Believe in afterlife! It's true in a metamorphical way ;)
Ken & Roberta - my inspiration!! 20 years.
U are what you love doing and passionate about - keep up what you love most.

Candle


Lazarus

Thanks for the replies.

Hopefully coming soon.

I'm in the process of fixing some bugs for my other module which will be "FadingThingsNonBlocking"

The module will allow for upto and including 500 different Objects, 500 different Characters and 500 different Gui's to be faded in/out simultaneously or staggered with the timer control. PER ROOM
*Currently using AGS Editor 2.70 (Build 2.70.601)*

monkey0506

Well the current limit is 20 objects per room...so...that doesn't really make much sense. Also, why make a new module instead of just adding an optional BlockingStyle parameter to control whether the functions block?

Joe

Hey good module! ;)

A simple thing really useful, thanks, good mind yours! :)
Copinstar © Oficial Site

strazer

Quote from: monkey_05_06 on Fri 27/10/2006 09:34:56Also, why make a new module instead of just adding an optional BlockingStyle parameter to control whether the functions block?

Agreed. I'll wait for an updated version before I move this to the Tech Archive.

Lazarus

This module will be the final version unless there is any problems.

The FadingThingsNonBlocking will be a seperate module that can be used along side of this module.(They are not dependant on each other).

It will have the ability to have a better speed control (minus figures to speed up or postive numbers to slow down.

A timer control to allow staggered fading ie.. if an object is say two seconds into fading you can the start another object, character or Gui to fade. Or to have all objects, Characters and Gui's to fade at the same time.

Still in the testing stages until I am happy it's okay to release.
*Currently using AGS Editor 2.70 (Build 2.70.601)*

strazer

#9
Hm, I'm really torn. People seem to like this but blocking fades are so easy to do in script so I don't see why this needs to be a module. We have so many modules in the Tech Archive already so please don't be angry if I don't move it there.

Edit:

Btw, I've just noticed that you already had a fading module in Tech Archive as part of your "3 Different Modules" post. I like them to be separate, but in the future, please use your old threads for updated versions of your modules.

SSH

It kind of emphasises the need for a module section in the "games" database...
12

SMF spam blocked by CleanTalk