Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Super Simple Journal

Drey

Member

YES! :biggrin: *grins* theenx ^.^

by the way, I've been raking my brains and the internets, and even with google I can't find this, for some reason... what's the simple script line that makes the menu wait for a few frames? [Like "waitTime(10)" or something?]

The game just keeps hitting "C" trigger when the mouse button is held down, so I just want to add a 5-10 frame pause when i change scenes ^.-

Do you remember the script line(s)? thanks a million, bro :thumb:
 
You could surround the Input statement for the mouse with something like...

if Graphics.frame_count % 5 == 0

then it would only process every 5 frames.
Although I haven't tried it, so I'm not sure if it would have any weird lag or missed click problems.
You might have to tweak the delay to get the best results.

Be Well
 

Drey

Member

:rock: awwww yeah! :toot:
Works perfectly buddy, again, can't thank ya enough :P

Is it alright if I dare ask another bit of help in a few days, on where the mouse selects? [For all the other selectable menus] I'll only ask if I can't work it from the journal's solution's structure, I'm gonna give it a solid try for the next few days, I'd just like to be able to turn to you if I can't get it in the end? :angel:

In any case, take it easy my friend :3
Thanks a pantload xD
 

Drey

Member

Actually scratch that bud, if you would, I have a request much more applicable to your skills?

Could you create a way similar to the @data list, for in-journal images to be accessed from the /Pictures folder? I think it would make your script even more incredibly cool :P

(I thought making a similar list might be the simplest, so that they can be referenced easily within the journal, and re-used if needed)

Also, I can't quite seem to put my finger on a simple way to display an image during a specific menu. Do you know the short-hand version of it?

thx for all the help man :thumb:
 
The entire contents of a menu IS a bitmap. All you need is a method of copying the contents of one bitmap to another.
Fortunately, the bitmap class has a method called blt (block transfer).

You can use RPG::Cache to store the individual images as you open them

Then you just need someplace to store the names of the images.e.g. @imagedata

Or, you could just name the images: quest_1.png, quest_2.png, etc...
then in the script you want to display the image, Window_Journal or Window_Journal_Detail,
use the index property to determine the filename to use with the Cache command, then use the blt method to
transfer that image to your menu.

I'm tied up all week in the studio (writing, recording music), so if you haven't figured it out by next week, I may be able to help.
 

Drey

Member

Got it!! :biggrin:

For the record (to anyone else?) a super-easy code snippet,

$item = "Item.png"
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture($item)

Boo-yah ^_^ Add @sprite.dispose to any menus where you don't want the image, and voila! (There seems to be no way to situate them, so I just have 640x480 pics with a lot of clear space xD)

Thanks buddy! Let me know when you're back from work, I've got a last code-nugget with the mouse selection I'd love to set your brain to, if you're up for it ^.-

Have fun recording! :wink:
 
dont use $item there is no reason for it to be global, at lease use @item if not simply item
edit or even: @sprite.bitmap = RPG::Cache.picture("Item.png")
 

Drey

Member

lol, thanks penguin :wink:
I was just wittling it from a large piece of code I'd come accross, I'm always happy to reduce even more :D

RPG::Cache.picture("Item.png") it is ^.^

[BTW, any ideas on how to actually make an image show up within a description? I'm all out... and Brew is my hero too LOL! nice sig]
 
you can use the draw text method for bitmaps.

bitmap.draw_text(x, y, width, height, "your string data", alignment)
x is starting x coordinate on the bitmap, same for y. width and height of the text, then the text you want, alignment is 0,1,2 for left right and center.
 

Drey

Member

sorry? I probably misunderstood, cause I came out with:

bitmap.draw_text(50, 25, 48, 48, "@sprite", 1)
or
bitmap.draw_text(50, 25, 48, 48, "Item.png", 1)

neither of which did much except cause an error, I'm sure I didn't do it right though. I was already familiar with the x-y, h-w and alignment, but which string data would I put that would represent an image?

(Also, how does this help for individual journal entries, the @data[#] lines? so lost) :blank:

lol, help please :3
 

Drey

Member

same error, actually...
says 'bitmap' is an undefined method.

but how does this line help with an @data description? I can't just have that line sitting in the middle of the text?
 
this is after you set @sprite.bitmap = RPG::Cache.picture("Item.png") ?

if you have your description saved in @data all you have to do is change "Description or what ever" with @data, if you get error try @data.to_s
 
I think he want an 'inline' image. i.e. an icon in the middle of a text line.

Ideally, we would re-write the draw_text method to convert something like, "\i[23]" (to draw the icon for item 23)

I suppose we could write a wrapper that would parse the escape code, ascertain the width of the image, and both strings (before & after the image), and then use:
draw_text
blt
draw_text

or pad the text with enough space to insert the image. e.g.
from
draw_text(50, 25, 48, 48, "Use the key \i[23] to open the lock", 1)
to
draw_text(50, 25, 48, 48, "Use the key to open the lock", 1)
then calculate the position for the image & draw it using the blt method.

* by "we", I mean, "not me." Unless you're not in a hurry. :scruff:
 

Drey

Member

nah, nothing seems to actually work depending on which entry is open... tried

@data
@data.to_s
@data[40]
@data.to_s[40]
"@data"
"@data.to_s"
"@data[40]"
"@data.to_s[40]"

But adding the specific number always creates an error/crash, and leaving it out (or putting them in quotes) always leaves the image on screen, in all entries.

Any thoughts?

journalentries.jpg
 

Drey

Member

no dice, image still shows up in all descriptions :eek::

Oh wtf? heh, hadn't noticed your post at 1:12 pm... my post about all the things i'd tried had been because i didn't know what Plague meant, LOL.

But hey, I've got time... and I'm not in THAT much of a hurry. However I'm giving it my best trying to put together something, and I'll keep trying.

But really, I just mean an image that could be located within the separate description, not at all an "inline" image, I don't think there'd be enough need for that kind of option.

I just want the simple option to have, for example, a 640x480 PNG image with mostly clear insides, depending on which description is open. That would be the simplest, it's what I'm trying for ^.-
 

Drey

Member

Hey Brew? Could I convince ya to make a lil simple formula? (if you're done recording for the week) :wink:

I half-gave up on writing it myself and have just been working on other bits, I don't know enough about Ruby's syntax and "grammar", can we simply have a list just like @data[1] - @data[50], under it, for one image to go along with any of the quests?

I think individual 640x480 png's are the best bet, after all, this still is the "Super Simple Journal" even if you made it insanely better :tongue:

Anyways thanks bud, take it easy
 

Drey

Member

Might I have I overstayed my welcome? heheh, if you don't feel like it, it's totally cool, thanks for all the help buddy :wink:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top