Bug in HLPM
Author | Topic: Bug in HLPM |
---|---|
Off With Their Heads
Member # 4045
|
written Wednesday, August 11 2004 10:34
Profile
Homepage
Sigh. It appears that when the shop setup function is called twice, the shops get all screwed up. This means that if you go into the Shopping Area at any point, leave, change levels significantly, and then go back into the Shopping Area, the shops will have more items in them than they should. Thank you to Morgan for reporting this. There doesn't seem to be a particularly good way to fix this with the calls that we have now. Since there is no short to check the number of items in a shop, and since there is no way to reduce the number of items in a shop, the only way to fix the shops would be to go back to the earliest form of the shop setup function, one from a pre-release version that increments as each level plateau is reached, which I would have to re-make from scratch, as I threw it out some time back. It also looks horrible: the items in the shops rearrange themselves every time new items are added, which throws the organization of the shops to hell. It would be possible to fix this by resetting the shops at the beginning of the function if the add_item_to_shop call actually worked as advertised ("Note that, in all cases, you will want to put a number above 0 for how_many. If you don't, the item will disappear from the store," specifically -- meaning that add_item_to_shop(1,200,0) would make item 200 disappear from shop 1), but the call doesn't actually do this. The call doesn't make items disappear if they are already there; it just doesn't add any more. Thus, there's not much I can do. This adds a certain urgency in my mind to the requests we made over in the BoA Editor Suggestions thread, specifically the improved functionality for the shops. I'm e-mailing Jeff to let him know about this, but I'm not sure what he's going to do or how soon it's going to happen. At any rate, I will continue to release occasional updates to the HLPM, and if we actually get those new calls -- a way to reduce the number of items in shops would be really nice, or a way to zero the shops as the docs claim -- then I will fix this. But with the calls we have right now, there just isn't a good way to go about changing this, at least that I can think of. For the time being, don't go into the Shopping Area, change levels, and then go back into the Shopping Area again. If you must, leave the scenario and come back into it in order to do this. EDIT: For the record, this is the e-mail that I sent to Jeff: Hey Jeff and co., I noticed that one call doesn't quite work the way that the docs say. About add_item_to_shop, the docs say: "Note that, in all cases, you will want to put a number above 0 for how_many. If you don't, the item will disappear from the store." That seems to indicate that add_item_to_shop(1,200,0) will make item 200 disappear from shop 1, for example. However, it doesn't do this. It just doesn't add the item to the shop. But if the item was already there, then the call won't do anything, rather than making the item disappear. I bring this up because I have a bug in the HLPM right now (documented here: http://www.ironycentral.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=18&t=000445 ) that I can't seem to fix with the calls that are currently available. (It could in theory be fixed, but it would require a workaround so lengthy that I might run over the script size limit, which I'm already pushing, and it would make the shops ugly as all heck, too.) If add_item_to_shop worked the way that the docs say, I could fix this easily -- or better, if you added some of the calls that we requested in this thread: http://www.ironycentral.com/cgi-bin/ubb/ubb/ultimatebb.php?ubb=get_topic;f=18;t=000423 Either way, making the call work as advertised or adding additional calls that make all of this easier, would be great. Just thought I'd let you know. Looking forward to future updates! -- Kelandon EDIT 2: Thanks, Khoth! (He moved the thread when I stupidly put it in the Editor board.) [ Wednesday, August 11, 2004 16:01: Message edited by: Kelandon ] -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
...b10010b...
Member # 869
|
written Wednesday, August 11 2004 15:53
Profile
Homepage
Can't you just set an SDF once you've finished setting up the shops for the first time and check it when starting to set up the shops to make sure they don't get set up twice? EDIT: Ah, never mind, I see the problem now. I suppose you could do this anyway and warn the player that if they choose to have the shops set up now, they won't be set up again if the party changes level. [ Wednesday, August 11, 2004 15:55: Message edited by: Thuryl ] -------------------- The Empire Always Loses: This Time For Sure! Posts: 9973 | Registered: Saturday, March 30 2002 08:00 |
Off With Their Heads
Member # 4045
|
written Wednesday, August 11 2004 15:56
Profile
Homepage
Er, yes, but this would kind of defeat the point. The point is to be able to use the Level Raiser repeatedly or gain levels in the Arena or whatever in between uses. The whole point of v1.1 over v1.0 was that each part operated independently and could be used repeatedly. EDIT: He got it even without me telling him. :P I guess I could do that (ask the player when to set up the shops). It is the least ugly workaround I've heard so far. I'll have to see what Jeff says about future updates, though (that is, whether they will happen or not). It isn't a tremendously pressing problem, I think, so it can wait for a few months if it comes to that. [ Wednesday, August 11, 2004 15:59: Message edited by: Kelandon ] -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
BANNED
Member # 4
|
written Wednesday, August 11 2004 16:42
Profile
Homepage
A workaround might be thus- have the party's level be set up as a variable/SDF, and have spell levels, item quantities, etc. determined by something like this: flagset = ((level / 10) + 1); // Levels for Bolt of Fire set_flag(1,1,flagset); // Set the BoF flag to the appropriate value flagset = ((level / 7) + 1); // Levels for Light set_flag(2,1,flagset); // Set the Light flag to the appropriate value And then the add_item_to_shop nodes can either use a variable defined before each one is called, like so: currentshop = get_flag(1,1); flagset = ((level / 10) + 1); setshop = (flagset - currentshop); add_item_to_shop(0,2000,setshop); So that the values can be updated every time a party levels. It would take some serious re-writing, but it would work. -------------------- * Posts: 6936 | Registered: Tuesday, September 18 2001 07:00 |
Off With Their Heads
Member # 4045
|
written Wednesday, August 11 2004 16:56
Profile
Homepage
In order to implement this, I would have to create several towns whose scripts would only serve the purpose of existing as part of the shop setup function, because I'm already pretty close to the script size limit. Moreover, since BoA can only call the current town's script, I would have to do something relatively crazy like send the party through several towns in order to set up the shops before letting them into the Shopping Area. This would be, well, ugly -- but it would accomplish the intended effect. I'll have to wait for Jeff's response. Since add_item_to_shop does not work the way that the docs say it does, I have some hope that Jeff will actually fix this -- because it wouldn't require adding new calls, just making the call do what the docs say it does. I'm going to wait for an e-mail back from him. If he says that he's definitely going to do an update, and that it's definitely going to include something to make this simpler, then I'll just wait. If I can't get anything definitive from him, then I'll see what I can do. -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |