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

I have searched the site as well as the Read First and I found some nice templates like the CoMI, but I believe a template such as The Dig would be ideal for me, because it is more simple with only one cursor that does all etc, but I cant find it anywhere..  Anyone knows?

*edit* Also, is it possible to load a template without starting a new game? Like modifying the one you've worked on but want to try out different templates..

Thanks!

Ghost

I don't think anyone here has ever made an "original" Dig template. The Beneath A Steel Sky template might be what you're looking for- it has left/right clicks for examine / interact actions. It doesn't have the inventory panel as in the Dig, though (with a small icon to bring up a window), but that could be scripted. The template can be found on the Resources section of AGS- just browse the template section there.

As far as I know it's not possible to open a template once it has been made into one- you'd need the original folder with all the files in order to open and change it. You can, however, create a new game from a template, make the changes you need, and safe it as a template again.

It's also not possible to "plug" different templates into the same game project- best to create a new game with a template, and try it out.

Scorpiorus

Additionally, you may probably want to take a look at that thread for a script to interact in a similar way Ghost mentioned:

Right Click -- Interact / Select Active Inventory Item / Use Inventory Item
Left Click  -- Examine (Look At) / Deselect Active Inventory Item

daryl

thanks guys you're very kind in assisting me in my quest. I really am trying.. I tried the Beneath a Steel Sky but all I got was another cursor.  I try copying Scorpiorus code but it doesn't work or I get errors and mess up, and I don't know why since I lack coding skills. For instance, where would I put the ProcessClickSpecial() function? I reckoned I would just paste it in it's own column as there was no such thing there already, in the global script.

I think though that every bit of change I want to do to the default game, shaping it like I want it, I need scripting skills. I was hoping that I wouldn't. I'm an artist, and basically all I hope for is to use a template and pretty much just switch existing graphics with my own. Though as The Dig is my favourite inspiration I sure could use such a template, I find it a bit odd if there's no template out there? I'm just thinking maybe there's a way for me to create a game with as much creativity as I want and as little frustration as possible, meaning changing as little as I can of the functions.

Forgive my whining, I'm just a frustrated artist wants to get the show on the road..

Ghost

Nah, that's not whining yet  ;)

I understand your worries. Many people here wish to concentrate on the artistic stuff, and would rather not script at all. But just as it says on the front of the box- AGS isn't for everyone, and scripting is so frequently used it can be considered a must.

Where exactly are your problems, though? How do you get "another cursor"? The BASS template is quite robust and simple; I`m working with it myself, so I might be able to help you out. You can, in fact, replace the cursor graphics, and then all you need to take care about is to have a "look at" response for any object/hotspot/character, and an "interact" action- this one depends on the kind of object you have. For a character you'd use the "talk to" tab, for example.

And why nobody has yet created a Dig template, well, the game's popular, yes, but most people here (including myself) seem to prefer classic SCUMM or Sierra...

Don't give up. Scripting isn't that hard, and once you're a bit comfortable with it, you'll never want to miss it.

Ashen

Quote
I try copying Scorpiorus code but it doesn't work or I get errors and mess up, and I don't know why since I lack coding skills. For instance, where would I put the ProcessClickSpecial() function? I reckoned I would just paste it in it's own column as there was no such thing there already, in the global script.

As a general rule, if you need help with something, you need to give details. (E.g., what errors? Post the messages you get. If the code works, just not like you want, what's wrong - what is / isn't doing that you didn't expect? What do you mean by "paste it in it's own column"? ...) However, the thread about Scorpiorus' code would be the place for that, not here.

I was tempted to lock this thread - questions about finding templates don't belong here, Ghost answered the part of your original post that does (you can't apply templates to a game you've already started), and the other thread is a more appropriate place to get help with Scorpiorus' code. However, if you're likely to be using the existing BASS template, this can stand for help with that, since there's no existing thread for it that I can find. (And there's likely to be a lot of problems with that template, based on the age of it.)
I know what you're thinking ... Don't think that.

daryl

Thanks Ghost, Ashen!. Sorry for being a bit foggy about my troubles, I will try to put some more patience into this and also any upcoming problems on the way. As always I'm too naive thinking how easy it seemed. After all, some scripting skills can't hurt my carrier either, and it would be nice to actually do what you want and understand why too.

Thanks again.

SupSuper

I made a Dig template at one point: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26732.msg340864#msg340864

No idea if the download link still works though, but I can e-mail it to you if you want.
Programmer looking for work

daryl

SupSuper: hey that would be awesome. I checked the links and ironically The Dig template was the only one not functioning, I'd be really greatful if you sent it, check msg. Thanks!

Rocco

im also highly interested in GUI - templates (The Dig + Full Throotle)
please can you re-up these two.

Big thx.

SupSuper

Programmer looking for work

daryl

Hey,

I've played some with SupSupers Dig- template, and managed to have it adjusted for higher resolution and thus another GUI and inventory item positioning, yay! Though I got one problem on the way, and it is that my inventory items are almost invisible, but when clicking on the item it becomes as opaque as it normally should. Does anyone know what the reason for this could be? Changing z-order of the GUI didn't work.. Thanks!

Ashen

Since there's already a topic about the Dig template (which you started): Topics Merged.

The Inventory GUI is mostly transparent (see the game_start function in the Global Script). So, what you're reporting is the way it's meant up to be. If you don't like it, alter the GUI.Transparency value, or remove that line altogther (line 7), to get the effect you want. And try checking the script yourself, before posting, in future.
I know what you're thinking ... Don't think that.

daryl

#13
*edit*: solved. it was a solution of 2 inventories.

The inventory items in the template are opaque even though the inventory window is semi transparent, somehow I managed to funk that
up and have the items do the same. I do check the script, even if it doesn't look like that to someone who knows scripting and these problems as something obvious.

I think it could be because it had 2 inventories, one for the inventory graphics and one for the items.

EDIT2:
Ok so I have a few things left to modify to make this work like The Dig. I've searched for a solution and checked manuals etc but I can't find the right feature or solution..

The right click to bring up inventory works, but if I right click again to remove it nothing happens. It looks like this:

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;
		}
  }
}


it feels like the part below should do the work but it doesn't.

Code: ags

else if (gInventory.Visible) {
		  hide_inventory_window();


Anyone got an idea?
Thanks.

Ashen

Nope, that bit doesn't run, and pretty much shouldn't - the template is in error here, not you. (Although you should've been able to find an answer on the forums, given the number of times it's come up.)

One of the Inventory GUIs is Popup Modal. That means that when it's onscreen, the game is paused. This bit of on_mouse_click:
Code: ags

  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }


Obviously means mouse clicks aren't processed when the game is paused (there's the same thing in on_key_press). You need to re-arrange the code, so that the button == eMouseRight and gInventory.Visible == true checks are performed either before or in the IsGamePaused condition.

On another note, mouse clicks aren't processed over GUIs, so that'll only work if you right click when not over the Inventory GUI. Since it's also code to turn the GUIs off when you move off them (well, when the mouse is within 10 pixels of the edge of the screen), it seems a little redundant anyway. There is a way to register right clicks over GUIs, but I don't remember it off hand.
I know what you're thinking ... Don't think that.

daryl

Thanks Ashen. I guess I could pass on that one since it's okayish to see inventory gone when moving the mouse outside of it.

So I have 2 issues left before I can get started working on the actual game and I hope that will create a breather for everyone so I won't be a bother for a while.

1: when I use an item in my inventory, the cursor turns into that item as it should, but the item sprite stays in the inventory when it should disappear (until I choose to not use it anymore and it shows again in inventory.) Is there a way to solve that?

2. Is there a way to add a function like, double click on far left or right side of the screen and you will jump to the next room without seeing the character walk? I saw that you could paint a hotspot on each side of a screen and have an action bound to when clicking on the hotspot, but I have no idea how to make that into double-clicking.

SupSuper

I apologize about the issues, though I had pointed them out in my other thread.

As you noticed, I tried enabling the inventory to go away on right-click but since I couldn't get it to work I just left the code there since all the other methods work. I also think there's an issue where the description label on the bottom cancels out any mouseclicks there, so you have to set its Clickable property to false.

As for 1:, I also noticed this but I'm not sure if AGS supports it. You'd need to "remove" an item from the inventory whenever it's selected and "add" it back in when it's dropped, but AGS doesn't let characters carry items they don't have.

2: You have to use on_mouse_click to catch double-clicks and then combine that with the hotspot interactions. See here: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=12190.0
Programmer looking for work

Sparky

Quote from: Ashen on Sun 15/04/2007 17:11:34
There is a way to register right clicks over GUIs, but I don't remember it off hand.
I might be wrong, but I think you need to check "handle inventory clicks in script". Then in the on_mouse_click section, add a section for right clicks over the inventory
Code: ags

// left click, right click, etc....
if (mode == eMouseRightInv) {
     // script here
}



Ashen

Re Sparky:
That might be part of it, but there's more to it. That'll only cover right-clicks actually on Inventory Items - there's still the rest of the GUI to deal with. (Also, the code I'm thinking of isn't specific to Inventory GUIs.) Possibly using repeatedly_execute_always and mouse.IsButtonDown(eMouseRight) would achieve it.

SupSuper linked a pretty useful thread for the double click thing. You might also be interested in SkipUntilCharacterStops  - I'm not sure how well it'd work in this case, but might be worth a look.

For 1, it's doable with a little coding, but obviously isn't built in to the Dig template. There's a Grid-based Inventory module that might do what you want, if it works with the template code. I think there was another version somewhere as well, but I can't find that one.
I know what you're thinking ... Don't think that.

daryl

#19
thanks a ton for your replies guys, I'm very greatful.

I'll try to focus on one thing at a time, and I've looked into how to make the player move into the next room using double click as a shortcut, I have this so far:

*edit* new progress..

Code: ags

int double_click; 

if (button==eMouseLeft) {
//SetMouseCursor(GetCursorMode()); // stops wait cursor appearing
double_click = WaitMouseKey(8);
mouse.IsButtonDown(eMouseLeft);
//SetDefaultCursor(2);

if (double_click) {


So I got past the error msgs.. Now I need to bind a function to the double click. Perhaps by adding a custom property to the hotspot I want to double click in? I'm not sure how to add code such as "if double_click over hotspot X, trigger player.ChangeRoom();"

Oh and the code might have things needed repair too, I can't tell but I try.

Any idea?
Thanks..

SMF spam blocked by CleanTalk