Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[CR][WIP] Foundation for implementing medieval mod shields #14711
Conversation
This comment has been minimized.
This comment has been minimized.
|
Success on the first commit? Glorious. Additionally pondering other uses for the implemented flag, via any other items that might warrant it. |
chaosvolt
changed the title
Foundation for implementing medieval mod shields
[CR][WIP] Foundation for implementing medieval mod shields
Jan 4, 2016
Malkeus
reviewed
Jan 4, 2016
| "encumbrance" : 0, | ||
| "bashing" : 8, | ||
| "symbol" : "[", | ||
| "flags" : ["OVERSIZE", "STURDY", "BELTED"], |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Ack. I could've sworn I added the flag to those. @_@ |
This comment has been minimized.
This comment has been minimized.
|
I have no idea where you get the idea that off-hand support is "low-priority and low-utility". It is harder to do, but it is the correct way to handle shields and off-hand weapons (and off-hand tools). See http://smf.cataclysmdda.com/index.php?topic=10444.msg247535#msg247535 |
This comment has been minimized.
This comment has been minimized.
|
Hmm. Part of was that it hasn't been discussed much in a while. Given the complexity it would add, it likely won't be taken up by anyone competent enough to try it for quite some time. EDIT: That reminds me. This PR would at least have the added use of adding the relevant flag to briefcases and other items. |
This comment has been minimized.
This comment has been minimized.
|
If we are ever to consider the hacky shields, they have to do at least those two things:
The former is simple - just check one-handedness on equip and disallow one-handed characters from wearing shields (if they want to use shields as weapons, they can wield them as weapons). The latter wouldn't be hard, but it's not totally straightforward.
|
This comment has been minimized.
This comment has been minimized.
|
Hmm. The latter was something I had planned, yes. Might need to look for the equip code to see how to implement the former. |
This comment has been minimized.
This comment has been minimized.
|
And the latest entry in the "What was I thinking?" chronicles, started to add a check in the wear functions for "are we wearing a briefcase/shield OR do we lack hands" before remembering that I already added "are we wearing a briefcase/shield" to the function for defining whether the player has only one arm free. |
This comment has been minimized.
This comment has been minimized.
|
Welcome to the department of redundancy department, you are welcome in this place! |
This comment has been minimized.
This comment has been minimized.
|
Then again, if I could think up a way to say "You don't have a hand free to wear this." in two differently distinct ways, I could split that check so the message returned is more clear as to why the player can't wear it. Though then I'd need to further refine the has_two_arms check or split "wearing a briefcase/shield" in a separate check. |
added some commits
Jan 5, 2016
This comment has been minimized.
This comment has been minimized.
|
First I copied from the check that had a count (which, as you said, wasn't initialized that far up), then I wound up placing the intended replacement in the wrong place, by overwriting the part in the "you can't wear more than 2 X" by mistake. >.< |
This comment has been minimized.
This comment has been minimized.
|
No worries man, this shit is confusing. At least you're trying ;) |
This comment has been minimized.
This comment has been minimized.
|
...and then something still failed. Whee. EDIT: Extraneous ) due to yet more lazy copy-paste. |
This comment has been minimized.
This comment has been minimized.
|
Parentheses, brackets, braces and commas can all go to hell... |
This comment has been minimized.
This comment has been minimized.
|
That would be it, yeah. This is what happens when you start off basing a check of something that doesn't make use of the |
This comment has been minimized.
This comment has been minimized.
|
I'm using codeblocks (bc free) and I couldn't get by at all without it's ability to tell me where something is declared and/or implemented. What are you using? |
This comment has been minimized.
This comment has been minimized.
|
I seriously need to install MSYS2 to do compile testing. Usually it's more Notepad++ along with trial and error. And even then I only recently went from doing source code edits with plain Notepad or Wordpad. >.< |
This comment has been minimized.
This comment has been minimized.
|
Oh man, I can't recommend something like codeblocks enough then. You can easily search the entire source code for things, hovering over a function name will tell you where it came from, and you can right click and find declaration/implementation and it takes you there. It took a little effort but I got it to compile for me too. What OS are you using, maybe I can assist you with getting compiling working. At the least I can send you what I used to make it happen. |
This comment has been minimized.
This comment has been minimized.
|
Ah. Never tried using Codeblocks for editing, I'd only thought to use it for compiling. Er, trying to at least. >.> And hopefully it'll work alright, just kept forgetting to try it when I had the chance. Mostly because the few times I go poking around in the source code, I don't find out whether it's faster and more efficient to compile-test until after I've thrown up half a dozen failed commits. ._. |
This comment has been minimized.
This comment has been minimized.
|
If I compile in curses it only takes about 10 minutes. Curses is good enough for most testing. |
This comment has been minimized.
This comment has been minimized.
|
Hmm. Never tried that. And predictably I yet again hit glorious inconsistencies to compiling.md's guide to using MSYS2. It starts with it saying one of the updates the guide says to grab is outdated and thus skipped, then pretty much unravels from there. >.> |
This comment has been minimized.
This comment has been minimized.
|
I sent you a link on the forums. It has mingw64 as the compiler. That guide is a clusterfuck. After you get the libraries installed, I had to change the Project -> Build Options -> linker settings tab to include the right libraries. Also make sure it's using the compiler you want, it defaults to some kind of default craziness. |
This comment has been minimized.
This comment has been minimized.
|
Just...augh. I suck at actually handling the source, I suck at compile-testing, and so far all I've done is commit fuckups and get griped at for going the lazy route and using Jently to test this shit. I'm starting to think I should just stop bothering with source-editing PRs entirely, if it's just going to be another string of stupid mistakes. |
This comment has been minimized.
This comment has been minimized.
There's nothing wrong with making a mistake so long as you learn from it. |
This comment has been minimized.
This comment has been minimized.
|
Trying to. And failing, it seems. ._. |
This comment has been minimized.
This comment has been minimized.
|
Setting up a compiler helps a lot with learning because with a compiler you can just throw bad code, correct it a bit and repeat until it stops being so bad that it doesn't compile. I checked the tutorial and I think the dead link you were talking about is now replaced by a proper one. At least all the links I checked were actually working. |
This comment has been minimized.
This comment has been minimized.
|
Hmm. I should try it again, yes. Not sure which one to go with, since so far it's been three different compilers tried and just as many failures. Still...sorry. Just got kinda set off by that. I know it's been nothing but fuckups on my end, and you don't really have time to constantly correct my mistakes. But when the first response to a question about what I'm doing wrong is to berate me for not being able to compile-test it, and call it "lack of respect" as if I'm intentionally trying to make things as much hassle as possible, is just...disheartening. |
This comment has been minimized.
This comment has been minimized.
It wasn't the first response. Only then I added a note about you not compiling things.
Not intentionally, but it looks like you're trying to skip a part of the development because it's annoying to set up, hoping that there is a way around it. This causes problems for everyone. Including you, because you can't compile it fast AND because even if someone tested it, it would most likely end up having bugs you'd have to fix before merging. If you have problems with installing the compiler, ask. I bet you could even get someone on IRC to explain the entire tutorial step by step. I'm not going to close the PR or anything like that, but criticism is a part of the review. |
This comment has been minimized.
This comment has been minimized.
|
Sorry. Trying at the moment to follow the instructions for compiling (again), will likely get on the IRC once I'm done with the initial first steps. And so far, I've found no evidence that compile-testing will actually be easier and faster than the way I've been doing it for, what, nearly a year by now (correction, about 10 months)? Even now I'm seeing a big potential issue in compiling: the need to add the required addons to the actual source directory. My options are either to copy the entire source folder (which takes about as long as you'd expect 1.45 GB to) so that Github won't be trying to commit the added stuff to the pull request, or I'd have to move the needed files into it, then remember to move them elsewhere before commiting. |
This comment has been minimized.
This comment has been minimized.
|
And then there's the other issue. Given all the jokes I crack about the source code melting when I so much as look at it, it should be apparent that I inevitably tend to make some sort of mistake, and wind up at a complete loss for what I'm even doing wrong. If it's committed to the pull request, at least then others can look at it and find the predictable amateur fuckup that I completely failed to notice. If I'm instead compile-testing it and not committing it, others can't actually look at my work, meaning I have to go and ask for help, then provide code excerpts of what all I'm doing when I eventually hit a problem and have no idea what I'm doing. And even then, there's the possibility that when I post what I'm doing, I might miss important information in other files that might be the cause of the problem. And if I'm at the point where I don't know WHERE the problem is, it's rather obviously harder to provide those code excerpts, specifically excerpts that would actually reveal what part I fucked up. |
This comment has been minimized.
This comment has been minimized.
|
Committing unfinished PRs is fine (as long as you keep the [WiP] in title).
If you compile without tiles, sound and localization, you don't need those. The second windows tutorial is more complicated, but it doesn't meddle with source directory. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
http://stackoverflow.com/questions/29450016/o1-2-3-with-std-c1y-11-98-if-cmath-is-included-im-getting-error-hypo |
This comment has been minimized.
This comment has been minimized.
The one linked to by COMPILING.md. >_> |
This comment has been minimized.
This comment has been minimized.
|
Try the tutorial under "Rough guide to building with only MSYS2". |
This comment has been minimized.
This comment has been minimized.
|
Well, time to repeat the mistakes I made when I tried that last time, I guess. EDIT:
I'm assuming that's supposed to be "bash pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime" instead? EDIT 2: Apparently Github format ate the "bash" and new line in that quote. |
This comment has been minimized.
This comment has been minimized.
|
I'm a rebel and I always get the newest version of everything, it very very seldom is the wrong thing to do. AngbandTK is an old ass game and I shouldn't have been surprised it wouldn't work with the brand new versions of it's requirements... |
This comment has been minimized.
This comment has been minimized.
|
Hmm. Straight-up copying all 3 lines into the command does jack shit. |
This comment has been minimized.
This comment has been minimized.
|
My ancient talisman protects me from your druidic chants! |
This comment has been minimized.
This comment has been minimized.
|
Druidic chants? Something something tekeli-li. :V Well, I'll see about compiling later on, if I get any farther in the attempt, For now I'm still at that part where I'm stumped and would need someone more competent to figure out what I fucked up. >.< |
This comment has been minimized.
This comment has been minimized.
|
I can just upload somewhere my entire codeblocks folder with my working settings. Not sure if it'd wrote something in the registry, but you can try to download and use it nevertheless. |
This comment has been minimized.
This comment has been minimized.
|
That might help, unsure if it writes registry or appdata files, but is worth a try. ^^" |
This comment has been minimized.
This comment has been minimized.
|
@chaosvolt https://drive.google.com/file/d/0BwEAK44XlpItYXhTbGtKQ0s0eTQ/view?usp=sharing |
This comment has been minimized.
This comment has been minimized.
|
Ah, will look at it once I'm able to get back on the laptop, as will be out soon. Thank you. |
This comment has been minimized.
This comment has been minimized.
|
Well shit. Now merge conflicts. Greeeat. |
Coolthulhu
reviewed
Jan 22, 2016
| return block_bonus; | ||
| } | ||
|
|
||
| std::string player::best_shield() const |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jan 22, 2016
Contributor
This function doesn't return a string. String is text. A reference to an item isn't a string of text, it's item &.
item &player::best_shield()
This comment has been minimized.
This comment has been minimized.
|
Ack. Is that all this needed to work? Scheisse. Well...I'm actually already working on splitting this PR up. >.< |
This comment has been minimized.
This comment has been minimized.
|
Closing this now that the important parts have been split into separate PRs. |

chaosvolt commentedJan 4, 2016
This is one of those ideas I'd had on the backburner for a while. Basically, there are two main things preventing the inclusion of shields:
The main suggestion that has come up as a way to support these features has been the idea of an off-hand to hold a shield or secondary weapon in. However, this would be a big change, and has been an oft-suggested idea generally dismissed as not worth the effort.
The main reason is that while it could be used for some refactoring of picking items up and holding them, the other main uses would be:
Additionally, one thing lost when changing shields in the way originally proposed is a loss of passive protection from ranged attacks, which is a major element of historical shield usage. The ability to actively block with them PARTIALLY exists via arm blocks, but one part of this PR will eventually address that.
Onto the actual content of the PR. Barring a pressing need to go through the effort of adding offhand support (which is regarded as low-priority and low-utility), adapting the existing method to work in a more plausible manner might be better for the moment.
The other half of the required code is in #14741 it seems. Thanks to Coolthulhu for that, as my attempt at it did not go well. x_x