how do i get rid of dialogue when its finished its waiting time in the coding?

Started by DragzGames, Sun 01/03/2009 23:29:43

Previous topic - Next topic

DragzGames

right what i mean by this is, i have made it to the second room now and i am wondering because my coding:

function room_AfterFadeIn()
  {
  Overlay.CreateTextual(10, 10, 250, Game.NormalFont, 2, "now we are in the game, lets move Ivaen to the box, to do this right click 2 more times and then left click in the box.");
 
  }
function hHotspot1_WalkOn()
{
Overlay.CreateTextual(10, 10, 250, Game.NormalFont, 9, "Great! Now that we have got moving sorted we shall learn how to look at things");
Wait(370);
  Overlay.CreateTextual(10, 10, 250, Game.NormalFont, 1, "right click once to get the look at cursor open and lets try looking at the window");
  Wait(400);

doesnt do a couple of things, firstly it doesnt come up with my text at the start when it comes in and secondly my thrid lot of text appears over my second lot and i am wondering how to solve this by getting rid of the second bit after it elapsed time period finishes and possibly how to solve the first bit of dialgue coming up because it doesnt.

thanks alot=)

DragzGames

Makeout Patrol

I'm not sure why the first one wouldn't be showing up - the only thing I can think of is that you have the function in the script but you haven't gone into the room pane to tell it to execute that function using the lightning-bolt icon. I'm not completely sure that you need to do that at all for room_AfterFadeIn(), though.

Once you've got the first one showing up, though, the other two are just going to show up on top of it because you're not removing the old overlays - you're just pasting new ones in the same place. I don't have the manual handy, but you're going to need to either use a function to change the text of the overlays or use one to remove the old overlay before you create the new one.

I'd also comment on usability. First, you're forcing the player to sit there and watch the overlay for 370 and 400 cycles. As a guy who reads pretty quickly, I'm not going to appreciate that - I should be able to click through these overlays. Instead of wait(), I'd recommend using timers, the room_RepeatedlyExecute() function, and onKeyPress(). It shouldn't be too hard to set up a system that lets your overlays either expire or get removed when the player interacts in a certain way, or to simply let them expire while the player is still able to control the PC.

Having to right-click twice and then left-click to move your character somewhere sounds like an awfully complicated interface, also, but I haven't tried it so it might just be a quirk of the particular situation.

Trent R

I think you might have a problem with scope.... If the Overlay is created within a function, it'll cease to exist once the function is ended. Not sure though, it's been a while since I used Overlays...

Another suggestion to add to what Makeout Patrol was saying about usability, is the WaitKey() command. Read the manual entry, because it describes it pretty well (better than I could).



~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Ghost

Another way would be to use an invisble "narrator" character and simply go with the say/sayAt commands...

SMF spam blocked by CleanTalk