set/get hero picture doesn't work with portraits

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Mogri
Super Slime
Posts: 4669
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

set/get hero picture doesn't work with portraits

Post by Mogri »

set hero picture(0, 1, spritetype:portrait) sets the hero's walkabout set to 1, and get hero picture(0, spritetype:portrait) returns the hero's walkabout set, at least as of Beelzebufo. Has this been fixed in the nightlies?
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Re: set/get hero picture doesn't work with portraits

Post by Bob the Hamster »

Mogri wrote:set hero picture(0, 1, spritetype:portrait) sets the hero's walkabout set to 1, and get hero picture(0, spritetype:portrait) returns the hero's walkabout set, at least as of Beelzebufo. Has this been fixed in the nightlies?
The ability to set portraits with "set hero picture" was not added until July 2014, well after the beelzebufo release.

The spritetype:portrait constant should not have even existed in the beelzebufo plotscr.hsd, which makes me suspect that you might be using a newer nightly plotscr.hsd with your beelzebufo custom
User avatar
Mogri
Super Slime
Posts: 4669
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Oh, that does seem likely, actually.
User avatar
Mogri
Super Slime
Posts: 4669
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Well, I downloaded the nightly, and that made it worse until I noticed that I should be using hero portrait instead of spritetype:portrait. The change in behavior is a little odd. Before, I could set hero portrait(0, X, spritetype:portrait) and get X back from get hero portrait(0, spritetype:portrait). The command now returns 0 regardless of X.

This isn't a complaint per se; keeping the old behavior would have made things really confusing when I tried changing the portrait to something else later.

Unrelated bug: automatic-width menus are sized as if all menu items were visible. Rendering a large-width menu item invisible makes the menu unexpectedly large.

Another unrelated bug: text boxes that chain into shops that only have the Buy option don't disappear while the shop is onscreen. This is really ugly if the text box happens to occupy the lower half of the screen.
Last edited by Mogri on Sun Feb 22, 2015 6:14 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Before, I could set hero portrait(0, X, spritetype:portrait) and get X back from get hero portrait(0, spritetype:portrait). The command now returns 0 regardless of X.

This isn't a complaint per se; keeping the old behavior would have made things really confusing when I tried changing the portrait to something else later.
You meant "get hero picture(0, hero portrait)", right? What on Earth do you mean by "the old behaviour"? I wrote testcases for the hero picture/palette commands, and they seem to be fine. Maybe you passed a hero id instead of a party slot?

I actually would prefer that the textbox always disappears when you enter a shop, regardless of whether it has an outer buy/sell/whatever menu... well, maybe it should be optional, I guess some people might want the shop to look like a textbox choice menu.
Last edited by TMC on Sun Feb 22, 2015 10:17 am, edited 1 time in total.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Oh, yeah, the spritetype: constants are for sprite slices! Not compatible with set hero picture at all!
User avatar
Mogri
Super Slime
Posts: 4669
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Re: set/get hero picture doesn't work with portraits

Post by Mogri »

This is what I mean by the old behavior:
Mogri wrote:set hero picture(0, 1, spritetype:portrait) sets the hero's walkabout set to 1, and get hero picture(0, spritetype:portrait) returns the hero's walkabout set, at least as of Beelzebufo. Has this been fixed in the nightlies?
The invalid "spritetype:portrait" was treated as if it were 0 (outside battle). Not a behavior that you should need to reproduce.

I can work around the shop/textbox problem by chaining to a script that calls the shop instead. I can't work around the menu width problem as easily. Any chance that could get a quick fix?
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Well getheropicture is intended to return the current value, not the default. If you want the default, use resetheropicture. And passing an invalid picture type to getheropicture actually causes it to return 0. We definitely need to improve script error reporting. The current script error level setting just doesn't work: we can't really add additional script errors because they'll start appearing all over the place in existing games, especially since we encouraged people to turn on script errors. Need to switch to "develop with errors shown, release with them hidden".
I'm really looking forward to adding "typed integers" when we get a new script interpreter. Then "inside battle" and "spritetype:hero" will both have a value of 0, but different types, so an error can be shown if you use the wrong one, but we can still hide the error and continue.

It turns out that the menu width thing was actually intentional:
position_menu wrote: IF .disabled AND .hide_if_disabled THEN CONTINUE FOR 'hidden matter for auto-width but not auto-height
I can see what the intention was, though don't think it's such a good idea, as the min menu width is a better way to avoid changes in the width. Since it's a pretty minor cosmetic thing, it should be OK to change. Done.
Last edited by TMC on Mon Feb 23, 2015 1:47 am, edited 1 time in total.
User avatar
Mogri
Super Slime
Posts: 4669
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Thanks! I appreciate the fast turnaround.
TMC wrote:The current script error level setting just doesn't work: we can't really add additional script errors because they'll start appearing all over the place in existing games, especially since we encouraged people to turn on script errors. Need to switch to "develop with errors shown, release with them hidden".
You could add a "warning" reporting level and make it only appear in g_debug.txt, maybe.
Post Reply