Save-Point
Drawing contents - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: Drawing contents (/thread-5065.html)



Drawing contents - Gardesion - 03-15-2014

Hey there,

I will try to be as specific as possible; it's 5 AM.

Event 1 script call : $notice: "Hey there!"
Event 2 script call : $notice: "Save-point."
Event 3 script call : $notice: "Do you think we could get this to work."
Event 4 script call : $notice: "I bet there's someone smart reading this."

There is only one notice in my "notice box" (part of my hud) at a time. One fades after a short period.

However, I would like to keep a history log of these notices.


I tried storing these strings in variables via checks in my "notice" Window, this just doesn't seem to work.

Par example;

Code:
(Assuming event told script what $notice is right now and $index was increased by 1.)

If $notice != nil
self.contents.draw_text(x, y, width, height, $notice.to_s)
$game_variables[10 + $index] = $notice.to_s
end

Then in the expanded window:

Code:
self.contents.draw_text(x, y, width, height, $game_variables[11].to_s)
self.contents.draw_text(x, y, width, height, $game_variables[12].to_s)
self.contents.draw_text(x, y, width, height, $game_variables[13].to_s)

For example new notice becomes notice 4 and notice 3 becomes two. It's a mess.

The following is what I would like to accomplish through variables and checks when the player expands this notice box, but I just can't get it to work right.

$notice4 "Hey there!"
$notice3 "Save-point."
$notice2 "Do you think we could get this to work."
--------------
$notice1 "I bet there's someone smart reading this."
--------------

Basically, notice4 was the first thing the player received.
When there is a new notice, new notice becomes notice 1, notice 1 becomes 2, 2 becomes 3 and 3 becomes 4. This is just simplified, I want to make a log of 20 text lines.

I was thinking about something like $notice[var], but a variable in a variable on the other hand doesn't really makes sense to me..

Anyone kind enough to guide me in the right direction?

Thanks in advance!


RE: Drawing contents - DerVVulfman - 03-16-2014

Hey, Gardesion. Mebby you might wish to try working backwards and find a log script that would show the last 5 or 10 messages? Then it would be a simpler matter to make a window that showed only the most recent message while keeping the original 5 message log intact.

Do I know of one? No

TWO actually, both basically by JayRay. They were made for ABS battlesystems.

The first GameLog is Mr.Mo ABS Game Log Window which is made for the MrMo ABS system and it has its own separate thread. Meanwhile, the Lycan ABS Game Log is found within The Lycan ABS itself. At least you can see that one in action.


RE: Drawing contents - Gardesion - 03-16-2014

Thank you DerVVulfman! I knew it was something simple, JayRay's script showed me exactly how to implement it myself.

EDIT: I fixed my second question before anyone could reply. Thanks!


RE: Drawing contents - JayRay - 03-17-2014

woohoo!!! I'm relevant again!!! lol