Page 11 of 12
Re: Navi - a message library (6/11 demo)
Posted: Wed Jul 17, 2013 8:11 am
by substitute541
litearc wrote:@substitute541: Okay, I think I fixed the problem. Can you try the updated version and see if it works?
download/file.php?id=8073
Okay it works now. Thanks!
Re: Navi - a message library (6/11 demo)
Posted: Fri Jul 19, 2013 6:23 am
by substitute541
I got a suggestion for the library.
I know about the formatters and stuff, (|c{red}, |:, |, etc.) but I'm thinking of a special formatter (not really a formatter, but just a special sequence of characters) that can call a function every time the letter near the formatter is shown (this might be only applicable for messages that you can't skip.) Something like:
Code: Select all
message = _navi:new("I shall |^shake this planet", {someoptions}, shakeTheEarth)
In that case, |^ is the formatter that calls the function, "shakeTheEarth".
Re: Navi - a message library (6/11 demo)
Posted: Fri Jul 19, 2013 11:43 pm
by litearc
That's a great idea, but I think there's something a bit more flexible. Instead of passing a function to call, the message would have an internal flag(s) that gets set when it reaches the i.e. "|^", and it's up to the user to do something based on that flag. This may be more helpful if the function to call accepts arguments or if you want to execute multiple statements, etc... Anyway, I'll implement it later. I'm currently busy trying to learn Qt and don't want to get sidetracked. Thanks!
Re: Navi - a message library (6/11 demo)
Posted: Sat Jul 20, 2013 2:15 am
by Robin
I wouldn't bother with overcomplicating things. substitute541's suggestion is powerful enough. For example, arguments:
Code: Select all
message = _navi:new("I shall |^shake this planet", {someoptions}, function() shakeTheEarth("with", arguments) end)
As for multiple statements... well, a function can always have more than one statement, so you're golden there. Using a system based on flags would probably over-complicate a simple and powerful feature.
Re: Navi - a message library (6/11 demo)
Posted: Mon Jul 22, 2013 6:55 pm
by Daniel Eakins
Helvecta wrote:I've been working on the exact same thing but never noticed this library.
Maybe because it's not on the wiki
In any case, this is a fantastic module.
Re: Navi - a message library (6/11 demo)
Posted: Sat Dec 21, 2013 7:42 pm
by Cluke009
Just in case anything ever happens to the forum link I have copied over this great library to my github account
https://github.com/cluke009/Navi.
There a few modifications I have made at this point but you can just go back to the initial commit for the original version.
Re: Navi - a message library (6/11 demo)
Posted: Thu Sep 18, 2014 6:01 pm
by Chiflada
I'm glad I found this library for my RPG project but I have a problem using it.
When I start my program the screen appears to be darker for a short moment, when my test message appears it is normal again and when it is finished and I hit the enter button the screen gets darker again...
I wonder whether I left out some resetting/reinitialization stuff although I did everything like in the manual.
The code has the following structure:
Code: Select all
function love.load()
-- load game stuff
-- load message library
_navi = require 'arc'
-- create test message
msg1 = _navi:new('Hello world!')
end
function love.update(dt)
-- messaging
arc.check_keys(dt)
-- update game stuff
end
function love.keypressed(key)
-- messaging
arc.set_key(key)
-- process key for game stuff
end
function love.draw()
-- draw game map and character
-- messaging
msg1:play(100,100)
arc.clear_key()
end
Did I miss something?
Re: Navi - a message library (6/11 demo)
Posted: Tue Dec 09, 2014 9:11 am
by DmL
I didn't look at your code sample, but what you are describing sounds like you need to explicitly set your color before drawing after navi/arc has been called.
Re: Navi - a message library (6/11 demo)
Posted: Tue Dec 09, 2014 6:26 pm
by Doctory
this is awesome!
Re: Navi - a message library (6/11 demo)
Posted: Wed Dec 10, 2014 2:02 pm
by Chiflada
DmL wrote:I didn't look at your code sample, but what you are describing sounds like you need to explicitly set your color before drawing after navi/arc has been called.
Hmm, I'm not sure, I still have the feeling that I just missed doing some navi-specific stuff...
I uploaded the real code to github, maybe someone can try it out:
https://github.com/JanaFlauschata/luarpg
Thanks!