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

#101
So I've been playing around with a practice background, trying to see where my skills are and the results aren't too bad so far.

In my background I have a section like this, which I drew and then added in the anti-aliasing. Now I've decided that I want to change up the colors.


(Old colors are on top, new colors on the bottom. As you can see, flood filling has messed up the anti-aliasing.)

I can't use the flood fill tool because of the anti-aliasing. Is there an easy way to switch up the colors without manually redrawing everything? I'm using The Gimp by the way. The anti-aliasing was done by hand using 1 pixel pencil tool at 30% opacity.
#102
Ok, so with changing mouse mode, the full code would probably be something like this:

In repeatedly_execute:
Code: ags
function repeatedly_execute () {
  
  if (GetLocationType(mouse.x, mouse.y) == eLocationCharacter)
    mouse.Mode = eModeTalkto;
  
  else if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot
        || GetLocationType(mouse.x, mouse.y) == eLocationObject)
    mouse.Mode = eModeInteract;
  
  else
    mouse.Mode = eModeWalkto;

}


Then in on_mouse_click:
Code: ags
bool invMode = false;

function on_mouse_click (MouseButton button) {

  int mX = mouse.x,  mY =  mouse.y;

  if (button == eMouseLeft) {
    
    if (invMode) {  // if in inventory mode
      ProcessClick (mX, mY, eModeUseinv); // Run "Use Inventory on" action.
      invMode = false; // Turn off inventory mode
    }
    
    else if (GetLocationType(mX, mY) == eLocationNothing) // No hotspot, so walk
      player.Walk (GetViewportX () + mX, GetViewportY () + mY);

    else // Hotspot, so process click as "Interact"
      ProcessClick (mX, mY, eModeInteract);

  }
  
  else if (button == eMouseRight) {
    
    if (invMode) // If "Use Inventory on", switch it off
      invMode = false;
    
    else {
      
      if (GetLocationType(mX, mY) == eLocationNothing) // No hotspot, so walk
        player.Walk(GetViewportX () + mX, GetViewportY () + mY);
      
      else // Process click as "Look at"
        ProcessClick(mX, mY, eModeLookat);
        
    }
  }
  
  // Inventory click handling:
  
  else if (button == eMouseLeftInv) {
    
    if (!invMode) {  // If not in "Use inventory mode"
      // Set the active inventory and switch inventory mode on
      player.ActiveInventory = inventory[game.inv_activated];
      invMode = true;
    }
    
    else { // The player is inventory mode, run "Use inventory on" interaction
      inventory[game.inv_activated].RunInteraction(4);
      invMode = false;
    }
  }
  
  else if (button == eMouseRightInv) // Else, look at the inventory item
    inventory[game.inv_activated].RunInteraction(1);

}
#103
Quote from: Adeel S. Ahmed on Fri 07/06/2013 15:10:31...you don't need to do seperate scripting for TALK and WALK...

I think you meant TALK and INTERACT ;)

Although if you want the functionality I think you described in your first post, you probably want use code like this:

Script Header:
Code: ags
// Replace this number with the number of the sprite used for talking:
#define MOUSE_TALK_SPRITE 54
// Replace this number with the number of the sprite used for interacting:
#define MOUSE_INTERACT_SPRITE 55
// Replace this number with your normal mouse sprite number:
#define MOUSE_NORMAL_SPRITE 56


Then in repeatedly_execute:
Code: ags
function repeatedly_execute () {
  
  if (GetLocationType(mouse.x, mouse.y) == eLocationCharacter)
    Mouse.ChangeModeGraphic (mouse.Mode, MOUSE_TALK_SPRITE);
  
  else if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot
        || GetLocationType(mouse.x, mouse.y) == eLocationObject)
    Mouse.ChangeModeGraphic (mouse.Mode, MOUSE_INTERACT_SPRITE);
  
  else
    Mouse.ChangeModeGraphic (mouse.Mode, MOUSE_NORMAL_SPRITE);

}
#104
The code I posted in this topic should work fine.

Code: ags
bool invMode = false;

function on_mouse_click (MouseButton button) {

  int mX = mouse.x,  mY =  mouse.y;

  if (button == eMouseLeft) {
    
    if (invMode) {  // if in inventory mode
      ProcessClick (mX, mY, eModeUseinv); // Run "Use Inventory on" action.
      invMode = false; // Turn off inventory mode
    }
    
    else if (GetLocationType(mX, mY) == eLocationNothing) // No hotspot, so walk
      player.Walk (GetViewportX () + mX, GetViewportY () + mY);
    
    else if (GetLocationType(mX, mY) == eLocationCharacter) // Character, so use 'Talk to'
      ProcessClick (mX, mY, eModeTalkto);

    else // Hotspot, so process click as "Interact"
      ProcessClick (mX, mY, eModeInteract);

  }
  
  else if (button == eMouseRight) {
    
    if (invMode) // If "Use Inventory on", switch it off
      invMode = false;
    
    else {
      
      if (GetLocationType(mX, mY) == eLocationNothing) // No hotspot, so walk
        player.Walk(GetViewportX () + mX, GetViewportY () + mY);
      
      else // Process click as "Look at"
        ProcessClick(mX, mY, eModeLookat);
        
    }
  }
  
  // Inventory click handling:
  
  else if (button == eMouseLeftInv) {
    
    if (!invMode) {  // If not in "Use inventory mode"
      // Set the active inventory and switch inventory mode on
      player.ActiveInventory = inventory[game.inv_activated];
      invMode = true;
    }
    
    else { // The player is inventory mode, run "Use inventory on" interaction
      inventory[game.inv_activated].RunInteraction(4);
      invMode = false;
    }
  }
  
  else if (button == eMouseRightInv) // Else, look at the inventory item
    inventory[game.inv_activated].RunInteraction(1);

}


But, if you're going to be using a system where the modes "Talk to" and "Interact" never overlap, you should probably just abandon Talk and only use Interact.
Then just trick the player into thinking they're using a Talk action by writing your Talk scripts under the "Interact" node, then use a GUI label to change from "Use @overhotspot@" when it's over an object or hotspot to "Talk to @overhotspot@" when it's over a character.

What I like to do actually is create a String property (applied to all hotspots, objects and characters, with a default value of "Use") and then change that to the appropriate verb for the object/character/hotspot.

That way you can have "Climb Tree", "Pick up Small Rock", "Talk to Shopkeeper", etc.
#105
Thanks Khris, works perfectly. Didn't know about the GetTextHeight function.
#106
Does anyone know if there's a way to check if text is clipping an overlay's width?

That is, if the text is spreading onto the next line.

What I'm trying to do is design a custom speech system that is closer to the actual way LucasArt's speech worked. If two characters are having a conversation, the text is normally displayed at the same y coordinate for both characters, and that would be the y coordinate of whichever character is taller.

So in order for this to work I need to be able to check whether an overlay is taking up one, two or three rows. I hope I'm making sense.

It would also be nice to be able to return a character's height, for offsetting the overlay and whatnot. This isn't the biggest issue right now since I can always manually set each character's height on game_start.
#107
Quote from: Armageddon on Fri 31/05/2013 02:59:56
Quote from: Trapezoid on Fri 31/05/2013 02:58:39
I don't think so. It just resumes the talking animation once you stop walking.
This is false. :)

It is true. I have witnessed it first-hand. It is also why the sprites for the walking animation all have heads ^^
#108
Also, have a look at your on_mouse_click function in the global script to make sure that mouse clicks are actually running interactions.

You should have something like:

Code: ags
function on_mouse_click (MouseButton button) {

  if (button == eMouseLeft)
    ProcessClick (mouse.x, mouse.y, mouse.Mode);

}
#109
You would use String.IndexOf (String needle);

Eg:
Code: ags
String input = "Hello World";

if (input.IndexOf("hello") != -1)
  Display ("Hello!");

else
  Display ("Input does not contain hello.");


Edit: Then again, if you're using a text parser you wouldn't need to use IndexOf, you just use Parser.ParseText.

Eg:
Code: ags
String input = Game.InputBox ("Enter Text:");

Parser.ParseText (input);

if (Parser.Said("hello"))
  Display ("Hello!");

else
  Display ("Input does not contain Hello.");


This is of course assuming "Hello" isn't an ignored word :D
#110
Let's not go the jpg route. The current splash screen should be fine - can we not just photoshop out that '3.2' label and replace it with a new one, in a similar font?

Is it really necessary to design a whole new splash screen?
#111
Try shooting Rocco a PM. He may have just missed your post.
#112
Quote from: Eric on Fri 24/05/2013 07:25:31
Following this line of thought, I always assume that British people are lining up in a que-way.

Whaaaaaaaat!? Do brits really say "queue" as "cue-way"?
#113
If there are no double pixels on your slope's walkable area, the character won't be able to walk up it.
#114
Personally I would disregard the 'Talk to' mouse mode, and not even bother setting mouse modes. Just write your talk to interactions under the 'interact' node.

Then I would use a boolean variable to set/check whether the player has selected an inventory item to use. (Disregarding the cursor mode again.)
You'll need to make sure you're handling inventory click in script for this to work.

Code: ags
bool invMode = false;

function on_mouse_click (MouseButton button) {

  int mX = mouse.x,  mY =  mouse.y;

  if (button == eMouseLeft) {
    
    if (invMode) {  // if in inventory mode
      ProcessClick (mX, mY, 4); // Run "Use Inventory on" action.
      invMode = false; // Turn off inventory mode
    }
    
    else if (GetLocationType(mX, mY) == eLocationNothing) // No hotspot, so walk
      player.Walk (GetViewportX () + mX, GetViewportY () + mY);
    
    else // Hotspot, so process click as "Interact"
      ProcessClick (mX, mY, 2);

  }
  
  else if (button == eMouseRight) {
    
    if (invMode) // If "Use Inventory on", switch it off
      invMode = false;
    
    else {
      
      if (GetLocationType(mX, mY) == eLocationNothing) // No hotspot, so walk
        player.Walk(GetViewportX () + mX, GetViewportY () + mY);
      
      else // Process click as "Look at"
        ProcessClick(mX, mY, 1);
        
    }
  }
  
  // Inventory click handling:
  
  else if (button == eMouseLeftInv) {
    
    if (!invMode) {  // If not in "Use inventory mode"
      // Set the active inventory and switch inventory mode on
      player.ActiveInventory = inventory[game.inv_activated];
      invMode = true;
    }
    
    else { // The player is inventory mode, run "Use inventory on" interaction
      inventory[game.inv_activated].RunInteraction(4);
      invMode = false;
    }
  }
  
  else if (button == eMouseRightInv) // Else, look at the inventory item
    inventory[game.inv_activated].RunInteraction(1);

}
#115
Hi. I'm busy remaking an old game I made with new features and a new interface (and less typos ;) ) and I was wondering if anybody would be interested in helping me correct the colors, brightness/contrast, hue/saturation and all those other arty things :D

No drawing would be necessary, just need someone with a good eye for colors. There are only about 7 backgrounds (some of them look fine though and would need little touching up).

The game is 320x200 and the backgrounds will be cut to 320x160. There's no rush to a deadline.

PM me or post here if you're interested!

Example of a background (sorry about jpeg):
#116
For a string there's also Character.Name. But yea, it's better to use a pointer.
#117
Thanks Leon! I owe you one.
#118
I'd totally be down for an OROW :D
#119
I just a looked up a video on youtube and I see what you're saying.

One of way doing it would be to just change the text on a label. From what I saw in the video the speech is never removed, so you could just set it and leave it.

Then when you call the function, check if it's the player and if it is then animate a button.

Of course, there's a bit more to it then that, but that's the basic idea.
#120
I remember you of course! It seems we both registered at about the same time. I too have recently returned to AGS after a long extended absence, but I'm super glad I did.

Good to have you back, man.
SMF spam blocked by CleanTalk