RINE'S PROFILE
Rine
1378
Game designer hopeful. Have designed several tabletop RPGs, and have long wanted to start into the video game space.
My focus when designing is to create challenging experiences that force the player to make difficult choices, and change the paradigm when someone thinks of an RPG.
My focus when designing is to create challenging experiences that force the player to make difficult choices, and change the paradigm when someone thinks of an RPG.
Search
Filter
[RMVX ACE] draw_text creating odd overlapping text.
Indeed, and I already tried to include line breaks, \n and \\n, neither did anything to the text. I could be using the wrong sort of line breaks, but I don't know which to use.
[RMVX ACE] draw_text creating odd overlapping text.
Because apparently I like putting my stupid mistakes up on the forums!
So, everything is working grand, we're reading from the array, we're changing what is displayed based on the array! Except, for, well...

It looks like the text is wrapping over and over itself. The other strings display fine, but they are only examples and as such very short.
Here is where I declared what is in the string. Note, I've already tried applying line breaks to it, no joy.
And here is the function to draw the description in the window.
I'm guessing its either an issue with how the text is stored, or with draw_text and its parameters, but no joy so far in finding any similar thread. Sorry for troubling people with my issues again!
So, everything is working grand, we're reading from the array, we're changing what is displayed based on the array! Except, for, well...

It looks like the text is wrapping over and over itself. The other strings display fine, but they are only examples and as such very short.
Here is where I declared what is in the string. Note, I've already tried applying line breaks to it, no joy.
$mission[0] = Mission.new(1, 10, 10, 10, 8, 0, "Alley", "We are receiving a distress call from an Alley in Paris. Our scans indicate a Wyrd signature, along with several readings of undead in the area. Recover the individual and report back to base.")
And here is the function to draw the description in the window.
class Window_MissionDesc < Window_Base def initialize(list_window, x, y, width, height) super(x, y, width, height) @list_window = list_window @list = @list_window.item @width = width @height = height draw_desc(x, y, @list) refresh end def draw_desc(x, y, list) draw_text(0, 0, width, height, list.desc) end def update super refresh end def refresh contents.clear @list = @list_window.item draw_desc(0, 0, @list) end end
I'm guessing its either an issue with how the text is stored, or with draw_text and its parameters, but no joy so far in finding any similar thread. Sorry for troubling people with my issues again!
[RMVX ACE] Printing a string from an array in a Menu
So...pretty sure I'm just calling things wrong here, but I don't know if its VXACE's menu things that are causing me problems, or a misunderstanding in how to assign values to an array.
Basically, I have an initialized array, then another array that is a list of objects in that array. I'm working on a scenemenu that will call values from that array and display them. Everything is working in that it is creating the array right, calling it fine, and can display certain integer values from it. Problem is for some reason it won't display a string that is a value of the class.
Here is the initial class we create in the array:
Which we then put into the array mission_list, and thats the list we call from the scene. I'll save the trouble of posting all that, but suffice to say mission copies the seventh value as its name.
And a def to return it.
In my scene, we copy the mission_list into item_list, and then try to print the names.
However, it is printing 0 in the menu, instead of the expected "Alley". As a note, if I change the value it calls to a non-string value, it returns the number properly, so I'm guessing I'm calling how to return a string incorrectly? Just not sure what the correct call would be.
Edit: head.location = desk.
So you know whats really important when testing things? Making sure you're calling the correct array location, and making sure you don't call...you know, one higher than you're expecting.
Problem solved, hopefully no one was looking at the code too hard :P
Basically, I have an initialized array, then another array that is a list of objects in that array. I'm working on a scenemenu that will call values from that array and display them. Everything is working in that it is creating the array right, calling it fine, and can display certain integer values from it. Problem is for some reason it won't display a string that is a value of the class.
Here is the initial class we create in the array:
$mission[0] = Mission.new(1, 10, 10, 10, 8, 0, "Alley", "We are receiving a distress call from an Alley in Paris. Our scans indicate a Wyrd signature, along with several readings of undead in the area. Recover the individual and report back to base.")
Which we then put into the array mission_list, and thats the list we call from the scene. I'll save the trouble of posting all that, but suffice to say mission copies the seventh value as its name.
def initialize(map, threat, startx, starty, dir, location, name, desc) #snipped unnecessary bits @name = name end
def name @name end
In my scene, we copy the mission_list into item_list, and then try to print the names.
def make_item_list @data = $mission_list.clone end def draw_item(index) item = @data[index] if item rect = item_rect_for_text(index) draw_text(rect, item.name) end end
However, it is printing 0 in the menu, instead of the expected "Alley". As a note, if I change the value it calls to a non-string value, it returns the number properly, so I'm guessing I'm calling how to return a string incorrectly? Just not sure what the correct call would be.
Edit: head.location = desk.
So you know whats really important when testing things? Making sure you're calling the correct array location, and making sure you don't call...you know, one higher than you're expecting.
Problem solved, hopefully no one was looking at the code too hard :P
Amount of Magic in Fantasy
Bioware kinda pulls what Warhammer does. Magic is dangerous, deadly, powerful, and can summon demons to tear apart the nature of reality.
Shadowrun also does it well system wise, in that every cast doesn't cost you MP, but tires you out (through stun damage), or if you're pushing yourself way too hard, can hurt you. So, the more powerful the magic, the more it wears you out/hurts you, but you can choose how much magic to put into each spell.
Shadowrun also does it well system wise, in that every cast doesn't cost you MP, but tires you out (through stun damage), or if you're pushing yourself way too hard, can hurt you. So, the more powerful the magic, the more it wears you out/hurts you, but you can choose how much magic to put into each spell.
Amount of Magic in Fantasy
My problem, in general, with magic in fantasy is that it takes inordinately less work to do something with magic, in most settings. While most standard settings (especially those based of D&D ages ago, like final fantasy) will state that mages must practice their whole lives to learn their skills, we still see young mages flinging around spells with the effect of modern weapons with ease, while their companions swing a sword.
These worlds also tend to ignore the societal implications of the same spells. You will have spells that can revive someone from near death, mend hundreds of stab wounds, and yet can be restored with a simple potion, or resting a day. Admittedly, a lot of this is simple ease of use, but if you've ever played a game with a smart-ass mage in D&D who tries to unbalance the economic system of a town with create food/water or tries to do massive damage by summoning a whale above an enemy...well, you realize how silly some of these things are.
Thematically, the best magic systems I've seen tend to put a huge onus on the mage, physically and mentally. The Fate/Stay Night universe tends to posit that magic is limited to those with innate talent only, and requires just as much exertion as doing the act physically would. So doing something that requires inhuman amounts of energy can possible kill you.
Game wise, magic systems should be balanced with non-magic. Linear warriors/quadratic wizards is way too common, but at the same time having dozens of spells you no longer use because you're using the next incremented version is just as bad. Spells should grow in power with their user, just like skills should.
These worlds also tend to ignore the societal implications of the same spells. You will have spells that can revive someone from near death, mend hundreds of stab wounds, and yet can be restored with a simple potion, or resting a day. Admittedly, a lot of this is simple ease of use, but if you've ever played a game with a smart-ass mage in D&D who tries to unbalance the economic system of a town with create food/water or tries to do massive damage by summoning a whale above an enemy...well, you realize how silly some of these things are.
Thematically, the best magic systems I've seen tend to put a huge onus on the mage, physically and mentally. The Fate/Stay Night universe tends to posit that magic is limited to those with innate talent only, and requires just as much exertion as doing the act physically would. So doing something that requires inhuman amounts of energy can possible kill you.
Game wise, magic systems should be balanced with non-magic. Linear warriors/quadratic wizards is way too common, but at the same time having dozens of spells you no longer use because you're using the next incremented version is just as bad. Spells should grow in power with their user, just like skills should.
Whatchu Workin' On? Tell us!
Alternating between working on the main 'mission control' section of my as yet untitled game, and tightening up content. Today I got my R&D section working and ready to insert upgrades, and thanks to some help from the forums here, I have my mission-porter script working.
[RMVX ACE] Calling a specific actor's portrait in a menu.
Took me a while to realize what you meant by draw_face override, didn't even realize I was overriding the original function!
So, that works a bit better, but I think we have a fundamental misunderstanding here. I really just want it to draw one face, when that particular character is highlighted in the menu. I must be really far off from that :(
Edit2: Well, victory on some part, we are now drawing the first actor's portrait. However, something is still clearly borked, because I'm not refreshing the image, ie its still staying him no matter whose selected. Still looking it over, but posting the whole thing again in its new form.
Edit3: Solved, somehow missed an update function to include in it. Works perfectly now, thanks to Marrend again!
So, that works a bit better, but I think we have a fundamental misunderstanding here. I really just want it to draw one face, when that particular character is highlighted in the menu. I must be really far off from that :(
Edit2: Well, victory on some part, we are now drawing the first actor's portrait. However, something is still clearly borked, because I'm not refreshing the image, ie its still staying him no matter whose selected. Still looking it over, but posting the whole thing again in its new form.
class Scene_ActorAssign < Scene_MenuBase def start super @list_window = Window_CharacterList.new(0, 0, 200) @list_window.set_handler(:cancel, method(:return_scene)) @face_window = Window_CharacterFace.new(@list_window, 200, 0, Graphics.width - 200, Graphics.width - 300) @face_window.viewport = @viewport end end #Window for the actor picture. class Window_CharacterFace < Window_Base def initialize(face_window, x, y, width, height) super(x, y, width, height) @face_window = face_window refresh end def get_face Cache.face(@face.face_name) end def setup_face_graphic draw_actor_face(@face, 0, 0) end def face_rect(bmp, rect) dest_rect = bmp.rect.dup fits = dest_rect.width <= rect.width && dest_rect.height <= rect.height if !fits dest_rect.width = rect.width if dest_rect.width > rect.width dest_rect.height = rect.height if dest_rect.height > rect.height end dest_rect.x = ((rect.width - dest_rect.width) / 2) dest_rect.y = ((rect.height - dest_rect.height) / 2) return dest_rect, fits end def refresh contents.clear @face = @face_window.item setup_face_graphic end def item @data && index >= 0 ? @data[index] : nil end end # List of actors class Window_CharacterList < Window_Selectable def initialize(x, y, width) super(x, y, width, Graphics.height - y) data = [] self.index = 0 activate refresh end def item @data && index >= 0 ? @data[index] : nil end def item_max @data ? @data.size : 1 end def make_item_list @data = $data_actors.compact end def draw_item(index) item = @data[index] if item rect = item_rect_for_text(index) draw_text(rect, item.name) end end def refresh make_item_list create_contents draw_all_items end end
Edit3: Solved, somehow missed an update function to include in it. Works perfectly now, thanks to Marrend again!
[RMVX ACE] Calling a specific actor's portrait in a menu.
Yeah, I figured the problem lies in me pulling the script straight across, since the tutorial was for how to draw a monster image, and they're stored differently than actors.
I've come across that call before, but I'm stumped as to where to stick it as well :P
I've come across that call before, but I'm stumped as to where to stick it as well :P
[RMVX ACE] Calling a specific actor's portrait in a menu.
Hey all,
So I'm working on designing a menu to assign actors to different parties. It's my first menu that I've ever designed, so I'm sure its going to be a lot of trial and error. My current issue is probably an issue with converting a script that is in a tutorial here (the slip in to ruby series), where I've started to convert it from showing monster images to actor portraits.
The main issue is that the code shows what seems to be the first set of portraits for actors, and then doesn't change. Clearly, It's not reading a specific actor's portrait, but for the life of me I can't find any code that shows a simple example of a menu call for an actor's portrait.
Here is my code:
And here is what shows up when you open the menu:

So I'm working on designing a menu to assign actors to different parties. It's my first menu that I've ever designed, so I'm sure its going to be a lot of trial and error. My current issue is probably an issue with converting a script that is in a tutorial here (the slip in to ruby series), where I've started to convert it from showing monster images to actor portraits.
The main issue is that the code shows what seems to be the first set of portraits for actors, and then doesn't change. Clearly, It's not reading a specific actor's portrait, but for the life of me I can't find any code that shows a simple example of a menu call for an actor's portrait.
Here is my code:
class Scene_ActorAssign < Scene_MenuBase def start super @list_window = Window_CharacterList.new(0, 0, 200) @list_window.set_handler(:cancel, method(:return_scene)) @face_window = Window_CharacterFace.new(@list_window, 200, 0, Graphics.width - 200, Graphics.width - 300) @face_window.viewport = @viewport end end class Window_CharacterFace < Window_Base def initialize(face_window, x, y, width, height) super(x, y, width, height) @face_window = face_window refresh end def get_face Cache.face(@face.face_name) end def draw_face(actor, x, y) bmp = setup_face_graphic(x, y) src_rect = Rect.new(0, 0, bmp.rect.width, bmp.rect.height) contents.blt(x, y, bmp, src_rect, 150) bmp.dispose end def setup_face_graphic(x, y) bmp = get_face rect = Rect.new(x, y, contents_width, contents_height) dest_rect, fits = face_rect(bmp, rect) dummy_bmp = Bitmap.new(contents_width, contents_height) if fits dummy_bmp.blt(dest_rect.x, dest_rect.y, bmp, bmp.rect) else src_rect = Rect.new((bmp.rect.width - dest_rect.width) / 2, (bmp.rect.height - dest_rect.height) / 2, dest_rect.width, dest_rect.height) dummy_bmp.blt(dest_rect.x, dest_rect.y, bmp, src_rect) end dummy_bmp end def face_rect(bmp, rect) dest_rect = bmp.rect.dup fits = dest_rect.width <= rect.width && dest_rect.height <= rect.height if !fits dest_rect.width = rect.width if dest_rect.width > rect.width dest_rect.height = rect.height if dest_rect.height > rect.height end dest_rect.x = ((rect.width - dest_rect.width) / 2) dest_rect.y = ((rect.height - dest_rect.height) / 2) return dest_rect, fits end def refresh contents.clear @face = @face_window.item draw_face(@face, 1, 1) end def item @data && index >= 0 ? @data[index] : nil end end class Window_CharacterList < Window_Selectable def initialize(x, y, width) super(x, y, width, Graphics.height - y) data = [] self.index = 0 activate refresh end def item @data && index >= 0 ? @data[index] : nil end def item_max @data ? @data.size : 1 end def make_item_list @data = $data_actors.compact end def draw_item(index) item = @data[index] if item rect = item_rect_for_text(index) draw_text(rect, item.name) end end def refresh make_item_list create_contents draw_all_items end end
And here is what shows up when you open the menu:

[RMVX ACE] Calling a custom scripted class through an event.
Yup, that worked, the only difference I made was instead of having goto be called to change certain variables, I made it change 4 static variables. I'm only ever going to call .goto before I actually teleport them, and it'll be changed each time they go on a different mission, so I won't have to save those variables.
Thanks so much for your help!
Thanks so much for your help!













