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 - strazer

#1641
If you use true type fonts you can use these letters in a translation file.

For SCI fonts, there is a tracker entry: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=119
#1642
You release the character view right after calling the non-blocking animation so the idle view will never display. I guess you meant:

Code: ags

  if (IsTimerExpired (1) == 1) {
    SetCharacterView (BOY, IDLEVIEW);
    AnimateCharacter (BOY, character[BOY].loop, 3, 0);
    SetTimer (1, GetGameSpeed()*20);
  }
  else if (character[BOY].animating == 0) { // i.e. won't run during idle anim
    ReleaseCharacterView (BOY);
    FaceCharacter (BOY, EGO);
  }


The default idle delay is 20 seconds.
#1643
Quote from: SSH on Fri 25/02/2005 08:58:49
Also, it would be nice if leading 0s in sound/voice/room names were not significant: i.e. sound001.ogg would get picked up as sound 1. Obviously there would need to be a priority in case both existed, but I don't care which way around it is.

http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=139
#1644
GetHotspotAt and GetWalkableAreaAt work with screen coordinates, but character coordinates are room coordinates, so this may not work in scrolling rooms.
So do this:

Code: ags

if (GetHotspotAt (player.x - GetViewPortX(), player.y - GetViewPortY()) == 1) {
  //Do something
}
else if (GetHotspotAt (player.x - GetViewPortX(), player.y - GetViewPortY()) == 2) {
  //Do something else
}
#1645
Also, the game will revert to low-resolution if the config file (acsetup.cfg) is not present, so you have to distribute that as well.
#1647
QuoteI guess that can't do any harm -- but since you'd normally open the help file from within AGS, I'm not sure why you really need to access it directly.

- Accessing it without the editor running
- ALT-Tabbing between it and the editor
- Opening it in Linux :)
#1649
It will eventually have the ability for users to post comments, other than that it's the same.
#1650
A user in the Beginner's Forum made the suggestion to rename the help file to agshelp.chm to make clear it is the help file and not program-related data.
#1651
I run Linux/WINE too, I use xCHM to access the help file.

The online manual is not official yet, it has been added recently and I'm sure CJ will add the link to the main page once AGS v2.7 is released.
#1652
Quote from: Pumaman on Tue 09/11/2004 19:43:44
Layered walkable areas would significantly change the way the walkalbe area systme works, so I don't think it's really viable to do. The workaround is as Hellomoto suggests.

Anyway, I've added the original suggestion to the tracker.
#1653
Yeah, but RawDraw functions work on the room background so there's no easy way to integrate it into a GUI.
For scrolling rooms, you'd have to fiddle around with saving and restoring the background image and so on. That's why I entered it as normal priority as it would make implementing health bars much much easier.

Maybe we don't even need an additional control if labels had a background colour. You could simply leave the label blank and adjust its width via the property.
What do you think?
#1654
Glad you were able to solve it.
While checking braces, I made a more readable version of the above:

Code: ags

  if (interface == QUITM) {

	if (button == 0) {
		QuitGame(0);
	}

	if (button == 1) {
		GUIOff(2);
		UnPauseGame();
	}

  }


  //--------START MENU BUTTONS ------------

  if (interface == MENUBUTT) {

	if (button == 0) {
		GUIOn(4);
		Wait(20);
		GUIOn(5);
		Wait(23);
		GUIOff(5);
		GUIOn(6);
		Wait(20);
		GUIOff(3);
		GUIOff(4);
		GUIOff(5);
		GUIOff(6);
		GUIOff(7);
		NewRoom(4);
	}

	else if (button == 1)   // load game
		RestoreGameDialog();

	else if (button == 2)   // quit
		QuitGame(1);
  }


  //------------HUD-----------------

  if ((interface == HUD) && (IsGUIOn(2) == 0)) {

	if ((button == 1) && (IsGUIOn(9) == 0)) {
		GUIOn(9);
	}
	else if ((button == 1) && (IsGUIOn(9) == 1)) {
		GUIOff(9);
	}
 
	if (button == 6) {
		GUIOn(0);
	}
   
	if (button == 7) {
		GUIOn(1);
	}


	if ((button == 3) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed))
		game.top_inv_item = game.top_inv_item + (game.num_inv_displayed / 2);

	if ((button == 4) && (game.top_inv_item > 0))
		game.top_inv_item = game.top_inv_item - (game.num_inv_displayed / 2);

  }


  //-----------RADIO HUD-----------------
   
  if ((interface == HUDRADIO) && (IsGUIOn(2) == 0)) {

	if (button == 0)  {
		SetCharacterView (JACK, 4);
		SetCharacterSpeechView(JACK, 5);
		AnimateCharacter(JACK, 1, 5, 0);
		Wait(25);
		SetCharacterView (JACK, 5);
		Wait(16);
		GUIOn(10);
		RunDialog(0);
	}

	if (button == 1) {
		SetCharacterView (JACK, 4);
		SetCharacterSpeechView(JACK, 5);
		AnimateCharacter(JACK, 1, 5, 0);
		Wait(25);
		SetCharacterView (JACK, 5);
		Wait(16);
		GUIOn(10);
		RunDialog(1);
	}

	if (button == 2) {
		SetCharacterView (JACK, 4);
		SetCharacterSpeechView(JACK, 5);
		AnimateCharacter(JACK, 1, 5, 0);
		Wait(25);
		SetCharacterView (JACK, 5);
		Wait(16);
		GUIOn(10);
		RunDialog(2);
	}
   
  }


  //-----------------------------------------------------
  // Restore game GUI
  //-----------------------------------------------------

  if (interface == LOADA) {

	if (button == 2) GUIOff(LOADA); // cancel

	if (button == 1) { // click on listbox item
		int index = ListBoxGetSelected(LOADA,1);
		if (GetSaveSlotDescription(index+100,buffer) == 1) { // if there is a savegame here
			GUIOff(LOADA);
			RestoreGameSlot(index+100);
		}
	}

	if (button == 3) { // scroll up
		if (GStopsaveitem < 5) GStopsaveitem = 0;
		else GStopsaveitem -= 5;
		ListBoxSetTopItem(LOADA, 1, GStopsaveitem);
	}

	if (button == 4 && GStopsaveitem < 90) // scroll down
// BRACES MISSING HERE?
		GStopsaveitem += 5;

	ListBoxSetTopItem(LOADA, 1, GStopsaveitem);

  }   


  //-----------------------------------------------------
  // Save game GUI
  //-----------------------------------------------------

  if (interface == SAVEA) {

	int index = ListBoxGetSelected(SAVEA, 1);

	if (button == 3) { // cancel
		GUIOff(SAVEA);
		GUIOff(SAVETEXTBOX);
	}

	if (button == 1) { // click on listbox
		int stbypos;
		StrFormat(buffer, "%d.", index+1);
		SetLabelText(SAVETEXTBOX, 1, buffer);
		if (GetSaveSlotDescription(index+100, buffer) == 0)
			StrCopy(buffer, ""); // GetSaveSlotDescription(index+100, buffer);
		//else StrCopy(buffer, "");
		SetTextBoxText(SAVETEXTBOX, 0, buffer);
		stbypos = 28 + ((index-GStopsaveitem)*(DEFAULT_FONT_HEIGHT+2)); //28 is set by trial-error. Depends of the savegames listbox position
		if (index < 9)  SetGUIObjectPosition(SAVETEXTBOX, 0, 12, 0);
		else SetGUIObjectPosition(SAVETEXTBOX, 0, 18, 0);     
		SetGUIPosition(SAVETEXTBOX, 29, stbypos); // 29 is set by trial-error. Same as above.
		GUIOn(SAVETEXTBOX);
	}

	if (button == 2 && index >= 0) { // save
		GetTextBoxText(SAVETEXTBOX, 0, buffer);
		GUIOff(SAVEA);
		GUIOff(SAVETEXTBOX);
		SaveGameSlot(index+100, buffer);
	}

	if (button == 4) { // scroll up
		GUIOff(SAVETEXTBOX);
		ListBoxSetSelected(SAVEA, 1, -1);
		if (GStopsaveitem < 5) GStopsaveitem = 0;
		else GStopsaveitem -= 5;
		ListBoxSetTopItem(SAVEA, 1, GStopsaveitem);
	}

	if (button == 5 && GStopsaveitem < 90) { // scroll down
		GUIOff(SAVETEXTBOX);
		ListBoxSetSelected(SAVEA, 1, -1);
		GStopsaveitem += 5;
		ListBoxSetTopItem(SAVEA, 1, GStopsaveitem);
	}
 
  }

  if (interface == SAVETEXTBOX) {

	int index = ListBoxGetSelected(SAVEA, 1);

	if (button == 0) {
		GetTextBoxText(SAVETEXTBOX, 0, buffer);
		GUIOff(SAVEA);
		GUIOff(SAVETEXTBOX);
		SaveGameSlot(index+100, buffer);
	}

	if (IsButtonDown(RIGHT)) GUIOff(SAVETEXTBOX);

  }


  //-----------------------------------------------------


I think you're missing braces at button 4 of LOADA?

Edit:

Quote
if (keycode==17)  GUIOn(2); PauseGame();            <-- i forgot to delete that pause game... hmm, but still strange that any key paused the game...

Well, since PauseGame is not within braces, like

Code: ags

  if (keycode == 17) {
	GUIOn(2);
	PauseGame();
  }


it gets called everytime any key is pressed...
#1657
Each time you call the Random() function, a new random number is generated, so with your code it's possible the room doesn't change at all.
Better do:

Code: ags

  int ran = Random(2); // generate random number between 0 and 2
  if (ran == 0) // if number is 0
    NewRoom(6); // go to room 6
  else if (ran == 1) // if number is 1
    NewRoom(7); // go to room 7
  else if (ran == 2) // if number is 2
    NewRoom(8); // go to room 8
#1658
Nice idea. Yeah, I would use it.
#1659
My pleasure. :)
#1660
Try this:

Code: ags

// main global script file

int guimb; // stores mouse button clicked on gui

function on_event(int event, int data) {
  //...

  if (event == GUI_MDOWN) { // if mouse clicked over a gui
    if (IsButtonDown(LEFT)) guimb = LEFT; // if left mouse button pressed, store it in variable
    else if (IsButtonDown(RIGHT)) guimb = RIGHT; // if right mouse button pressed, store it in variable
    // more buttons here...
  }

  //...
}


function interface_click(int interface, int button) {
  //...

  if (interface == THEGUINAME) {
    if (button == THEBUTTONNUMBER && guimb == RIGHT) {
      // do stuff
    }
  }

  //...
}
SMF spam blocked by CleanTalk