AGS 3.0: Templates to include with AGS

Started by Pumaman, Tue 25/09/2007 23:38:40

Previous topic - Next topic

Scorpiorus

Quote from: Rui "Trovatore" Pires on Sun 21/10/2007 16:33:09It's very handy when teleporting around in debugging.

Yeah, I too think that one is surely handy to have.

QuoteSo - is there anyone else that might be useful in the default game, without going overboard?

You know, while we're at it... is the default template ok as is? I've made one change, I can make more...

Yep indeed, we should probably keep it balanced -- add some really necessary things but keep from bloating the default template's global script with advanced (or not so commonly used) stuff. Again just try not to confuse people having no or little experience with AGS and its scripting language.

Game options GUI is really necessary. Additional debug features may come in handy but the question is how much would that bloat the global script? If they are added, a reasonable idea would probably be to put them into a script module, because debugging features may be used frequenlty but their code changed infrequently. It still may be included into the template as a script module, though.

Double-click handler seems like a candidate for a separate script module. Can't say for sure whether or not it would be useful for the default template to have.

Rui 'Trovatore' Pires

Ok, no point insisting. :)

http://rapidshare.com/files/64251819/Default_Game_2_2.agt.html

One more thing - the previous version, I had AGS disable gamma and speech controls if they weren't available for use. What I'd meant to do, and did now, was to actually turn them off.

If they're just disabled, they still show, but it won't do any good because they won't be used.

If they're turned off, it could leave a gap in the GUI.

Is there a best option?
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

rich

Does there exist a good Text Parser template? Particularly one that still has available mouse support? I think that's something that would be good to add.

My game which I built the interface from scratch has a built in text parser along with the standard point and click interface. I just wish there was a simple way to extract the interface out of the game now that I have all the rooms and graphics added in.
I'm so excited!

Radiant

Quote from: Rui "Trovatore" Pires on Mon 22/10/2007 01:27:00
If they're just disabled, they still show, but it won't do any good because they won't be used.

If they're turned off, it could leave a gap in the GUI.

Is there a best option?
I suppose the best option would be to include two versions of the GUI (easy - export the single GUI to a file, then import it again, and you'll have two). Delete the gamma slider from one, and rearrange the controls to degapify.

While you're editing this anyway (apologies for my hobby horse) could you add rudimentary keyboard control? Something like the below would, I think, be useful to beginners.

Code: ags

int pdir;
function moveplayer (int dx, int dy) {
  if ((dx == 0 && dy == 0) || (pdir == dx + 3 * dy && character[EGO].walking)) {
    pdir = 0;
    StopMoving (EGO);
  } else {
    pdir = dx + 3 * dy;
    MoveCharacterStraight (EGO, character[EGO].x + 500 * dx, character[EGO].y + 500 * dy);
  }
}

function on_key_press (int keycode) {
  if (IsGamePaused ()) return;
  if (keycode == 371) moveplayer  (-1, -1);
  if (keycode == 372) moveplayer  ( 0, -1);
  if (keycode == 373) moveplayer  ( 1, -1);
  if (keycode == 375) moveplayer  (-1,  0);
  if (keycode == 376) moveplayer  ( 0,  0);
  if (keycode == 377) moveplayer  ( 1,  0);
  if (keycode == 379) moveplayer  (-1,  1);
  if (keycode == 380) moveplayer  ( 0,  1);
  if (keycode == 381) moveplayer  ( 1,  1);

  if (keycode == 'W') interface_click (COMMANDBAR, 0);
  if (keycode == 'L') interface_click (COMMANDBAR, 1);
  if (keycode == 'U') interface_click (COMMANDBAR, 2);
  if (keycode == 'T') interface_click (COMMANDBAR, 3);
  if (keycode == 'I') interface_click (COMMANDBAR, 4);
}


monkey0506

I've always thought a default game with some type of generic, empty room would be a very welcome addition. ;D

SSH

Why is an AGS 3.0 template using interface_click calls?
12

Rui 'Trovatore' Pires

#46
Re keyboard movement - there's a keyboard movement module already, maybe that should be added in the default game template?

Thing is, it's hard to tell where the default game stops and where the demo game begins. There's no such thing as a generic room, for instance - all rooms are unique, and if we want to showcase something we use a demo game, not a default template. And if we want an empty room, we just right-click Rooms and "add new room". ;)

But I do believe I will add your other suggestion, Radiant. :) And if you feel keyboard movement really is necessary, say so, and I'll use your code, which is much simpler than the keyboard movement module - though the module does provide with the option to "move upon tap" or "move upon pressing"...

SSH - You know, darn good question. Maybe for extreme compatibility - wasn't Gilbot, f'rinstance, still using 2.62 because of the DOS engine?

EDIT - Rich, re text parser, I do have a SQ2 template, which is also an AGI template. The code is a bit dated now, and some scripting should probably be redone, but it does work. You can take a look, if you like, and try it out, it should still be in freewebs.com/skimbleshanks/. You'll probably need 2.72 or earlier, though.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

monkey0506

Quote from: Rui "Trovatore" Pires on Mon 22/10/2007 09:48:19There's no such thing as a generic room, for instance - all rooms are unique

I'm not wanting to showcase anything. I just want a compilable default template. I understand it's fairly easy to just create a new room but I'm a lazy prat who actually wants something to look at other than just a solid black background. :=

FSi++

Quote from: rich on Mon 22/10/2007 02:18:03
Does there exist a good Text Parser template? Particularly one that still has available mouse support? I think that's something that would be good to add.

Does anyone else need that? I may give it a try.

Radiant

Quote from: Rui "Trovatore" Pires on Mon 22/10/2007 09:48:19
Re keyboard movement - there's a keyboard movement module already, maybe that should be added in the default game template?
Yes, I think that would be a nice idea.

Moving the main character with the cursor arrows is only a nice extra - however, invoking the GUI by keyboard presses (W=walk, T=talk, etc) is essential for LucasArts and VerbCoin GUIs (and a nice extra for Sierra ones). Hence, I would appreciate this being in the standard template. It's only a couple of lines, after all.

Pumaman

Quote from: Rui "Trovatore" Pires on Mon 22/10/2007 01:27:00
Ok, no point insisting. :)

http://rapidshare.com/files/64251819/Default_Game_2_2.agt.html

One more thing - the previous version, I had AGS disable gamma and speech controls if they weren't available for use. What I'd meant to do, and did now, was to actually turn them off.

If they're just disabled, they still show, but it won't do any good because they won't be used.

If they're turned off, it could leave a gap in the GUI.

Is there a best option?

Thanks for your efforts, Rui, but I think we should at least ensure that the default template compiles successfully :D

GlobalScript.asc(91): Error (line 91): '(' expected

Anyway, my vote would be just to turn them off and leave a gap. This is only the default template, after all, and having it start moving controls around or showing an alternate GUI is getting too complicated for that, I'd say.

Rui 'Trovatore' Pires

#51
Gah... I make changes and I forget to test them. Go me! :=

And ok, I'll make 'em leave the gap, include the keyboard movement control and the regular shortcuts toot sweet. Aceeding to monkey, there *could* an initial starting room with a small pre-set walkable area - nice for testing GUIs, just compile and run. Still a black screen, though, monkey.

Barring anything, that should be it. Give me a couple of minutes to get settled, as I've just gotten home, and it should be ready soon.

EDIT - Had a thought, let me know - pre-script mouse wheel to change modes (most people who use the mouse wheel will use it for that), and the middle button for making the player WALK to the destination - Wretched did that in some game, using the middle button as a shortcut for using WALK, and I can't tell you how much I wished everyone else did that.

So, ok if I include these two? I mean, the keyboard movement module is already in...

EDIT 2 - Ok, then, guess not. Right, here it goes then - http://rapidshare.com/files/64742163/Default_Game_2_3.agt.html
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Rui 'Trovatore' Pires

Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman


SupSuper

Quote from: Rui "Trovatore" Pires on Mon 22/10/2007 20:23:42
EDIT - Had a thought, let me know - pre-script mouse wheel to change modes (most people who use the mouse wheel will use it for that), and the middle button for making the player WALK to the destination - Wretched did that in some game, using the middle button as a shortcut for using WALK, and I can't tell you how much I wished everyone else did that.

So, ok if I include these two? I mean, the keyboard movement module is already in...

EDIT 2 - Ok, then, guess not. Right, here it goes then - http://rapidshare.com/files/64742163/Default_Game_2_3.agt.html
I like the mouse wheel idea. :) Maybe thrown in a Restart button in the Control Panel as well.
Programmer looking for work

Rui 'Trovatore' Pires

Ask and you shall receive!

http://rapidshare.com/files/66106219/Default_Game_3.agt.html

Added the mousewheel support, the middle button thing (hey, no one even uses it, like, ever. :P At least let it be a nice shortcut), and the restart option. RESTART gave rise to a ConfirmRestart GUI, which is also very considerate of the game's maker to provide. ;)

Hopefully, this should be the very last thing. We now have a default game template that covers pretty much all the basic things a game should have, as well as some non-basic but rather essential other things.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SupSuper

Very nice work. :) We all know how every game developer tends to be a bit lazy about implementing standards, but we're even lazier at removing the default stuff :P so this will help out a lot.

The Restart GUI should also provide a starting point for anyone looking to make their custom Confirm dialogs.
Programmer looking for work

Pumaman

Thanks Rui -- I've slightly modified your template (basically just changing the wrapping on the comments in the script so that they're readable without scrolling right-left all the time) and included it in beta 15.

Electroshokker's verb coin template is also included.

Thanks to both of you, and Misj, for your help with this.

Rui 'Trovatore' Pires

No worries. Glad to have been of help! ;D
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SMF spam blocked by CleanTalk