LucasArts GUI Help Thread (NEW Scumm GUI Available!)

Started by TerranRich, Fri 01/08/2003 06:04:47

Previous topic - Next topic

abstauber

#540
Sure, go to guiscript.asc and take a look at the Unhandled Function
instead of:
Code: ags

    // unhandled USE INV
    else if (UsedAction(eGA_UseInv)) player.Say("That won't do any good.");

you could write
Code: ags

    // unhandled USE INV
    else if (UsedAction(eGA_UseInv)) {
      if (player.ActiveInventory == iKnife) player.Say("I don't want to cut that.");
      else if (player.ActiveInventory == iOtherStuff) player.Say("I don't even know what it is.");
      else player.Say("That won't do any good.");
}

The unhandled function is all yours to be edited :)


Loslem

Hu guys!

I have 2 questions, both regarding the doorscript.
1. That may be the simpler one: where can I define the default door sounds for opening and closing? The 9Verb pdf says that these sounds will be called if the script is used... but I don't know where to insert them ^^

2. My game is set in a house, hence I use a lot of doors. So when I test the game and run around the rooms, from time to time it happens that doors lock themselves(and of course then there is no key exising). Or doors that should be closed are open. Or the door is open, but the object sprite is not displayed. Anyone else has similar experiences?

Khris

1. open the main guiscript, check lines 48 - 52

2. double check your any_click_on_door functions; this definitely sounds like user error (i.e. wrong parameters)

abstauber

1. in addition to that, you can also use "any_click_on_door_special". In this function you can set a custom audioclip for each door. (Useful if you have a wooden and an iron door.)

2. Make sure you keep track of your door ids. It sounds like some doors share the same id.

Loslem

Thanks to you both :)

Just to clarify: Does that mean that every door in the whole game should have an ID on it's own? I thought that was linked to the room, so I started over from ID 1 in every room. Ahehehe...

abstauber


Khris

Just to be really clear: a door that connects two rooms and is visible in both needs to use the same ID in both room scripts.
If you lock door 7 in room 2, then circle back through the entire mansion to room 3 and look at the same "physical" door from the other side, it has to be set up as door 7 in room 3, too, so the status of being open or locked is retained.

Think of the doors as global objects - each with its unique ID - that can be accessed from multiple rooms. Exactly like Characters.

Loslem

Ah, ohmygod that makes so much sense... I never thouhgt of the doors working that way. It seems to work now :)

Now regarding the sound...

That's what I find in the script:
Code: ags

#ifdef USE_OBJECT_ORIENTED_AUDIO
// In AGS 3.2 you do it this way:
//   Audioclip *openDoorSound = aDoorsound;
AudioClip*  openDoorSound,  
            closeDoorSound, 
            unlockDoorSound;    
#endif


Aaaand I don't relly get the pointer stuff...
So this here doesn't work.
Code: ags

#ifdef USE_OBJECT_ORIENTED_AUDIO
// In AGS 3.2 you do it this way:
//   Audioclip *openDoorSound = aDoorsound;
AudioClip *openDoorSound = aTuerAuf,
            closeDoorSound = aTuerzu,
            unlockDoorSound = aTuerAuf;    
#endif

Debugger says: "Cannot assign initial Value to global pointer"
Sry guys, for the most part of the coding stuff I'm doing fine, but here I don't get how it's done right :/


Khris

Right, you have to assign them inside a function.

Code: ags
#ifdef USE_OBJECT_ORIENTED_AUDIO
// In AGS 3.2 you do it this way:
//   Audioclip *openDoorSound = aDoorsound;
AudioClip*  openDoorSound,
            closeDoorSound,
            unlockDoorSound;

// called by the engine if it exists, at the very start of the game
void game_start() {
  openDoorSound = aTuerAuf;
  closeDoorSound = aTuerzu;
  unlockDoorSound = aTuerAuf;
}
#endif

croquetasesina

 I was looking for how to add arrows to scroll in the inventory and also in the dialogs to add more than 5 options. However the links I find plugins or modules are obsolete. I can not find the way Could someone help me please?

abstauber

The template that comes with AGS already has this build in. The scroll arrows appear automatically as soon as they are needed.

croquetasesina

You're right, I forgot to add the item and it did not come out. Take me, but in any case, thank you very much for the quick response

croquetasesina

How could I change the GUI language from the game? I would like to press a button to change to another language. I do not know what it puts in any_click of an object exactly

croquetasesina

I was trying with this, but nothing happens

Code: ags

function english_AnyClick()
{
 //switch the GUI to English
  int lang = eLangEN;
  AdjustLanguage();
  AdjustGUIText();
  
  if (Game.ChangeTranslation("English") == true) {
    Display("English loaded");
}
}


Can anyone help me please?

Khris

Open guiscript.ash (header), then add this anywhere in a separate line:

Code: ags
import int lang;


Then open the main guiscript.asc and find
Code: ags
int lang = eLangEN;

It's line 16 for me.
Right below, add this:
Code: ags
export lang;


Finally, in your code, remove "int":

Code: ags
  lang = eLangEN; // change global variable


For further questions best use the template's thread: https://www.adventuregamestudio.co.uk/forums/index.php?topic=38874.0

croquetasesina

I had to delete "import lang" from GlobalScript.ash, but now all run perfect with your directions. That's perfect!! Thank you very much Khris :)

croquetasesina

Wuooops! I have been checking that only the verbs change, however, the screen to load the game, pause, exit the game and the rest is still untranslated. Is this normal?

croquetasesina

I've been trying and trying to see what's wrong, but I do not find much sense. When the game starts in English, everything is completely in English. When you click on Spanish, everything is activated in Spanish, the nine verbs change, the action text changes, and even the entire save and load game menu. Up to here everything perfect. However, when I press the button to return to English, the 9 verbs and the action text change perfectly to English again, but the entire GUI of F5 continues in Spanish.
I'm sorry to continue on this subject despite your recommendation Khris, but I thought maybe it was better to finish it here and take into account your guidance for other future questions and definitely ask there.

Cassiebsg

-i think you should move to the proper thread like Khris suggested, as the author follows that thread and will more quickly give you a quick straight answer.
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk