Author Topic: NANG Text?  (Read 1501 times)

MatthewRPG

  • Guest
NANG Text?
« on: November 25, 2015, 01:44:40 PM »
( Ignore the fact that this is my first post.  )
Just gonna get to the point- I've been trying to replicate the NANG textbox system, and I haven't had any dice. By the system, I  mean that the dialogue types itself out, instead of appearing all at once. Help would be appriciated.
:TriHard:

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 46.0.2490.86 Chrome 46.0.2490.86
    • View Profile
  • Playstyle: Keyboard
Re: NANG Text?
« Reply #1 on: November 25, 2015, 02:09:32 PM »
I'd guess make a string which is the full dialog and then a blank string which gets added to each step using string_char_at(string,position). Each time the position advances a step, add that to the blank string, and play a sound if you want. Then you can clear the text if you go on to the next dialog or something. Too lazy to figure out how to do line advancement, so just use enter signs. xdd

Hope this helped. I'll bet klazen or someone can code it out for you.
(click to show/hide)

smoke weed everyday

Keygrin

  • Wannabe
  • Posts: 19
  • Keygrin
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 42.0 Firefox 42.0
    • View Profile
    • Keygrin
  • Playstyle: Keyboard
Re: NANG Text?
« Reply #2 on: November 25, 2015, 02:48:01 PM »
Here, have this old TextBox code I found:

In Create Event
Code: [Select]
//this is the mssg, th '#' are new lines

message[0]="Hello World! I am Text 0!"
message[1]="Blah blah blah, I am Text 1!"

//speed
length=0;
//message id
messagen=0

alarm[0]=60 //Optional. I'd use this Alarm only if the next message will show on its own.

In Alarm[0] Event
Code: [Select]
if (length<string_length(message[messagen]))
alarm[0]=240
else
{
length=0
messagen+=1
alarm[0]=240
}

or some Key Press Event
Code: [Select]
if (length>=string_length(message[messagen]))
{
length=0
messagen+=1
}


In Draw Event
Code: [Select]
if (length<string_length(message[messagen]))
length+=0.25
draw_text(view_xview+0,view_yview+320,string_copy(message[messagen],0,length));
« Last Edit: November 25, 2015, 02:53:28 PM by Keygrin »
YouTube Channel

I await the day I die! Living is meaningless to me.