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

#1
Quote
As for stating the delay, the key word is "optional".
By using the import line like I suggested, you can state the delay or omit it, which will set it to 4.

Ok yes got it, even more handy.

And yes thank you that solved it!! I don't quite understand all of it for now but i'll make sure to study it :)
Thanks for the quick reply and taking time to explain, you guys are awesome.
#2
Okay thanks a lot! Works like a charm :) i kept the int delay, i like being able to change the speed directly.

But i still get the same problem as with Snarky's script: when i click on a finished line, it skips to the next without typing.
If i put a wait() just after the waitmousekey it's good, but when i click on a dialog option for example the next first line skip the typing.
#3
Hi Khris!

I get a "Error (line 15): Parameter type does not match prototype" :/

#4
Ooookay thanks i see now. Works the same!

I can skip, but i think it's messing with the waitmousekey, if i click when the line is done it's getting to the next line directly whithout the typing effect.

I've got:

Code: ags

 
     i++;

      if (mouse.IsButtonDown(eMouseLeft)){
      i = text.Length;   
      }  
  }
      if (TypedText.Valid)
     WaitMouseKey(TYPEnarrator_MAXIMUM_DISPLAY_TIME * (delay * 4));
     // if i put a Wait() here it's solving the problem but not for the first line in the dialog (which is triggered by an option)
     TypedText.Remove();
      }


I think i'm missing a stupid detail as always :/
#5
Hi Snarky!

Code: ags

displayedLine = text.Truncate(i);


I loose my last letter!
(thanks for the text.Length-1 tip)


Hey Danvzare!

It works perfectly indeed, thank you! I didn't know it was "proper" to use StartCutscene/EndCutscene like that.
#6
Hey everyone!
First i want to thank you all for your help, i have been cruising the forum as a guest for weeks and resolved all my problems thanks to you guys.

Well until now, my limited scripting knowledge is showing.
I've got a typewriting script and it works great, but i want to be able to skip the typewriter effect and show the entire line being typed at once (on mouse click or key press):

Code: ags

    Overlay *TypedText;
    
      void CommentNARRATOR(int delay, String text){ 
                                                          
 
     int x; 
     int y;
     AudioClip *sound;
     sound = aNarrator_voice;
     String displayedLine = "";
     int i = 0;
  
  while (i < text.Length) {
    
     displayedLine = String.Format ("%s%c", displayedLine, text.Chars[i]);
     TypedText = Overlay.CreateTextual(85, 530, 555, eFontnarrator, 65535, displayedLine);
    
    if (text.Chars[i] == ' ')
       Wait(delay/2);
    else if (text.Chars[i] == '[')
       Wait(delay/2);
    else {
      if (sound)
        sound.Play ();
       Wait(delay);
        
     }

     i++;

  }
 if (TypedText.Valid) 
     WaitMouseKey(TYPEnarrator_MAXIMUM_DISPLAY_TIME * (delay * 4));
     TypedText.Remove();
     }



I tried multiple things, but nothing worked.

if (mouse.IsButtonDown(eMouseLeft))
i = text.Length;
is a start but only type the first letter?
SMF spam blocked by CleanTalk