Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Bob423

Horizontal Selection in a Menu (and other stuff)

Question

So i've been working on the menu system for my game, and i've come across a little problem. when in the target or menustatus windows (selecting a character) i need to press up and down to select, when i want it to be left and right. how do i change it, only for those windows?

 

also, i want to replace the character sprite in window_menustatus with a face. how would i do that?

Share this post


Link to post
Share on other sites

24 answers to this question

Recommended Posts

  • 0

Don't call super in the update method, and make your own implementation. I assume it used Window_Selectable, so when you call super in the update method, its going to use the default up/down method used in it.

Share this post


Link to post
Share on other sites
  • 0

I am not going to write it for you. If you can't look in Window_Selectable, look at the update method, copy the code, and make one slight edit, how do expect to create a whole menu system? If you seriously want to script a menu system, you are going to have to understand the base classes used for windows, its kind of a requirement...

 

Check out some beginner tutorials for RGSS, especially pertaining to Windows, and perhaps some Ruby ones on inheritance.

They would do a far better job than I am in a single post explaining it. I am sure there are some good ones on the forum here.

Share this post


Link to post
Share on other sites
  • 0

window_selectable didnt have it. i found what i needed in window_shopcommand

thanks anyway.

 

now for that face thing. i just want a simple way to replace the character sprite with a face.

 

edit: im just making edits to the RTP classes, so all help i need should be simple. just like 1 to 2 lines of code to do one simple thing

 

e.g. adding

"

@item_max = 3

@column_max = 3

"

to def initialize

 

was exactly what i needed for the horizontal menu thing

Edited by Bob423

Share this post


Link to post
Share on other sites
  • 0

hm...cool, i'll take a look at it, thanks

 

edit: i get a 403 when trying to download it

Edited by Bob423

Share this post


Link to post
Share on other sites
  • 0

The link on the blog should work now, I fix it last night but the fking site deleted my post and I was tired so I didn't repost it. tell me if it works.

Share this post


Link to post
Share on other sites
  • 0

Okay last time, check again, hopfully it works from your end because I logged out and it still worked so it should work.

Share this post


Link to post
Share on other sites
  • 0

YAY it worked biggrin.png now to test this out

 

edit: ok it works, but i have one problem. because your script has HP, MP, and EXP bars, i deleted the script i already had for bars to prevent compatibility issues. but i the bars dont show up in the menu. is there a command i can use to make them? fixed it by reinstalling the other script which still works

 

I also cant change the size of the faces, i get a syntax error if i have it in there, and when i move the comma to outside the brackets, i get this error.

"Script 'Bigace - Warrior Engine' line 1073: NoMethodError occurred

undefined method `>' for [96]:Array"

just read the stuff about it on your site >.<

 

also, your faces require the file to be named by the actor's current name. in a game where the player can chose their name, that's a problem. puting @ before actor fixed it. not sure how

 

 

but now there's a new problem. it says "argument error occurred. wrong number of arguments (4 for 3)" when i try to change the size of the face

Edited by Bob423

Share this post


Link to post
Share on other sites
  • 0

YAY it worked biggrin.png now to test this out

 

edit: ok it works, but i have one problem. because your script has HP, MP, and EXP bars, i deleted the script i already had for bars to prevent compatibility issues. but i the bars dont show up in the menu. is there a command i can use to make them? fixed it by reinstalling the other script which still works

Wait, so whats going on here, there bars didn't show up in your menu because I put it in a new game and they show up fine. Sorry the instructions were suppose to say to put it above all custom scripts as I don't know the compatibility of other coders scripts.

 

I also cant change the size of the faces, i get a syntax error if i have it in there, and when i move the comma to outside the brackets, i get this error.

"Script 'Bigace - Warrior Engine' line 1073: NoMethodError occurred

undefined method `>' for [96]:Array"

just read the stuff about it on your site >.<

 

The comments at the top of the script aren't just there for show, they actually explain somethings.

 

also, your faces require the file to be named by the actor's current name. in a game where the player can chose their name, that's a problem. puting @ before actor fixed it. not sure how

true I'll change that in the future. I was thinking of my game when I wrote that, an not the others. Can you elaborate on that last part, I have no clue what that has to do with anything.

 

but now there's a new problem. it says "argument error occurred. wrong number of arguments (4 for 3)" when i try to change the size of the face

 

can you post how you wrote the method, it would help a bit as I can't tell what it is right now.

Share this post


Link to post
Share on other sites
  • 0

draw_actor_face(actor, 5, 5) is your way of making faces.

for some reason, (@actor, 5, 5) took the way of making faces from something else (or at least it seemed like it) and i needed to use the character graphics name with _face at the end for the file name,and put it in the characters folder

 

typing draw_actor_face(actor, 5, 5, size = 96) gave me the error (the fives are place holders because i don't know what i set x and y to.)

Share this post


Link to post
Share on other sites
  • 0

draw_actor_face(actor, 5, 5) is your way of making faces.

for some reason, (@actor, 5, 5) took the way of making faces from something else (or at least it seemed like it) and i needed to use the character graphics name with _face at the end for the file name,and put it in the characters folder

 

typing draw_actor_face(actor, 5, 5, size = 96) gave me the error (the fives are place holders because i don't know what i set x and y to.)

 

You sure you dont have any other scripts that uses faces because heres my code right here and it doesn't ask you to put in the character folder or add a _face at the end:

def draw_actor_face(actor, x, y, size = 96)
 bitmap = RPG::Cache.picture(actor.name)
 return if bitmap.nil?
 cw, ch = bitmap.width, bitmap.height
 if size > 0
  dst_cw = dst_ch = size
 else
  dst_cw, dst_ch = bitmap.width, bitmap.height
 end
 dst_rect = Rect.new(x, y, dst_cw, dst_ch)
 src_rect = Rect.new(0, 0, cw, ch)
 self.contents.stretch_blt(dst_rect, bitmap, src_rect)
end

This is straight from the engine and as you can see it asks you to place it in the picture folder.

 

I'm also using this in every new project I've made so far and I haven't got any of these issues. List all the scripts in order you're also using in your game and give the url where you got them as well.

Share this post


Link to post
Share on other sites
  • 0

hm...i must be.

dont remember where i found all of them, but i don't know what scripts i have that use faces. maybe blizz-abs? other than that i can't see anything. someone must've edited one of the RTP scripts for me, because most of the non-RTP scripts are below the ones i added the face too...O.o

Share this post


Link to post
Share on other sites
  • 0

Even if you don't have the url I still need the list of scripts in order or I can't help as I don't know where the error is coming from. Also for those you don't have the url just put the authors name.

Edited by bigace

Share this post


Link to post
Share on other sites
  • 0

i had a list prepared, and was ready to post it, but then i did a search for "face" in my scripts, and i found out that there's a feature in Blizzard's tons of add-ons that lets you add faces. don't know why i didn't notice it before huh.png

well thanks for your help anyway biggrin.png

Share this post


Link to post
Share on other sites
  • 0

What of the face image, because Blizzards script is overriding mine. His script doesn't allow your image to change sizes.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...