Quote from: Khris on Mon 08/08/2011 15:00:22
I assume you've used the second way. If you use the Timer instead, you can adjust the speed even more precisely.
Yes, and yes.
I wanted them to move just slowly.. no need for nano precision here

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Khris on Mon 08/08/2011 15:00:22
I assume you've used the second way. If you use the Timer instead, you can adjust the speed even more precisely.
oCloud.X = 419;
function room_RepExec()
{
SetTimer(1, 20);
while ( object[0].X > 10 && IsTimerExpired(1))
{
object[0].X--;
if ( object[0].X == 10 )
{
object[0].X = 420;
}
}
}
function room_RepExec()
{
if ( object[0].X < 420 )
{
object[0].Move(18, 90, 10, eNoBlock, eAnywhere);
if ( object[0].X == 18 )
{
object[0].X = 421;
}
}
}
Quoteor give him a map GUI where the important rooms are accessible once they where discovered.I agree if the amount of rooms is enormous, however sometimes the adventure requires to give the player a chance to visit a room again for more clues and perhaps new items/objects/characters/interactions/events to deal with...
QuoteThere seem to be a lot of rooms in which there's not much to do
Quotethe walk speed could be faster (or at least include an option for the player to adjust it to their liking).
Quote from: Khris on Fri 05/08/2011 01:16:35
First of all, this isn't an easy problem.
QuoteNow, as a general note, to react to where the player walks you shouldn't use hotspots, that's what regions are for.
QuoteAlso, it's not necessary to use regions/hotspots to change a character's scaling, just use multiple walkable areas; they all have their own scaling settings.
AudioChannel *channel = aSound.Play();
int waitGraphic = mouse.GetModeGraphic(eModeWait);
int guiDisabledMode = GetGameOption(OPT_WHENGUIDISABLED);
Quote
The only minor thing I found was that in lieu of Mouse.GetModeHotspotX/GetModeHotspotY, you have to do the work yourself to make sure that the wait cursor (which is never used for interaction processing) has the same cursor hotspot (X, Y) location as the cursor you're switching from or the cursor will shift when AGS changes it to the wait cursor (albeit displaying the same image, since I've provided for that). So if you're using the eModePointer cursor to interact with the object, then you should make sure that eModeWait has the same cursor hotspot.
//top of room script...
bool timed_sequence = true;
bool mouse_over_object;
bool button_down;
int held_down_frames;
int counter = 0;
void on_mouse_click(MouseButton button) {
if (timed_sequence) ClaimEvent();
}
void Fail(String fail) {
timed_sequence = false;
SetTimer(1, 0);
player.Say("Fail");
}
void Win(){
timed_sequence = false;
SetTimer(1, 0);
player.Say("Win!");
}
function room_RepExec()
{
mouse_over_object = (Object.GetAtScreenXY(mouse.x, mouse.y) == object[0]);
button_down = mouse.IsButtonDown(eMouseLeft);
if (!timed_sequence) {player.Say("Time out!!"); } // <----- this is where the loop never ends...
if (mouse_over_object && button_down) {held_down_frames++;} // player is holding button down over object
if (held_down_frames) { // at some point, player started correct procedure
if (!button_down || !mouse_over_object) { // player let go of button or moved mouse off of object
Fail("asd");
return;
}
}
if (IsTimerExpired(1)) {
if (held_down_frames >= 5*GetGameSpeed())
Win();
else Fail("asd");
}
}
Quote from: Khris on Mon 01/08/2011 10:52:49
Did you do this:QuoteBoth Fail and Win (which aren't actual commands) should set timed_sequence back to false and deactivate the timer: SetTimer(1, 0);
Quote// before while loop
int waitGraphic = mouse.GetModeGraphic(eModeWait);
int guiDisabledMode = GetGameOption(OPT_WHENGUIDISABLED);
Quote from: Khris on Sun 31/07/2011 22:50:03
How did you code anything without that...?
Quote from: Khris on Sun 31/07/2011 22:50:03
Declare the variable at the top of the room script:Code: ags bool timed_sequence;
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.094 seconds with 17 queries.