Serex Posted September 10, 2017 Report Share Posted September 10, 2017 ¿Cansado de poner [ENTER] en tus quests? O nose, ¿cansado de tener que poner 10 says para un texto sencillo? Bueno, yo lo estaba, acabo de crear una función que nos resuelve este problema. La función busca automáticamente la última palabra, para así no cortarla, como hace la función say normal. Y te escribe todo el texto rellenando la línea al máximo posible. function say2(msg) msg_size = string.len(msg) if msg_size > 59 then local i = 59 last_word = nil while last_word == nil and i > 0 do if string.sub(msg,i,i) == " " or string.sub(msg,i,i) == "." or string.sub(msg,i,i) == "," then last_word = i end i = i-1 end if i == 0 then last_word = 59 end say(string.sub(msg,0,last_word)) say2(string.sub(msg,last_word+1)) else say(msg) end end Ahí teneis la función que deberéis agregarla en vuestro questlib.lua, y agregar en quest_functions esta línea: say2 Y esta tan fácil de usar como esto: #Ejemplo con texto del translate.lua say2(gameforge.rage_quest.text1) #Ejemplo texto normal say2("Lorem Ipsum es simplemente el texto de relleno de las imprentas y archivos de texto. Lorem Ipsum ha sido el texto de relleno estándar") Jfirewall, SeMa™, WorldArd and 4 others 7 Quote Link to comment Share on other sites More sharing options...
Break Posted September 10, 2017 Report Share Posted September 10, 2017 Gracias serex. Nos sera de mucha ayuda!! Quote Link to comment Share on other sites More sharing options...
Phoenix Posted September 10, 2017 Report Share Posted September 10, 2017 Por fin! Gracias! Quote Link to comment Share on other sites More sharing options...
felixenpr Posted September 10, 2017 Report Share Posted September 10, 2017 Te amo. Quote Link to comment Share on other sites More sharing options...
Shang Posted September 10, 2017 Report Share Posted September 10, 2017 Interesante aunque las quests quedaron en el olvido, hubiera venido bien hace unos años. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.