Author Topic: LucasArts GUI Help Thread (NEW Scumm GUI Available!)  (Read 132146 times)

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #540 on: 09 May 2017, 12:26 »
Sure, go to guiscript.asc and take a look at the Unhandled Function
instead of:
Code: Adventure Game Studio
  1.     // unhandled USE INV
  2.     else if (UsedAction(eGA_UseInv)) player.Say("That won't do any good.");
  3.  
you could write
Code: Adventure Game Studio
  1.     // unhandled USE INV
  2.     else if (UsedAction(eGA_UseInv)) {
  3.       if (player.ActiveInventory == iKnife) player.Say("I don't want to cut that.");
  4.       else if (player.ActiveInventory == iOtherStuff) player.Say("I don't even know what it is.");
  5.       else player.Say("That won't do any good.");
  6. }
  7.  
The unhandled function is all yours to be edited :)
« Last Edit: 09 May 2017, 14:01 by abstauber »

Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #541 on: 09 May 2017, 14:32 »
great! thanks again:)

Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #542 on: 12 Jul 2017, 10:44 »
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

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #543 on: 12 Jul 2017, 11:51 »
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

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #544 on: 12 Jul 2017, 12:06 »
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.

Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #545 on: 12 Jul 2017, 13:29 »
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

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #546 on: 12 Jul 2017, 13:42 »
Yup, every door is unique (nod)

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #547 on: 12 Jul 2017, 19:21 »
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.

Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #548 on: 12 Jul 2017, 23:01 »
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: Adventure Game Studio
  1. #ifdef USE_OBJECT_ORIENTED_AUDIO
  2. // In AGS 3.2 you do it this way:
  3. //   Audioclip *openDoorSound = aDoorsound;
  4. AudioClip*  openDoorSound,  
  5.             closeDoorSound,
  6.             unlockDoorSound;    
  7. #endif

Aaaand I don't relly get the pointer stuff...
So this here doesn't work.
Code: Adventure Game Studio
  1. #ifdef USE_OBJECT_ORIENTED_AUDIO
  2. // In AGS 3.2 you do it this way:
  3. //   Audioclip *openDoorSound = aDoorsound;
  4. AudioClip *openDoorSound = aTuerAuf,
  5.             closeDoorSound = aTuerzu,
  6.             unlockDoorSound = aTuerAuf;    
  7. #endif
  8.  
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

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
« Reply #549 on: 12 Jul 2017, 23:19 »
Right, you have to assign them inside a function.

Code: Adventure Game Studio
  1. #ifdef USE_OBJECT_ORIENTED_AUDIO
  2. // In AGS 3.2 you do it this way:
  3. //   Audioclip *openDoorSound = aDoorsound;
  4. AudioClip*  openDoorSound,
  5.             closeDoorSound,
  6.             unlockDoorSound;
  7.  
  8. // called by the engine if it exists, at the very start of the game
  9. void game_start() {
  10.   openDoorSound = aTuerAuf;
  11.   closeDoorSound = aTuerzu;
  12.   unlockDoorSound = aTuerAuf;
  13. }
  14. #endif