Menu

Show posts

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 Menu

Messages - AnasAbdin

#3001
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  ;)
#3002
thanx man, the trick was here

Code: ags
 oCloud.X = 419;


however, the clouds move fast even that the object speed is 1... which is the slowest but not slow enough... I'd like the speed to be much much less than that....
#3003
frustrated...
I only want to move an object around the room (a cloud)... it works great as long as it's eBlock :S I tried eNoBlock but it just stood still...

I tried setting a timer and move the cloud pixel by pixel according to the timer... still...

here's my code:
Code: ags
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;
    }
  }
}


I wanted this from the first place:
Code: ags
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;
         }
  }
}


it works only when I use eBlock....
#3004
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...
#3005
Thanx Oddysseus :)

QuoteThere seem to be a lot of rooms in which there's not much to do

That's my mistake in the video, I've captured a few shots with little things to do! However, I don't consider a room with nothing to do a waste! specially in planets, I'd like to give alot of space to wander around. anyways I'll use your advice and keep it in consideration :) sometimes a clue can be extracted from a room even if it doesn't have any interactions to happen...

Quotethe walk speed could be faster (or at least include an option for the player to adjust it to their liking).

AGS already allows players to control game speed :)
#3006
I appreciate all your help :) tuck
#3007
Thanx all  ;D
#3008
Wowoowoooowoooo
chill! I used hotspots and they worked perfectly, deal with it  :=

knowing basic features of AGS does not make me a known it all!!!?? I'm 100% sure I know less than 1% of what you know, still, this doesn't deprive me from giving suggestions and opinions. I don't mean to makeyou look any lesser, you helped me solve coding problems and I respect and appreciate you :)

and please, I'd appreciate it if you don't use the F word in my threads :)

edited: for the sake of being professional, I have tried using regions, all I did was creating regions exactly where the hotspots used to be.. I copy/pasted the code I used in the hotspots into the region's walks-into... worked the same, no difference  :-\
#3009
Quote from: Khris on Fri 05/08/2011 01:16:35
First of all, this isn't an easy problem.

man I'm trying to simplify things as possible :) sometimes the solution is within reach but we think it's just too complicated!

QuoteNow, as a general note, to react to where the player walks you shouldn't use hotspots, that's what regions are for.

why not hot spots? I use them and they work perfectly? please enlighten me.

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.

I know that every walkable area can have its own scaling level.. but since I'm using one walkable area... I decided to create an 80% tinier view of my character that is activated when he walks on a hotspot.

my single-celled brain didn't understand much of the transparent character theory  Khris.. :-\ could you please explain it more.
#3010
Thanx alot Mazoliin :)

I don't think this will help much, you see I haven't explained it very well...
my game resolution is 640,480. I wanna do a walk-behind-hills thing.. I looked in this forum alot, however, I found alot of complicated solutions for such an easy problem.

check this image first (please)


so I think a single walkable area is enough for now. which covers the far and near hills.
I have also created a walkbehind that covers the NEARER hills only, but it is deactivated (baseline at top) as long as the player is on the NEARER hills...

i created  hotspot 1, the red thin line, at the peaks of the nearer hills..
this is my logic:

if (character walks on red line)
{
  if (character is on the near hill)
  {
  invert his Y movement;
  activate walkbehind;
 }
 else
 {
 invert his Y movement back to normal;
 deactivate walkbehind;
 }
}

hot spot 2 (the yellow one) is used to toggle the player's view between normal scaling and a little one.

if ( player walkes on hot spot 2)
{
 if (player is normal size && his Y direction is inverted )
 {
    make him smaller;
    invert his Y movement back to normal;
  //walkbehind is still activated.. so he should go uphill the visible parts of the far hills..
 }
 if (player is tiny)
 {
    make him normal size;
   invert his Y movement;
  //walkbehind is still activated.. so he should go uphill from behind the NEAR hills..
 }
}

I created a couple of variable within the room's script to control the conditions of having crossed the red line (hot spot 1) or walked over yellow (hot spot 2) so no biggy here..

I am only stuck on the inverting the Y movement  :-\ I am not sure of the 480 - y part would work.. ???


Edit:
listen.. I have just tried this:

instead of inverting the player's movement, I created a view with the player's up and down walk cycles inverted.. so I assign the new inverted view to the player instead of playing with his Y directions...
it worked fine, the only problem is the transition between being front or behind the nearer hills.. it causes alot of looping problems (infinite loops...) so I solved it by forcing the character to walk alittle bit (about 16 pixels) to a safe zone (not hotspots) location.. until now, this is the only problem I'm working on :) the  logic rocked  ;D
#3011
Hello,

I created a walkable area that I would like the player's movement be inverted when walked on, so instead of going north I want him to go south and so on..

#3012
First of all, I'd like to thank you guys so much (Khris & +monkE3y_05_06+ ) for all the efforts and time you spent helping me, I can't express how much I appreciate it :)

I tried +monkE3y_05_06+'s last code and worked as a charm, I think my problem was I am not used to get code from other people, so I had to feel an urge to edit it alittle bit... also I misplaced the following:

Code: ags
  AudioChannel *channel = aSound.Play();
  int waitGraphic = mouse.GetModeGraphic(eModeWait);
  int guiDisabledMode = GetGameOption(OPT_WHENGUIDISABLED);


outside the function....

so yeah, I'm the one to blame (as if I wasn't from the first place hehe)...

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.

fixed, no problem.

again, you two are awesome. and yet again, sorry for the bother! and Khris, I'm sure I did something wrong using your 100% correct code, I'll see to that :)
#3013
no no I did use return; and still it did not exit the loop!! I tried a coupla stuff from desperation...

#3014
Code: ags

//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");
      
  }
}



man I'm sure it's a very simple solution... hehe
#3015
dude of course I tested all code by you all!! you took from your own time and effort to help me the least I can do is use it!

to remove any suspicion I used your code EXACTLY asyou wrote it, of course I figured out the XY addition to the method name... still! the player wins/slips/loses normally, but then enters an infinite loop of lose...

I know that AGS stores alot of values as integers, but when I tried the while loop code AGS gave me an error about it... btw I am logging on the forum from a different platform, my AGS is running on another PC... so please forgive me for not cutting/pasting error messages and stuff...

I think the code leads to being stuck in an infinite loop here:

if (!timed_sequence) return;  // do nothing......
#3016
I tried either ways, the while channel playing and the first way... something is always wrong going on and I'm just not able to get my hands on it...

this is what happened with the while channel is playing method:
first lets agree on this:
player wins = holds mouse over object until sound ends.
player slips = holds mouse over object but releases before sound ends.
player loses = doesn't click on the object at all until sound ends.


while the sound is playing, the only cursor available is the Wait cursor, however, it can be used normally!!! so what happened is I tried pressing mouse down all the time on the object while the sound is playing, the player wins then loses!
also, if I clicked the object while the sound is playing then release, player slips then loses..

either case leads to this: Wait cursor is on all the time, I can't get any other cursor and the mouse is dead while the player keeps repeating (lose) routine over and over...

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);

I don't get it?? omg lol I think I've coded so much the last coupla weeks my mind got dumb on easy stuff!! did I mention I'm drawing/composing/writing all together!!


also:
how is this an integer?
Quote// before while loop
  int waitGraphic = mouse.GetModeGraphic(eModeWait);
  int guiDisabledMode = GetGameOption(OPT_WHENGUIDISABLED);
#3017
Quote from: Khris on Sun 31/07/2011 22:50:03
How did you code anything without that...?

Lol are you kiddin me!! I keep trying until it works :) I try to find similarities between java in general and AGS, they are not that different you know...

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;


Thanx man :) but I'm not THAT novice!!

the code is great, it's so much similar to what I had in mind, except that I lacked the knowledge of some methods by AGS but again thanx to you for pointing at agshelp.chm...

right now I have three conditions going on:

if player does not click the object at all and sound ends --> fails
if player clicks object but releases before sound ends --> fails
if player clicks object and releases after sound ends --> succeeds

however, when he succeeds he does his success routine and then heads back to the click and release does-not-click-the-object-at-all fail routine, I used the "return;" command inside the success routine but it did not work though.. I guess I'll  have to manage my way around the problem.

again thanx alot, I'll do my best to produce a great game in reward to your effort.
#3018
hello all,

allow me to explain the situation:

the player did something that lead to a sound to be played. he should interact with an object until the sound file completes. Mouse must be clicked all the time until the sound ends.
this is the logic:

if (player triggers_an_event )
{
  play sound_file;
  disable all mouse functions except the interact;
  while ( sound_file.isPlaying() )
  {
        if ( mouse.interact(pressed_down_at_object_for_5_seconds)
        {
            player wins;
            restore all mouse functions;
        }
        else
        {
            player loses;
        }
  }
  if ( sound_file.ends_without_keeping_interacting_with_object )
  {
   player loses;
  }

}

I am mostly stuck in the -wait an event until a sound ends- part
and -keep holding mouse interact (hand) on an object to prevent a lose-event-

lol I hope I managed to explain the problem clearly...

another thing (greedy me):
is there a manual somewhere that contains all AGS commands? so I can go on with my coding without bothering you :) most of the commands are different and new to me, I  mean I do use JCreator but still.. AGS knows how to challenge me!!

Thanx for your time :)
#3019
AGS Games in Production / Re: Anastronaut
Sun 31/07/2011 11:26:59
lol thanx guys for the feedback..
I am still confused about the name.. it is originally called Anastronaut... I only did anas' quest in the video without thinking about it...

anyway, the cursors are similar to sierra's... walk/eye/hand/talk/inventory...
selecting between them is either by right-clicking or from the drop down menu at top...
I think the application I'm using for video capture (Freez) added an hour-glass to the cursors!
I kinda forgot about myself and life in the last few days sinking in AGS... so please bear with me   :-[
oh.. I wanted to know something: I know it's early since I completed less than 25% of my game so far, but how do I execute the game without AGS? I didn't look in it yet... ok I looked it up hehe

Thanks
#3020
Hello everyone, I am in the process of creating my first game, I'd like to ask you about your opinions regarding the game in general and integrating Sierra's tool bar with Lucas Art's speech style...

this is a youtube link:
http://www.youtube.com/watch?v=L_cwB1SnZ_o

and you can check the images (blog):

http://stardust2stardust.blogspot.com
http://anas-tronaut.blogspot.com

Thanks
SMF spam blocked by CleanTalk