Okay it works now. Thanks!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
Navi - a message library (6/11 demo)
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: Navi - a message library (6/11 demo)
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: Navi - a message library (6/11 demo)
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:
In that case, |^ is the formatter that calls the function, "shakeTheEarth".
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)
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
Re: Navi - a message library (6/11 demo)
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!
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Navi - a message library (6/11 demo)
I wouldn't bother with overcomplicating things. substitute541's suggestion is powerful enough. For example, arguments:
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.
Code: Select all
message = _navi:new("I shall |^shake this planet", {someoptions}, function() shakeTheEarth("with", arguments) end)
Help us help you: attach a .love.
- Daniel Eakins
- Citizen
- Posts: 99
- Joined: Thu Jul 18, 2013 9:14 pm
- Location: France
Re: Navi - a message library (6/11 demo)
Maybe because it's not on the wikiHelvecta wrote:I've been working on the exact same thing but never noticed this library.
In any case, this is a fantastic module.
Re: Navi - a message library (6/11 demo)
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.
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)
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:
Did I miss something?
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
Re: Navi - a message library (6/11 demo)
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)
this is awesome!
Re: Navi - a message library (6/11 demo)
Hmm, I'm not sure, I still have the feeling that I just missed doing some navi-specific stuff...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.
I uploaded the real code to github, maybe someone can try it out: https://github.com/JanaFlauschata/luarpg
Thanks!
Who is online
Users browsing this forum: No registered users and 2 guests