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

Topics - tor.brandt

#21
In my game I want a character to become shaky after a certain event.
For this purpose I've used
Code: ags
player.AnimationSpeed = 0;
player.SetIdleView(7, 0);


where view 7 consists of two frames, such that the character 'jumps' up and down continuously whenever he is not walking.

However, I have two problems here:
1. Even with delay 0 in the idle view, there is still a bit of a delay after the character stops walking before he switches to the idle view. Is it possible to make him switch to the idle view faster in any way?
2. Even with animation speed 0, the shaking is not fast enough. Is is possible to make the character animate faster in any way?

On closer inspection, it seems that only the normal (i.e. walking) view is affected by AnimationSpeed. If that's correct, how do I change the animation speed of other views?
#22
This is my current modified version of the repeatedly_execute function of the LW_BASS TwoClickHandler module:

Code: ags

function repeatedly_execute()
{
  // Inventory GUI: 
  // - make visible if mouse "touches" trigger zone
  // - make invisible if mouse leaves inventory GUI
  if (!gInventoryBar.Visible && mouse.y <= INVENTORY_POPUP_POSITION)
  {
    gInventoryBar.Visible = true;
  }
	
  if (gInventoryBar.Visible && mouse.y > gInventoryBar.Height)
  {
    gInventoryBar.Visible = false;
  }
	
  // Action Text
  // We always display the name of what is under the mouse, with one exception:
  // IF the player has an inventory item selected and hovers over the same inventory item, 
  // we display nothing to indicate that an item can not be used on itself
  if (player.ActiveInventory == null)
  {
    lblActionText.Text = Game.GetLocationName(mouse.x, mouse.y);
  }
  else
  {
    InventoryItem *i = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    if (i != null && (i.ID == player.ActiveInventory.ID))
    {
      lblActionText.Text = "";
    }

///This is the part I need help with:
    else
    {
      if (GetLocationType(mouse.x, mouse.y) == eLocationNothing)
      {
        lblActionText.Text = String.Format("Use %s with %s", player.ActiveInventory.Name, Game.GetLocationName(mouse.x, mouse.y));
      }
      
      else
      {
        lblActionText.Text = String.Format("Use %s with %s", player.ActiveInventory.Name, Game.GetLocationName(mouse.x, mouse.y));
      }
    }
  }
}


As you see, I've made it so that if an inventory item is active (i.e. is the current cursor), the action label will display "Use [active inv. item] with [that which the cursor is currently over]".

I'd like to make it so that even if an inventory item is active, if the cursor is not over an object, a hotspot, or an inventory item, the action label displays nothing at all.
I tried using the GetLocationType function, and then script that if an inventory item is active, and the current location type is eLocationNothing, the action label displays nothing. This works fine, except that since inventory items is of the location type eLocationNothing, the action label displays nothing when an inventory item is active and the cursor is over another inventory item.

Is there a way around this?
(It seems strange to me that there is no separate location type called "eLocationInvItem" or something, but perhaps there is a good reason for including inv. items in the eLocationNothing type?)

To recap: I'd like my action label to display "Use [active inv. item] with [the name of that which the cursor is over]" when the cursor is over an object, hotspot, another inventory item, and possibly also characters (in my current game there are not yet any characters beside the player character, but it'd be nice to know how to include these in the function for future purposes).

PS. In the code I've marked the part I need help with, but I've included the whole repeatedly_execute function just in case...
#23
I'm trying to modify the LW_BASS module, such that when an inventory item is active, the action text will display "Use [active inventory item] with [the hotspot/object/etc. which the cursor is currently over]".

What is wrong with this line:
Code: ags
lblActionText.Text = ("Use %s with %s", player.ActiveInventory, Game.GetLocationName(mouse.x, mouse.y));
?

AGS says there is a parse error.
Now, there may be other errors, and I'm not even sure if I'm using player.ActiveInventory and/or Game.GetLocationsName() correctly here, but I just can't see the parse error.
#24
If a function is run on e.g. a hotspot event, the whole game interface is disabled while the function is carried out.
E.g. if I have set a player.Say function, the game interface is disabled until the character has finished talking.

I seem to recall that you don't even have to script to keep the interface enabled by default, but I have looked everywhere (editor, help files, forum), and I just can't find it!
How do I make it so that the game interface is kept enabled by default, such that I have to enter into the function specifically when I want the interface to be disabled while carrying out the function?
#25
I'd like to make my character's talking view play the frames randomly.
Is it possible e.g. to make a line in the global script that makes the talking view play out in such a way?
#26
OK, I know this is a totally newbie question, but I've searched all over, and actually couldn't find an answer.

When my character goes idle (i.e. stops walking), he just freezes in current frame of his walking view.
How do I make him switch to his idle view instead? I actually thought he would do so by default?

(I'm using the LW-BASS template, if that has something to do with it...)
#27
I am making some tests with high resolution in AGS, and I'm not sure if I got all the settings right.

I've been trying with 1280x720 as well as 1920x1080, and it seems that when I use high res sprites,
AGS handles the graphics in a way that slightly 'warps' the sprite; when the character walks from one position to another, the sprite will typically alter a little bit from one position to the other.
I don't know the technical terms for this, but perhaps you know what I mean?

Please let me know if you need me to be more specific, or if I should make a screenshot or something.

My question is: Does AGS generally handle high res sprites badly, or is there a way to get around this?

Thanks!
#28
I'm planning on starting up my first serious AGS game project, and I'd like to get the technicalities right in my project setup from the start, to avoid annoying set backs.

I'd like to set a relatively high resolution, like 1920*1080, but I'm not sure if that will cause trouble for players with smaller resolution monitors...
So: if I set the game resolution to 1920*1080, will players with smaller resolution monitors be unable to run the game?
And if so, what do you think is the highest reasonable resolution to set? 1024*768, or can I go higher than that?

Thanks!
SMF spam blocked by CleanTalk