Garrulous Glaahk Handyman Posted July 8, 2011 Posted July 8, 2011 ...what the subject line says: I've been mucking around with this nonsense, and nothing seems to work. If I have a torch right on the other side of a door, and I open up that door, somehow the light does not flood into the darkness, and that is just crazy. I can have a light in the middle of a room, and if I set_terrain all around it with total blackness, the room is still lit. Is there any way around this? Quote
Well-Actually War Trall Niemand Posted July 8, 2011 Posted July 8, 2011 The game precalculates light levels, and does not; I think, update them when terrains and floors are changed. Unless I'm forgetting something simple (which is always a possibility at this time of night), working around this requires dark magic. (If you choose to pursue this path, you may also want this formula; you can see how it's used in more sophisticated invocations like this one.) Quote
Garrulous Glaahk Handyman Posted July 8, 2011 Author Posted July 8, 2011 Ignoring your pun, sir... By god, that's fantastic. I should learn to code someday. Are there any other devious tricks a novice might want to know about? Quote
Garrulous Glaahk Handyman Posted July 8, 2011 Author Posted July 8, 2011 This is obviously nitpicking after having gotten the exact solution I wanted, but, it seems like light levels 4-6 all look the same. Also, it looks like the Mac code can set the light of individual spaces, while the Windows code can only set the light of whole rows. Is there a way around that? Quote
Well-Actually War Trall Niemand Posted July 8, 2011 Posted July 8, 2011 I didn't look all that closely at this back when it was figured out, so I don't recall what the different light levels look like. It may also be the case that the values which can be set (0-6) don't correspond well to range of values the game normally uses. You'll probably just need to experiment and find the settings that come out the closest to what you wanted. The difference between the two code examples isn't as big as it might appear; the loop in Lazarus' code is just an optimized form that executes a bit faster. The constant -8192 in the Mac code and -24688 in the Windows code serve the same purposes, (And hey, that wasn't exactly a pun; that's my standard phrase for mentioning this technique. Which happened to have an amusing double meaning in this case. ) EDIT: I just noticed that there is one other difference between the two examples: The Mac code is written for a 64 by 64 (large) town, while the Windows code seems to be intended for a 48 by 48 (medium) town, although I'm not sure it will actually work as it is. 64 by 64 is the underlying size for all towns, even if not all of it is used. Quote
Garrulous Glaahk Handyman Posted July 8, 2011 Author Posted July 8, 2011 Oh, I get it: The "Windows" version effects 48^2 slots. To effect a whole town, should I change it to 64^2 slots? And if so, where should the range for that begin? Quote
Garrulous Glaahk Handyman Posted July 8, 2011 Author Posted July 8, 2011 (Using the 48x48 version, all values for z seem to change the town into a mid-level lighting: Total darkness/brightness seem impossible. :-/ ) Quote
Unflappable Drayk Lazarus. Posted July 8, 2011 Posted July 8, 2011 Well it definitely works for a medium town, if you just change the range of the loop it should work for a large town as well. Also I don't think I've ever seen the auto detection or item weight check code, pretty cool. If you ever want to combine your platform detection and mac light with my windows light, and post it as a universal light change, then be my guest. Edit: As to getting light changes to show up. I think you need to start with a town that's completely dark (like you need torches) and then go up from there. Edit2: No wait maybe I lied. I only have one working example of this and it's from Threnody, I looked at it again and apparently I had a fully lit underground town, and used z values of 2 (dark) and 5 (lit.) I remember being pleased with the results, so the difference should be noticeable. Remember you're not going to be able to get a town as bright as surface day, because you have to use underground towns. It's been a long time since I've played with this stuff so that's the best I can tell you. Quote
Garrulous Glaahk Handyman Posted July 8, 2011 Author Posted July 8, 2011 I understand the bits in your two edits. I guess what I was asking was if you know where the range for the loop should begin... I tried subtracting 1792 (ie 48^2 - 64^2) from the minimum and adding it to the maximum, but neither worked. Though, I'm using Mac, so someone else may want to try this. Also, since you two seem to know these things: Is there any way to clear the automap? I found one for Mac here: http://blades.ermarian.net/script/code-snippet/clear-automap-mac But, it really would be nice to find one for Windows. Quote
Unflappable Drayk Lazarus. Posted July 8, 2011 Posted July 8, 2011 Change the loop to: while(y <= -20592) And we don't know the windows equivalent of the clear automap hack unfortunately. Niemand, is that forum on SV about this stuff still up? It was hidden before so I don't think anyone can see it at the archive, since we can't log in anymore. Quote
Well-Actually War Trall Niemand Posted July 8, 2011 Posted July 8, 2011 Originally Posted By: Lazarus Niemand, is that forum on SV about this stuff still up? It was hidden before so I don't think anyone can see it at the archive, since we can't log in anymore. It is not. I saved the material, but it isn't in a conveniently usable form. I'm still trying to decide what exactly to do with it. Quote
Garrulous Glaahk Handyman Posted July 8, 2011 Author Posted July 8, 2011 Well, Lazarus, your change causes the Mac version of BoA to flunk and badly, but you probably know that... if this goes to beta-testing, I'll have to have a PC user. And, I don't really know what I could do to help with this PC automap clear; but it'd be really, really cool. Quote
Well-Actually War Trall Niemand Posted July 9, 2011 Posted July 9, 2011 Originally Posted By: Handyman Well, Lazarus, your change causes the Mac version of BoA to flunk and badly, but you probably know that... if this goes to beta-testing, I'll have to have a PC user. In case it wasn't already clear, what you're running into is the fact that the different versions of the game need different constants to achieve the same results. The reason that I linked to the 'platform-autodetection' snippet is that it can tell you when the game is running which version it is, which then lets you run the right version of the code for it. Quote: And, I don't really know what I could do to help with this PC automap clear; but it'd be really, really cool. I'll see if I can take another stab at this tomorrow. While there are fancier tricks available (which we cannot talk about here), the simplest approach is to just try varying the numbers in the code, running it, and seeing what happens, if you're interested in trying it yourself. Quote
Garrulous Glaahk Handyman Posted July 9, 2011 Author Posted July 9, 2011 ...well, I mean, it's my scenario, so I should be. I don't have a PC copy of BoA, but I have a PC. Quote
Easygoing Eyebeast keira Posted July 11, 2011 Posted July 11, 2011 Originally Posted By: Handyman I don't have a PC copy of BoA, but I have a PC. If you beam Jeff your info that you used to get your Mac copy, and say you need a Windows key, he'll give you a key. Quote
Understated Ur-Drakon Celtic Minstrel Posted July 15, 2011 Posted July 15, 2011 Or if you got a CD, just install it. (Though, it sounds like you don't, but just in case.) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.