I want to script a room that is kinda all darkness, except for one little spyhole the player can move about like a cursor. the player can see the backgroubd the spyhole.
This is going to be used as a kinda spying through a scope on a gun kinda thing. So if anyone could please help it would be greatly appreciated!
the flashlight plugin might work
Yep, check http://www.adventuregamestudio.co.uk/games.php?action=detail&id=187 ;)
I'm looking for a way without using plugins?
Well... this is my thought...
Have a HUGE black object with a spyhole (scope whatever) in the center of it Find out the X, Y coord difference between the center and the corner of the object (which I believe is the upper left corner, forgive me if I am wrong)
For instance if the object is at 0, 0 and your spyhole center is at 100, 100 and you click on say 150, 200
int moveX = mouse.x - (GetObjectX(OBJ) + 100);
int moveY = mouse.y - (GetObjectY(OBJ) + 100);
//at this point moveX is 50, and moveY is 100
MoveObjectDirect(OBJ, GetObjectX(OBJ) + moveX, GetObjectY + moveY, 3);
Doing it this way you will have to put the interaction on the object itself, and you won't be able to click on anything behind the keyhole.... You can also put it in your repeatedly execute and it will follow the mouse cursor...
The other possibility is a GraphicOverlay put the code in your repeatedly execute to follow the mouse cursor, using it on click won't work as well as the MoveOverlay is instant and not gradual like move Object....
Not tested, but the logic is right... (I believe)
use an overlay instead of an object and it works better
experimenting with different sniper styles in 6DA i tried this and it worked wonderfully
just set moveoverlay to your mouse x and y in the rep execute and make sure the overlay image is at least two times as big as the background so that when you move all the way to the left, the right side doesn't pop out
Why not use the big bad black object as a character-view, and save all that scripting?