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

#1
Thanks for showing me the link, it might help me.
#2
It's very simple, how can I show all the hotspot labels of a room? For example by pressing the "H" key.

Thanks!
#3
Great, it will be very useful for me. I'll try the Dialog Designer, but from now on I think I'll declare the constants.
#4
Thanks to both of you. I'll see how I do it.

What is clear is that dialogues should be better planned in advance.
#5
Well, the issue is that I haven't designed the dialogues 100% from the beginning, so I am adding options during the development of the game. So in the end, the dialog options can be displayed in no very logical order.

For example, specific questions on a topic may appear first, and an introductory question last.

The issue is that changing its ID is cumbersome, because it forces you to review parts of the code where you control when these dialog options appear and disappear.
#6
Hi!

Is there a way to sort the dialog options without changing their id?

In some dialogs I would like to change the order in which the options are displayed, but I would like to do it without changing the ID number. If I change the ID I would have to change it elsewhere in the code and it could lead to errors.

Thank you so much!
#7
Thank you very much Khris!

It's just what I was looking for. You have helped me a lot again.  :)
#8
Sorry if I didn't explain myself quite well. :-[

Exactly, it would rather be about using a room object A on another room object/hotspot B, without using it directly from the inventory.
#9
Hello and thanks in advance, you have always solved all my doubts.

I am working with Tumbleweed Verbs template. I want that when the player picks up or uses an object on the room, it automatically shows in the action bar "use [item] with". Where [item] is an item that you will have in the inventory. The end result should be the same as if you had used the item from the inventory, but you must use it from a room object.

I hope it is understood. Thank you!
#10
InitGuiLanguage(); I can't use it, it's from the Tumbleweed template. But instead I have done this and it already works perfectly:
Code: ags
Game.ChangeTranslation("English");
lang = eLangEN;
AdjustLanguage();
AdjustGUIText();
System.SaveConfigToFile();
Thanks for the support.
#11
Hi

In a previous project I used the Tumbleweed template. I put some buttons inside the game menu to be able to change the language from there. I used this function so that all 9 verbs would update on button press:
Code: ags
Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangEN;
Now I'm modifying an old project, and it uses the 9 verbs template (but not Tumbleweed), so I can't use the previous function. I have not found a way to achieve the same. When I change the language the 9 verbs are not updated.

Thanks for the help.
#12
Thanks, I'll try it.
#13
Hello,
I have always been using the Tumbleweed template and now I have some question about how to use some basic things from the BASS template.
If I want to make the player go to a hotspot and then say something, without being blocked, I would use this:

Code: ags
function hHotspot1()
{
if (Verbs.MovePlayer(175, 90)){
player.FaceDirection(eDirectionUp);
if(Verbs.UsedAction(eGA_LookAt)){
player.Say("");
}
else Verbs.Unhandled();
}
}

But I don't know how to do it in the BASS template:

Code: ags
player.Walk(140,143, eBlock);
player.Say("");

This code does not work for me because the player is blocked until he reaches the hotspot.

Thanks for the help!
#14
Ok! Thanks, now it works :)
#15
I am calling the function in the button event this way:

show_restore_game_dialog

If I call the function in a room hotspot like this:

show_restore_game_dialog();

It works perfectly.
#16
Hi,
I have a room with a load game button. In the button events I put the function:

show_restore_game_dialog

When loading the GUI into the game I get this error:

Runtime error: wrong number of parameters to exported function 'show_restore_game_dialog' (expected 0, supplied 2)

Thanks!
#17
Ok, thanks for the correction!  :-[

Well, the error is in the default code of the Tumbleweed template!
#18
It seems that it doesn't work. Still does not change the GUI language when loading a save in another language. However, the rest of the text does change it.

Now I have this in the global script:
Code: ags
function on_event(EventType event, int data) {
  if (event==eEventLeaveRoom)
  if (event==eEventRestoreGame) {
        Verbs.Localize();
        //new code
        if (Game.TranslationFilename == "English") {
        Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangEN;
        Verbs.AdjustGUIText();
        }
        else if (Game.TranslationFilename == "") {  
        Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangES;
        Verbs.AdjustGUIText();
        }
        //
  }
  if (event==eEventEnterRoomBeforeFadein || event==eEventRestoreGame)
    player.PlaceOnWalkableArea();
}

[EDIT]
I think when it loads the game it doesn't read this code. I have added a player.Say() inside the eEventRestoreGame and it does not execute it when loading the game.


[SOLVED]
That's it. Now it works. The code is the following:
Code: ags
function on_event(EventType event, int data) {
  if (event==eEventLeaveRoom)
  if (event==eEventRestoreGame) {
        //this part here is not executed...
        Verbs.Localize();
  }
  if (event==eEventEnterRoomBeforeFadein || event==eEventRestoreGame)
    player.PlaceOnWalkableArea();
    
        if (Game.TranslationFilename == "English") {
        Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangEN;
        Verbs.AdjustGUIText();
        }
        else if (Game.TranslationFilename == "") {
        Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangES;
        Verbs.AdjustGUIText();
        }
}
#19
Thank you very much for your answer. Yes, indeed these days I have been able to test it and it has been solved. To change the language from within the game I use:
Code: ags
Game.ChangeTranslation("English");
Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangEN;
Verbs.AdjustGUIText();
System.SaveConfigToFile();
That way it changes the language of the GUI and texts perfectly.

But there is still a small detail that I would like to fix. If you load a save game in a language other than the current one, then the GUI doesn't switch languages  either. It would be solved by adding this code:
Code: ags
        if (Game.TranslationFilename == "English") {
        Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangEN;
        Verbs.AdjustGUIText();
        }
but I don't know where to put it. It should be at the time of loading... Can you give me a hand?

Thank you!
#20
Hello! I need some help on changing translation in game.

First I must say that the game uses the Tumbleweed template.

I have the default game in Spanish and I have added a test English translation. When I change the translation from winsetup everything goes well. The texts and the GUI change languages and the changes are maintained in the following sessions.

The problem is when I change the translation from within the game through:

Game.ChangeTranslation("English");

What happens is that the language of the texts is changed but not that of the GUI and in the 9 verbs. In addition, the changes are not maintained in the following sessions either.

Let's see if you can give me a hand. Thank you so much!

[EDIT]
I have added this:
System.SaveConfigToFile();
And now the language changes are maintained in the following sessions. But I still have the problem that the language of the 9 GUI verbs is not changed. Instead, it does when I log out of the game and back in.
SMF spam blocked by CleanTalk