Allowing A Character To Move During Blocking Functions.

Started by Scarab, Sun 21/03/2010 16:50:20

Previous topic - Next topic

Scarab

Hello.

Currently I am working on a game that is at 160x120 resolution, and as such I had to magnify the graphics when I imported it to AGS.

This works fine, although the mouse movement follows a 320x240 grid, allowing it to move 'half a pixel' which sort of breaks the effect. My original workaround was:
Code: ags

function repeatedly_execute(){
mouse.setpostition((mouse.x/2)*2, (mouse.y/2)*2);
}


However, this broke the fluidity of the mouse motion (The mouse moved double speed up/left, but bounced around going down/right).
I therefore made a dummy character follow around the invisible mouse and only move along the 160x120 grid, coupled with an unclickable button on the GUI which worked to the same effect.

The problem is that whenever I run a Display() command, the character/button freezes, and the mouse doesn't, so the player can light up all the GUI buttons with the  MouseOverGraphic feature, when the mouse is not visibly over the button, again breaking the illusion.

I tried putting it in the Repeatedly_Execute_Always() function, but this didn't seem to have any effect. I then checked the manual again, and was unable to find a solution there.

So I was wondering, Is there a way to allow the dummy character and the button to follow the mouse during the Display() command? and if not, are there any other workarounds you can suggest?

Peace
Scarab

LRH

What about using an invisible character with the 'say' option? I'm pretty sure using display stops everything without exception.

cInvis.Say("blah blah blah);

Sorry if that is too simplistic or something you've tried....

Really smart work-arounds you've come up with.

Peter Bear

This is not a solution but the Display option halts the normal running of the game, like guis do  ...

Maybe as suggested you should try to provide text on screen by a different way.
Not much time for gaming neither creating, but keeping an eye on everything :)

Scarab

Well my first instinct is to use cMousely.Think(""), (Mousely is the dummy character), as this can provide the same text window GUI with no coding at all.

The problem with this however, is that it will not behave like Display(), and will 'time out' after a few seconds. Is there a way to somehow 'hold' the GUI there until a mouse click or button press without blocking it?

Peter Bear

well, in main parameters

set "allow speech to be skipped ..."

via > mouse only, the thinking or saying will never diseapper unless you click on it.

or :
Quote
SetSkipSpeech (int new_mode)

Changes whether the player can skip speech text by clicking the mouse. This option is initially set in a checkbox in the Main tab of the editor, but this function allows you to change it at run-time. The value of NEW_MODE means the following:
0  player can skip text by clicking mouse or pressing key
1  player can skip text by pressing key only, not by clicking mouse
2  player cannot skip text with mouse or keyboard
3  text does not time-out; player must click mouse or press key each time
4  player can skip text by clicking mouse only, not by pressing key

Not much time for gaming neither creating, but keeping an eye on everything :)

Scarab

Quote from: Pierceval on Mon 22/03/2010 09:51:43
well, in main parameters

set "allow speech to be skipped ..."

via > mouse only, the thinking or saying will never diseapper unless you click on it.

or :
Quote
SetSkipSpeech (int new_mode)

Changes whether the player can skip speech text by clicking the mouse. This option is initially set in a checkbox in the Main tab of the editor, but this function allows you to change it at run-time. The value of NEW_MODE means the following:
0  player can skip text by clicking mouse or pressing key
1  player can skip text by pressing key only, not by clicking mouse
2  player cannot skip text with mouse or keyboard
3  text does not time-out; player must click mouse or press key each time
4  player can skip text by clicking mouse only, not by pressing key

Yeah, I see how this could be done, though there are so many workarounds I need to do for this effect, another issue I have discovered is that if I scale the character at any point, it becomes obvious that the game is not running at its native resolution.

What would be ideal (although I admit I'm getting a little off topic here) is be to have the whole game running at its native resolution in the corner of the screen, and applying a function to magnify it every game loop, although from what I know of the Drawingsurface and DynamicSprite functions, it appears that it would be impossible to keep track of the smaller image, as the magnified image would be set as the background, and thus overwriting the original  :-\

If anyone knows how one would implement the screen magnification, I'd love to hear it.

Peace
Scar

Khris

Use a non-clickable GUI above all else to draw the screen to.

SMF spam blocked by CleanTalk