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

#1
a-HA!

If I understand correctly, the mouse.SaveCursorUntilItLeaves(); change cursor when hover over the hotspot and change it back to the previous one - however if the previous one is not the default one, but some other, it keeps the other.

Tha's what causes my cursor thing.

I need to find a better solution then!
#2
Oh... so no one actually know?

Interesting... :)
#3
Hi there,

First of all - I don't much understand scripting...

But I wanted the cursor to change everytime it hovers over the exit hotspot.

I simply copypasted the code from a different game, because I am really a noob in this :D

the code says:

Code: ags

function Exit_MouseMoveG() { // makes sure cursor changes to warp when hovering on exit hotspot
	if (mouse.Mode != eModeUseinv) { // unless it's an inventory cursor, which overrides
		Mouse.SaveCursorUntilItLeaves();
		mouse.Mode = eModeLeaving;
	}
}


Also I have to have this in the header:

Code: ags

import function Exit_MouseMoveG();


and eventually the function is defined in the hotspod code like this:

Code: ags

function hZpetDoVestibulu_MouseMove()
{
Exit_MouseMoveD();
}


And... it works, so there is no problem... BUT it work only sometimes and sometimes the cursor stays changed... as you can see in this video:



sometimes the arrow down is kept and shows even in the inventory.

Any ideas how it could be fixed?

Thanks!
#4
Quote from: Crimson Wizard on Sun 07/07/2019 09:20:28
gMainMenu.Clickable = false

Oh, that's so simple?

Great! Thank you!
#5
Just another question.

Is it possible to make GUI inactive, like... You hit "Settings" in menu and it shows settings GUI dialogue, but in meanwhile you can't do anything in the main menu?

Of course - the solution is make Main Menu GUI hidden with

gMainMenu.Visible = false;

but is there a posibility to make it inactive, not hidden, while another GUI is opened?

Thank you!
#6
It's strange tho - it shows screenshots for save

[imgzoom]https://i.imgur.com/qrPhKTA.png[/imgzoom]

but not for load

[imgzoom]https://i.imgur.com/c8QAaBY.png[/imgzoom]

The buttons are the same :/
#7
Guy, I actually managed to figure it out.

Wait, I didn't, but I have found this old module:

https://www.adventuregamestudio.co.uk/forums/index.php?topic=38928.msg512373#msg512373

And copypasted it into my game... and now it works :D

Thanks
#8
It's set like this:

[imgzoom]https://i.imgur.com/iYjJhjn.png[/imgzoom]

I think I solved it tho - it seems to be caused by Avast Antivirus.

Avast doesn't like AGS games for some reason :)
#9
Quote from: Khris on Sat 06/07/2019 14:35:36
The very first step is to make sure that the function is actually called. Just add
Code: ags
  Display("save button clicked");

as the first line to that function.

When you say "the save button does this", do you mean you did enter  btnSaveGame_OnClick  into the button's on click event? Or did you just copy that function (which will have no effect)?

Seems to be working
[imgzoom]https://i.imgur.com/J6ce9vV.png[/imgzoom]

Well I copypasted it, but also I assigned it to the button in GUI option :)

Doesn't work tho :)
#10
Hi there,

Even moar dumb questions are coming.

I made the Main Menu in the game and it almost 100 % works, expect ... saving and load the game.

When I click "Uložit" ("to save" in czech language), nothing happens... no response

[imgzoom]https://i.imgur.com/wg7ZOW3.png[/imgzoom]

I totally don't understand how coding works :D So I literally stolen the script from the Sierra template, but it works there, so why it doesn't for me?

The Save button does this:

Code: ags

function btnSaveGame_OnClick(GUIControl *control, MouseButton button)
{
  int gameSlotToSaveInto = find_save_slot(txtNewSaveName.Text);
  if (gameSlotToSaveInto < 0)
  {
   Display("No more free save slots!");
   return;
  }
  SaveGameSlot(gameSlotToSaveInto, txtNewSaveName.Text);
  //gSaveGame.Visible = false;
  
}



Also here is everything in my code to save related - you can check if I miss something here:

Code: ags

//stuff

function show_save_game_dialog()
{
  gSaveGame.Visible = true;
  // Get the list of save games
  lstSaveGamesList.FillSaveGameList();
  if (lstSaveGamesList.ItemCount > 0)
  {
    // If there is at least one, set the default text
    // to be the first game's name
    txtNewSaveName.Text = lstSaveGamesList.Items[0];
  }
  else
  {
    // No save games yet, default empty text.
    txtNewSaveName.Text = "";
  }
  mouse.UseModeGraphic(eModePointer);
  gInventory1.Visible = false;
}

function show_restore_game_dialog()
{
  gRestoreGame.Visible = true;
  lstRestoreGamesList.FillSaveGameList();
  mouse.UseModeGraphic(eModePointer);
  gInventory1.Visible = false;
}

function close_save_game_dialog()
{
  gSaveGame.Visible = false;
  mouse.UseDefaultGraphic();
  gInventory1.Visible = true;
}

function close_restore_game_dialog()
{
  gRestoreGame.Visible = false;
  mouse.UseDefaultGraphic();
  gInventory1.Visible = true;
}
//save

function btnCancelSave_OnClick(GUIControl *control, MouseButton button)
{
gSaveGame.Visible = false;
}

int find_save_slot(String name)
{
  bool slots[] = new bool[999];
  int i = 0;
  while (i < lstSaveGamesList.ItemCount)
  {
    if (lstSaveGamesList.Items[i] == name)
    {
      // found existing save with matching name
      return lstSaveGamesList.SaveGameSlots[i];
    }
    // remember which slots are already taken
    slots[lstSaveGamesList.SaveGameSlots[i]] = true;
    i++;
  }
 
  // Find first free save slot, starting with slot 1
  i = 1;
  while (i < 999)
  {
    if (!slots[i])
      return i;
    i++;
  }
  // no free slots found
  return -1;
}
 
function btnSaveGame_OnClick(GUIControl *control, MouseButton button)
{
  int gameSlotToSaveInto = find_save_slot(txtNewSaveName.Text);
  if (gameSlotToSaveInto < 0)
  {
   Display("No more free save slots!");
   return;
  }
  SaveGameSlot(gameSlotToSaveInto, txtNewSaveName.Text);
  //gSaveGame.Visible = false;
  
}

function btnCancelRestore_OnClick(GUIControl *control, MouseButton button)
{
  gRestoreGame.Visible = false;
}

function btnRestoreGame_OnClick(GUIControl *control, MouseButton button)
{
  if (lstRestoreGamesList.SelectedIndex >= 0)
  {
    RestoreGameSlot(lstRestoreGamesList.SaveGameSlots[lstRestoreGamesList.SelectedIndex]);
  }
  gRestoreGame.Visible = false;
}

function lstSaveGamesList_OnSelectionCh(GUIControl *control)
{
  txtNewSaveName.Text = lstSaveGamesList.Items[lstSaveGamesList.SelectedIndex];
}

function txtNewSaveName_OnActivate(GUIControl *control)
{
  // Pressing return in the text box simulates clicking the Save button
  btnSaveGame_OnClick(control, eMouseLeft);
}

function btnDeleteSave_OnClick(GUIControl *control, MouseButton button)
{
  if (lstSaveGamesList.SelectedIndex >= 0)
  {
    DeleteSaveSlot(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex]);
    lstSaveGamesList.FillSaveGameList();
  }
}

function bQuit_OnClick(GUIControl *control, MouseButton button)
{
  QuitGame(0);
}

//function bPlay_OnClick(GUIControl *control, MouseButton button)
//{
  //gExitGame.Visible = false;
  //gIconbar.Visible = true;
  //mouse.UseDefaultGraphic();
//}


function lstSaveGamesList_OnSelectionChanged(GUIControl *control)
{
txtNewSaveName.Text = lstSaveGamesList.Items[lstSaveGamesList.SelectedIndex];
}

function lstRestoreGamesList_OnSelectionChanged(GUIControl *control)
{

}

function bLoad_OnClick(GUIControl *control, MouseButton button)
{
gRestoreGame.Visible = true;
}

function sldAudio_OnChange(GUIControl *control)
{
System.Volume = sldAudio.Value;
}

function sldSpeed_OnChange(GUIControl *control)
{
SetGameSpeed(sldSpeed.Value);
}

function btnResume_OnClick(GUIControl *control, MouseButton button)
{
gPanel.Visible = false;
 mouse.UseDefaultGraphic();
}

function bSettings_OnClick(GUIControl *control, MouseButton button)
{
gPanel.Visible = true;
}

function btnOk_OnClick(GUIControl *control, MouseButton button)
{
gOvladani.Visible = false;
}

function bControls_OnClick(GUIControl *control, MouseButton button)
{
gOvladani.Visible = true;
}



function bNovaHra2_OnClick(GUIControl *control, MouseButton button)
{
gRestartYN.Visible = true;
}

function bSave2_OnClick(GUIControl *control, MouseButton button)
{
gSaveGame.Visible = true;
}

function bLoad2_OnClick(GUIControl *control, MouseButton button)
{
gRestoreGame.Visible = true;
}

function bSettings2_OnClick(GUIControl *control, MouseButton button)
{
gPanel.Visible = true;
}

function bControls2_OnClick(GUIControl *control, MouseButton button)
{
gOvladani.Visible = true;
}

function bEND2_OnClick(GUIControl *control, MouseButton button)
{
gExitDialogue.Visible = true;


Thanks for all advice!
#11
It seems the 3.4.3 version is not really OK with sound neither.

[imgzoom]https://i.imgur.com/O6JNllZ.png[/imgzoom]
#12
When you want to become a member on this forum, you have to take a quiz first. If you have incorrect answers it recommends you to read FAQ.

Bu you can't read the FAQ without being a member.

Isn't that a bug?

Thanks
#13
Well it seems I have installed two versions

AGS Editor .NET (Build 3.4.1.12)
AGS Editor .NET (Build 3.4.1.15)

Can uploading a music in the game in one version and opening it in the other cause the error?:D
#14
Hi there,

I am new here and I have two things.

First is about this forum. When you have incorrect answers in the quiz you have to fill before registrations, it recommends you to read FAQ, but you can't acces FAQ without having an account here. It's clearly a bug.

Now my AGS problem. When I am trying to load a game, it shows this

[imgzoom]https://i.imgur.com/nttJVYG.png[/imgzoom]

So I can't load it. Is there a solution ho to fix it or my work is lost?

Note: I totally cannot access my game.
Note: It says I should use newer version of AGS, but it's the newtest.

Thank you!
M.
SMF spam blocked by CleanTalk