Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: Sam. on Sun 16/11/2003 16:11:15

Title: mirror mirror on the wall
Post by: Sam. on Sun 16/11/2003 16:11:15
okay, heres the deal. i asked creed malay about his cool mirror effect on apocolypse meow in the RON sereis. i needed a similar thing for y game but he couldn't really help cos he didn't make it. could any other artsy farstsy person inform me on how to do it? (if u don't know what i mean llook at the bathroom scene) it would be in the same room and everything in davy's house just a different character.
can anyone help a poor lad in distress?
Title: Re:mirror mirror on the wall
Post by: MrColossal on Sun 16/11/2003 16:28:52
try making a new walkable area behind the mirror and adding a walkbehind area over everything in that area but the mirror so the mirror acts as a hole, ya know?

then make a new character that is exactly like the one you want to reflect so you'll have EGO and then like EGOMIRROR

place EGOMIRROR on the walkable area behind the mirror then move him to the players coordinates except subtract 50 from the x value so he is always 50 pixels above the main character

50 is just a random number i picked out of my butt, experimenting will help

so you could either add to the on_click event or the rooms repeatedly execute something like

MoveCharacter(EGOMIRROR, character[EGO].x-50,character[EGO].y,0);

if i'm not totally retarded this should work

the reason i'd add it to the on click even is cause then you don't have to run a check to see if EGO is moving or not

so i'd have:

function on_mouse_click(int button) {

 if (button==LEFT) {
   ProcessClick(mouse.x, mouse.y, GetCursorMode() );
 }
 else {   // right-click, so cycle cursor
   SetNextCursorMode();
 }

 if ((button==LEFT) && (player[EGO].room==theroomwiththemirro)){
   MoveCharacter(EGOMIRROR, character[EGO].x-50,character[EGO].y,0);
 }
}


i hope i know what i'm talking about...

eric
Title: Re:mirror mirror on the wall
Post by: Jodo Kast on Sun 16/11/2003 19:04:02
Thanks Eric!

Saving this one... Quick question:  Is there a way to put a coating on the mirror?  So it shows a reflection of EGO?

I was thinking of darkening EGO, but not sure about stuff like mirror scratches or distortion.  Thanks for your help!
Title: Re:mirror mirror on the wall
Post by: Quintaros on Sun 16/11/2003 19:18:14
You could use a semi-transparent object with the mirror imperfections on it.
Title: Re:mirror mirror on the wall
Post by: Sam. on Sun 16/11/2003 19:37:29
okay, that obviously means something to someone. but not to me. this might sound alot to ask but could you make me a sample room or something? i am no good with script. i just break things.
Title: Re:mirror mirror on the wall
Post by: Timosity on Mon 17/11/2003 03:16:31
I have another code for a mirror that SSH helped me with, which is different to Eric's as it allows you to move closer and further from the mirror and not always stay the same distance away.

Have the two characters in the room (The main character, and their reflection) with all the walkbehinds as Eric mentioned.

note: in this example LAZ is the character and LMI is the reflection.

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

//at the top of room script

int mirrorbase=132; //this is the y value which will be inbetween the 2 characters.
int laz_dist_from_mirror;
int lmi_dist_from_mirror;
int scale=3; // you can experiment with this number depending on the size of room and character.


 // script for room: Repeatedly execute
character[LMI].x=character[GetPlayerCharacter()].x;

laz_dist_from_mirror=character[GetPlayerCharacter()].y-mirrorbase;
lmi_dist_from_mirror=laz_dist_from_mirror/scale;
character[LMI].y=mirrorbase-lmi_dist_from_mirror;


character[LMI].loop=character[GetPlayerCharacter()].loop;
character[LMI].frame=character[GetPlayerCharacter()].frame;

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

Then with the character in the mirror, set their view so that left and right are the same, but walking up should be down, and down should be up.

and if you want to get more technical, you can have it so in the mirror characters view, they walk with the opposite leg first in each direction to get the complete mirrored effect.

This works as a complete fully functioning mirror.

As for what Quintaros said, it could work: put an object on the screen where the mirror is (lets say it's object 1)

then in the room (before fadein)

SetObjectTransparency(1,90); // object 1 at 90% transparent (experiment with the number with 100 being totally transparent)

Note: I think tranparency only works in high colour games

Hope this helps.

~Tim
Title: Re:mirror mirror on the wall
Post by: MrColossal on Mon 17/11/2003 04:56:44
duh! that totally makes sense

i wasn't thinking and of course getting closer to the mirror would be totally awkward... i think i had my mind on like water reflections and not mirrors

and yes transparency only works in high colour games
Title: Re:mirror mirror on the wall
Post by: Kweepa on Mon 17/11/2003 07:23:01
Technical archive it!