Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: gypsysnail on Tue 13/11/2007 01:00:19

Title: hotspots text help
Post by: gypsysnail on Tue 13/11/2007 01:00:19
Look! I am sorry if I have to start up a new topic, but no one has replied for quite awhile to my post and I am stuck! Besides that, the previous topic that is about this is marked as SOLVED so people are thinking no one is posting but I AM!!! so I NEED HELP! Here is what I have posted below and YES KrisMUC I have fixed the x and y offsets with numbers, I shall post that too in the code.

Ok KrisMUC I tried it and I got the error message variable already defined and it took me to the global script where I had pasted the code. I still dont fully understand the function stuff. I have copied and pasted below the current code sequence of the things i have already in the rep_exe for other functions, before the code you gave me goes in. I have tried but still doesnt recognise. Now look at where I have put KrisMUCS code in - and it still doesnt work so I know I am doing something wrong and I dont understand WHAT? And getting frustrated at my stupid brain that can't program! So please understand my reasons for starting up a new topic but if thats what it takes to get the help then I will do it and the moderators can alter this to suit the rules if they want, and I can get the help.

#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
  int c=System.ViewportWidth-gOverhot.Width;
  int x=mouse.x+3; if (x<0) x=0; if (x>c) x=c;
  c=System.ViewportHeight-gOverhot.Height;
  int y=mouse.y+5; if (y<0) y=0; if (y>c) y=c;

  gOverhot.SetPosition(x, y);
}

function repeatedly_execute() {
  // put anything you want to happen every game cycle here
  lblTime.Text = String.Format("%02d:%02d, Day %d", GameTime.Hour(),
GameTime.Minute(), GameTime.Day());
  // Start of special Following Code
  if (cEgo.Moving == false) { // Player has stopped moving (obviously)
    if (Follow == 1) { // If Jonah is still flying
      // Change state (the 'Follow' variable), and have him fly to Ego
      cJonah.FollowCharacter(null);
      Follow = 2;
      cJonah.Walk(cEgo.x,  cEgo.y, eNoBlock);
    }
    else if (Follow == 2) { // If Jonah is on his way to Ego's shoulder
      if (cEgo.Loop == 1 || cEgo.Loop == 0) cJonah.Baseline = cEgo.y -
1; // Or '==2' for the other shoulder
      else cJonah.Baseline = cEgo.y + 1;
      if (cJonah.Moving == false) { // Jonah is at Ego's location
        // Make sure their Loops are always the same
        cJonah.Loop = cEgo.Loop;
      }
    }
  }
  else { // If Ego is Moving
    if (Follow == 2) { // If Jonah is 'at rest'
      // Change state (the 'Follow' variable), and have him start flying free
      cJonah.FollowCharacter(cEgo,0,0); 
      Follow = 1;
    }
  }
  // End of special Following Code
}

function show_inventory_window () {
  // This demonstrates both types of inventory window - the first part is how to
  // show the built-in inventory window, the second part uses the custom one.
  // Un-comment one section or the other below.
 
  // ** DEFAULT INVENTORY WINDOW
//  InventoryScreen();

  // ** CUSTOM INVENTORY WINDOW
  gInventory.Visible = true;
  // switch to the Use cursor (to select items with)
  mouse.Mode = eModeInteract;
  // But, override the appearance to look like the arrow
  mouse.UseModeGraphic(eModePointer);

}

#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
Title: Re: hotspots text help
Post by: Khris on Tue 13/11/2007 05:07:16
I've replied to the other thread. I've been offering you continuous help on this matter and planned to keep it that way. However, I'm no robot and I need an occasional hour of sleep every other day ;)

The code in here won't work since the rep_ex function is now declared twice.
I won't go into this now. Please check my latest reply in the other thread.
Title: Re: hotspots text help
Post by: Ashen on Tue 13/11/2007 21:57:46
Since this is being taken care of in the other thread:
LOCKED

Snail, have a bit more patience in the future. This is an international forum, you can't expect everyone to be on the same clock as you.