TEMPLATE: 9-verb MI-style 1.6.4 - Last update: 4th April 2019

Started by abstauber, Thu 17/09/2009 16:16:37

Previous topic - Next topic

cianty

Left-clicking on a hotspot does cause the character to go to the object if the hotspot has a WalkToPoint other than (0,0). Objects however do not have WalkToPoints. This has nothing to do with this template - AGS simply does not specifiy WalkToPoints for objects.

This is what I do:

Code: ags

function oMyObject_AnyClick()
{
  player.Walk(X,Y, eBlock, eWalkableAreas);

  if(UsedAction(eGA_LookAt)) {
    player.Think("It's my object.");
  }
  else if(UsedAction(eGA_Use)) {
    player.Think("I can't touch this - daa da da daaa.");
  }
  else Unhandled();
}


Manually make the player go to (X,Y) before processing any specific actions. Sometimes I only include the walk command in the physical actions such as push/pull/open... and let the character "look" from away without moving. But what you may then want to include is a player.FaceX command to at least face the object.
ca. 70% completed

poplamanopla

First thank you very much for answering so quickly.
It works great.

Really, thanks for answering.

Now I see it as an easy thing to do, but I was obfuscated trying to find a solution.
For the next time, I will drink a cool beer before make a question.

Thanks again.

cianty

I am happy to be of service! There's a lot to be learned on these forum, but only if questions are asked.
Cheers!
ca. 70% completed

abstauber

If you use the build-in function MovePlayer, you can also get rid of the blocking movement. That's even more SCUMM-esque :)

Code: ags

function oMyObject_AnyClick()
{

  if (MovePlayer(X, Y)) {

    if(UsedAction(eGA_LookAt)) {
      player.Think("It's my object.");
    }
    else if(UsedAction(eGA_Use)) {
      player.Think("I can't touch this - daa da da daaa.");
    }
    else Unhandled();
  }
}

cianty

I have to shamefully admit that I didn't have a proper look at the new built-in functions that come with the template. That's because it is my first game (blah blah not recommended blah ;) ) so I kept the "new things" to a minimum.
ca. 70% completed

cianty

Maybe someone can help me: I need to draw a gui above the dialog gui (gDialogsgui) but I just can't make the other gui appear above the dialog, despite the ZOrder property indicating that it should work... Any thoughts?
ca. 70% completed

Khris

This isn't specific to the template, is it?

Nevermind, I suspect that the Dialog GUI is always drawn above everything else, regardless of its z-Order property.
Not knowing what exactly you want to achieve I'll simply point you here:
http://www.adventuregamestudio.co.uk/manual/DialogOptionsRenderingInfoFunctions.htm
This allows you to completely customize the rendering of the Dialog GUI.

cianty

Quote from: Khris on Thu 21/10/2010 22:15:59
This isn't specific to the template, is it?

I wasn't sure and thought maybe it was a special property of this template's dialog gui, which on second thought seems rather stupid. ::)

Thanks for pointing in that direction, though I'm not sure if that's going to help me.
ca. 70% completed

Khris

So, what effect do you want to achieve? Maybe there's an easier way.

abstauber

Another trick is be to make the dialog GUI's background completely transparent and only let the text appear.
Then a GUI behind looks like it's the actual gui.

If it's about scroll buttons or other customisations, take a look at this module. http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36313.0

cianty

Changing the transparency to 100 doesn't suffice as then there's still the black box of the GUI instead of the GUI below being visible. However, it did give me an idea... I can dynamically build a sprite to my needs (as it is just about displaying some info) and then switch the background image of the dialog GUI.

Since you asked, this is what I'm doing:

At some point in the game there appears a dialog gui with text options for the player's wager. I then want to display his remaining chips in an info field on the right (guess what this is all about ;) ). So it should look like this (without text here):


Before you two had posted I made this workaround:


Now I have to decide which way I go... The first option is prettier I think, and it doesn't clutter the screen like using an additional row. In the second version however, the dialog GUI doesn't "change" so drastically, which is generally desirable, because you'd want consistency with your GUI . I don't think this is a big issue though, so I will probably go with version 1. I also think by now this belongs in the Critics Loungs so enough of this talk already. :)

Anyways, thanks for your help! I still have no clue how one would easily display another functional GUI without delving deep into the above quoted section of the manual. For my needs though, I have a solution. :)
ca. 70% completed

Khris

As a final note maybe, you don't have to use the built-in dialog mechanism for this; why not create a standard GUI with appropriate buttons and turn it on?

cianty

Quote from: Khris on Fri 22/10/2010 19:26:32
As a final note maybe, you don't have to use the built-in dialog mechanism for this; why not create a standard GUI with appropriate buttons and turn it on?

Yes, that would be another option. But I do use a lot of the dialog functinality in this part so this is the most convenient way to do it.
ca. 70% completed

josemarg

Hello there!!!

First of all, let me say that's AWESOME (with capital letters) the work you've done with this template!!

It's all I was going after :)

Now let me explain the matter...

I want to do an adventure using your MI-style template, but I want to translate it to Spanish (I didn't see translated it yet). And I read the manual section of "Translation" but I'm a little lost and didn't see anything of "change the gui image" or something like that...

I see that with the template comes a PSD document to modify it with Photoshop. No problem at all here, because it's a piece of cake to translate it in Photoshop.

The hard thing (to me, that I'm a newbie) is to use the PSD translated version and OVERALL, to translate the commands and its keyboard shortcuts (Give -> Dar, Talk to -> Hablar con, Give -g- Dar -d-, Talk to -t- Hablar con -h-...).

Did I explained myself correctly?

Can you guide me into the correct path, please :)

A lot of thanks!!

Khris

Edit: I probably misinterpreted your post; open guiscript.asc in the project tree and navigate to the AdjustLanguage() function. In there you can set the button sprites and shortcuts. Just uncomment the German block and alter it.


The template is already built to make the translation of the GUI as easy as possible.
All you do is import the modified GUI buttons into the Sprite manager, then translate the game as usual. In the translation source you'll find lines like this:
Talk to %s

a_button_give 5 802 803 Gg
Translating the verb line is obvious; in the case of the button line it's important not to put the text into the translation (don't really know why, all I know is keeping it in the translating screws things up).
So as an example, say the give button is supposed to be at position 3 on the GUI, its up and down sprites are 45 and 46 and the shortcut is d, the translation file is supposed to look like this:
...
a_button_give 5 802 803 Dd
3 45 46 Dd
...

josemarg

Wow! That was a fast answer!!

Thanks for your time! I've done the text translations, now I'm going to try to change the GUI sprites.

Thanks!!!

Khris

In case you missed my edit at the top of my previous post:
Changing the GUI with the translation file method is only suitable if you want to translate a finished game.
To translate the game while/before making it, use the AdjustLanguage function.

josemarg

Yep, understood :)

I add the Spanish Buttons in this post. Maybe are useful for somebody without Photoshop knowledges. Download them from:

http://www.elmeuprofe.com/ButtonsSPA.rar

Thanks for your help!!!

abstauber

Cool, thanks for sharing!
This brought my attention to a more elegant way of internationalisation, so I'd like to deliver verbs buttons in the most common languages (plus my own since I'm selfish ;) )

In a first step, translating the GUI buttons (including options) would be great, so I've prepared a code block and it would be awesome if some native speakers could punch in their language :)

Same goes for the verb buttons themselves, I already included english, german and now also spanish.
So if anyone could grab that photoshop file, and create some verbs, that would be cool too. (Even more cool, if you could provide a little txt with the english translation of those verbs).

Anyhow, here's the code block.

Code: ags

// English
    OptionsTitle.Text   = "Options";
    OptionsMusic.Text   = "Music Volume";
    OptionsSound.Text   = "Sound Effects ";
    OptionsSpeed.Text   = "Game Speed";
    OptionsDefault.Text = "Default";
    OptionsSave.Text    = "Save";
    OptionsLoad.Text    = "Load";
    OptionsRestart.Text = "Restart";
    OptionsQuit.Text    = "Quit";
    OptionsPlay.Text    = "Resume";
    gPausedText.Text    = "Game Paused. Press Space to Continue";
    RestoreTitle.Text   = "Please choose a game to load";
    RestoreCancel.Text  = "Cancel";
    SaveTitle.Text      = "Please enter a name";
    SaveOK.Text         = "Save";
    SaveCancel.Text     = "Cancel";
    gConfirmexitText.Text = "Are you sure, you want to quit? (Y/N)";
    gRestartText.Text   = "Are you sure, you want to restart? (Y/N)";



If this is working out, I'd also like to provide default unhandled events, but of course that depends on the success of the first step.

Thanks in advance ;)

BlueAngel

Hi
Trying out this template and I have one embarrassing problem.
How do you make cEgo clickable (the player)?
Like if I have an apple in inventory that I want him to eat.

I have tried with the same script as Bman but it dont work...

SMF spam blocked by CleanTalk