Is there a The Dig template to be found anywhere?

Started by daryl, Mon 09/04/2007 11:26:44

Previous topic - Next topic

daryl

Anyone?

I've had no success with this, but supposedly a common problem?
Thanks

Ashen

What makes you say it's a common problem? I don't think I've heard of it before.

What do you mean by "the Interact cursor" - eModeInteract, whatever interaction was used ('Player looks at Hotspot' changes to eModeLookat, etc), the default Inventory cursor...? Apart from the Wait cursor appearing during blocking actions, I can't think of a reason AGS would change the cursor itself. What does your on_mouse_click look like? (Also - Sorry, I've lost track of what template you're using, or if you're using one at all. Are you, and if so which one?)
I know what you're thinking ... Don't think that.

daryl

#42
*EDIT*
It seems to be due to double_click = WaitMouseKey(8 )*mouse.IsButtonDown(eMouseLeft);
But I need that one to be able to jump to the next room quickly by double clicking on a Hotspot.. :/


thanks Ashen for your reply-

I started with SupSuper's The Dig template which had much of the originals way of functions and behaviour, and I modified it to be even closer to The Dig.

Sorry if being a bit unclear, let me try to explain.

The template works in a way that one cursor (looking like crosshairs) does all kinds of actions- Interact, WalkTo, LookAt etc.
So when I for example walk, I don't need to bother what action to use, just to click anywhere on the screen, same with the other actions.

But if the cursor is an inventory item, and I click on the screen (to walk, or use the inventory item with something etc), the cursor changes temporarily to the action cursor (the crosshairs) and then back to the inventory item. I'm looking for a solution when this doesn't happen. Perhaps if the (eModeUseInv) cursor could function as the action cursor whenever it's active, or if the action cursor could adapt to the graphics of the inventory item, hiding the switch between cursor sprites.

This is what my on_mouse_click looks like-

Code: ags

#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) {  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) {
    if (!IsInteractionAvailable(mouse.x,mouse.y,mouse.Mode)) {
      ProcessClick(mouse.x, mouse.y, eModeWalkto );
    } else {
			ProcessClick(mouse.x, mouse.y, mouse.Mode );
		}
  }
  else {   // right-click, so show inventory
		if (player.ActiveInventory == null) {
			show_inventory_window();
		} else if (gInventory.Visible) {
		  hide_inventory_window();
		} else {
		  player.ActiveInventory = null;
		  mouse.Mode = eModeInteract;
		}
	
}

//if (button==eMouseLeft) {
//Mouse.UseDefaultGraphic();

double_click = WaitMouseKey(8)*mouse.IsButtonDown(eMouseLeft);

	}


Thanks.

daryl

#43
Ok, I can't solve the double_clicking one, a bit surprised if no one else using a double_click feature don't have the same problem.

So basically I just put a "any click on" on the exit/ warp hotspots, for the time being.

Moving on!
I put an object in the scene, set the interactions of it so that "any click/ interact/ use inventory on" would make the character walk to a specified position, then pick it up or whatever.

Question1:
If I click on the object and the character starts moving towards it, how can I interrupt his walk if I decide to walk elsewhere and not to the object?

Question2:
This one might be solved if Q1 is solved but anyways, can I disable the Wait cursor that appears while the character walks towards the object?

Thanks!

SupSuper

The only way to do that is to have a "non-blocking" Walk command, but then the character would pick up the item instantly after starting to walk.
Programmer looking for work

daryl

#45
*EDIT*

I added cEgo.Frame==0 so that he didn't pick up the object when walking across it, but only under the condition that he had stopped walking, which is on frame 0.

---------------------------------------------------------------------------------------------------------------------------------
Yeah. I solved this late yesterday night, here is my solution if anyone else hits the same problem:

First off, in the Interaction Editor for the object (Looking Glass) I put a "Character- Move Character" attribute into "Interact Object"
I specify destination XY location, 662 and 242, and had the "Wait for move to finish" to False, (ie no-blocking) so that I can be able to change action any time after this is triggered.

Then in the room script under Repeatedly execute I did this:

Code: ags

// script for Room: Repeatedly execute

}  

// script for Object 0 (Looking glass): Interact object

if ((cEgo.x==662)&&(cEgo.y==242)&&(cEgo.Frame==0)&&(mouse.Mode == eModeInteract))  {
object[0].Visible=false;
player.AddInventory(inventory[1]);

}
}


This made the character walk to the object, then pick it up, and I could still change my mind while he was walking.

This also solved my 2nd issue with the wait cursor, as it doesn't appear now as the "Wait for move to finish" is False.

Mariano Cirigliano

#46
Quote from: SupSuper on Fri 13/04/2007 23:42:46
By popular demand:
- Full Throttle
- The Dig

The web to unload the TEMPLATES they do not work any more.

That someone returns to raise please, especially that of THE DIG.

Thank you!.

Matti


SMF spam blocked by CleanTalk