Help me make my new variant! (please!)

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Nick
    replied
    Originally posted by will_asher
    The curse struct declared in object.h doesn't even have a place for to_h/to_d/to_a. Where does the code apply these things to an object?
    The trick is that struct curse has a field
    Code:
    struct object *obj;
    which holds all that information. This is then applied in calc_bonuses(), in the loop starting with
    Code:
    	/* Analyze equipment */
    	for (i = 0; i < p->body.count; i++) {
    		int index = 0;
    		struct object *obj = slot_object(p, i);
    		struct curse_data *curse = obj ? obj->curses : NULL;
    
    		while (obj) {
    with combat bonuses being applied here:
    Code:
    			/* Apply combat bonuses */
    			state->ac += obj->ac;
    			if (!known_only || obj->known->to_a)
    				state->to_a += obj->to_a;
    			if (!slot_type_is(p, i, EQUIP_WEAPON)
    					&& !slot_type_is(p, i, EQUIP_BOW)) {
    				if (!known_only || obj->known->to_h) {
    					state->to_h += obj->to_h;
    				}
    				if (!known_only || obj->known->to_d) {
    					state->to_d += obj->to_d;
    				}
    			}
    The original object is handled first, then any curse objects, with the iteration through them being handled here:
    Code:
    			/* Move to any unprocessed curse object */
    			if (curse) {
    				index++;
    				obj = NULL;
    				while (index < z_info->curse_max) {
    					if (curse[index].power) {
    						obj = curses[index].obj;
    						break;
    					} else {
    						index++;
    					}
    				}
    			} else {
    				obj = NULL;
    			}
    So in addition to your change in obj-init.c, you need to handle weight in that combat bonuses section.

    Heaviness curse is a nice idea, BTW, I will probably steal it back from you

    Leave a comment:


  • will_asher
    replied
    trying to add a heaviness curse, but I can't find where it actually applies the curse effect to an object.
    I have this in object-init.c
    Code:
    static enum parser_error parse_curse_combat(struct parser *p) {
    	struct curse *curse = parser_priv(p);
    	assert(curse);
    
    	curse->obj->to_h = parser_getint(p, "to-h");
    	curse->obj->to_d = parser_getint(p, "to-d");
    	curse->obj->to_a = parser_getint(p, "to-a");
    	curse->obj->weight = parser_getint(p, "weight");
    
    	return PARSE_ERROR_NONE;
    }
    but curse->obj->to_a, to_h and to_d don't seem to be used anywhere else in the code.
    I looked through obj-curse.c, but it never seems to look at the curse->obj->to_h(etc). The curse struct declared in object.h doesn't even have a place for to_h/to_d/to_a. Where does the code apply these things to an object?

    Leave a comment:


  • will_asher
    replied
    cool, thanks

    Leave a comment:


  • backwardsEric
    replied
    Originally posted by will_asher
    I'm looking at calc_bonuses() and I'm a little confused about which stat array holds the actual stat number shown on the status line. Is it state->stat_use[] or state->stat_ind[] ?
    And under "/* Calculate the various stat values */",
    why does "ind = (use - 3);"? (Why is 3 subtracted from it?)
    It's stat_use (code in ui-display.c displays the panel next to the map with the stats; code in ui-player.c displays the character sheet). stat_ind has a converted range: rather than the 3 - 18/220 range (encoded as 3 - 18 for 3 to 18 and 18 plus the excess for an over 18 stat) it uses a range of 0 (thus the subtraction of 3) to 37 for easier lookup into tables for things that depend on a stat (weight allowance, adjustment to device skill, ...).

    Leave a comment:


  • will_asher
    replied
    I'm looking at calc_bonuses() and I'm a little confused about which stat array holds the actual stat number shown on the status line. Is it state->stat_use[] or state->stat_ind[] ?
    And under "/* Calculate the various stat values */",
    why does "ind = (use - 3);"? (Why is 3 subtracted from it?)

    Leave a comment:


  • will_asher
    replied
    Originally posted by backwardsEric
    There was the problem you reported with flasks of oil multiplying, I believe that was addressed in https://github.com/angband/angband/pull/4671 . It's taken several sets of changes to get the handling of thrown weapons in the quiver to its current state. In order from first to last they were (the key files are obj-gear.c and player-calcs.c (for calc_inventory()):
    1. https://github.com/angband/angband/c...0afb42d95943f2
    2. https://github.com/angband/angband/pull/4613
    3. https://github.com/angband/angband/c...d95d01d83141e2
    4. https://github.com/angband/angband/c...d95d01d83141e2
    5. https://github.com/angband/angband/c...d95d01d83141e2
    6. https://github.com/angband/angband/pull/4671
    7. https://github.com/angband/angband/c...d95d01d83141e2
    8. https://github.com/angband/angband/pull/4769
    Thanks that'll help

    Leave a comment:


  • backwardsEric
    replied
    Originally posted by will_asher
    So I'm playtesting Rubberband and I'm getting that bug where 1 arrow turns into about 400 when I pick one up (it seems to automatically fill the quiver). I remember this bug (or a similar one at least) happening in V. Could you point me to where it was fixed in V? (assuming it was fixed in V.)
    There was the problem you reported with flasks of oil multiplying, I believe that was addressed in https://github.com/angband/angband/pull/4671 . It's taken several sets of changes to get the handling of thrown weapons in the quiver to its current state. In order from first to last they were (the key files are obj-gear.c and player-calcs.c (for calc_inventory()):
    1. https://github.com/angband/angband/c...0afb42d95943f2
    2. https://github.com/angband/angband/pull/4613
    3. https://github.com/angband/angband/c...d95d01d83141e2
    4. https://github.com/angband/angband/c...d95d01d83141e2
    5. https://github.com/angband/angband/c...d95d01d83141e2
    6. https://github.com/angband/angband/pull/4671
    7. https://github.com/angband/angband/c...d95d01d83141e2
    8. https://github.com/angband/angband/pull/4769

    Leave a comment:


  • will_asher
    replied
    So I'm playtesting Rubberband and I'm getting that bug where 1 arrow turns into about 400 when I pick one up (it seems to automatically fill the quiver). I remember this bug (or a similar one at least) happening in V. Could you point me to where it was fixed in V? (assuming it was fixed in V.)

    Leave a comment:


  • will_asher
    replied
    Originally posted by backwardsEric
    It's a completely new function added to support the SELECT effect (EF_SELECT). ui-effect.c and ui-effect.h were added in this pull request, https://github.com/angband/angband/pull/4829 .
    Okay, so I just added the ui-effect.c and ui-effect.h files to my code, and finally got it to compile and run again.
    thanks

    I hope there aren't many more bugs from the merge that the compiler didn't catch with errors.

    Leave a comment:


  • backwardsEric
    replied
    Originally posted by will_asher
    I'm down to a few linker errors.
    I'm getting "unresolved external symbol _textui_get_effect_from_list" in ui.input.c. I did a search and "textui_get_effect_from_list" does not appear anywhere else in my code. I tried to search the RubberBand code on git and it says "forked repositories are not currently searchable" which really sucks.
    So I searched for it in the V code, turns out "textui_get_effect_from_list" is from ui-effect.c. I don't even have a file called ui-effect.c in RubbberBand. It must be from newer V. How do I resolve this? What file was "textui_get_effect_from_list" in before it was moved to ui-effect.c?
    It's a completely new function added to support the SELECT effect (EF_SELECT). ui-effect.c and ui-effect.h were added in this pull request, https://github.com/angband/angband/pull/4829 .

    Leave a comment:


  • will_asher
    replied
    Still trying to recover my code after merging with (some but not all) recent V changes created a whole bunch of error messages and bugs. I'm never doing it that way again. If I want to get changes from V, I will look at a diff and do it manually.

    I'm down to a few linker errors.
    I'm getting "unresolved external symbol _textui_get_effect_from_list" in ui.input.c. I did a search and "textui_get_effect_from_list" does not appear anywhere else in my code. I tried to search the RubberBand code on git and it says "forked repositories are not currently searchable" which really sucks.
    So I searched for it in the V code, turns out "textui_get_effect_from_list" is from ui-effect.c. I don't even have a file called ui-effect.c in RubbberBand. It must be from newer V. How do I resolve this? What file was "textui_get_effect_from_list" in before it was moved to ui-effect.c?

    EDIT: I could just add the ui-effect.c and ui-effect.h files to my code, but I have a feeling that'll just make more errors since I apparently have part of the change, but not the whole thing.
    Last edited by will_asher; July 27, 2021, 01:51.

    Leave a comment:


  • fph
    replied
    I think every git user has gone through a few moments when they did not understand what was going on, and they had to back up their local work, delete everything and re-clone. So no shame in that. There's even an xkcd about that. https://xkcd.com/1597/ .

    Leave a comment:


  • will_asher
    replied
    Originally posted by Nick
    I don't use Github desktop, but here are a few thoughts:[*]From the state of your repo on Github, it looks like you have worked on two branches, master and Rubberband-master; I'm guessing the first is just an earlier version of the second.[*]I suspect the "Pulling without specifying how to reconcile divergent branches is discouraged" message is because you have a mismatch between the branch on Github that you are pulling from, and the local branch it is trying to merge into.
    I tried to rename the main folder on github so github destop wouldn't give me an error saying there was a duplicate folder name. Instead it apparently made a new branch with the new name. ugh.
    Originally posted by Nick
    [*]I usually don't use git pull; I use git fetch, and then git merge. This should end up with the same result, but I feel like I have more control that way. In particular, in your situation, you should be able to do a git fetch (which will get all the branches from Github), and then, while on the branch you want to merge into, do a git merge <branch you want to merge in>.
    That sounds promising. I'll try that. Probably later though, because the frustration so far has made me not want to bother with it anymore tonight.
    Originally posted by Nick
    [*]It is easy to make branches. Before doing anything experimental, make a new branch and try it out there to see if it works.
    This sounds like it would be confusing and hard to keep track of everything. It'd bad enough with three copies of my code (the 'origin' on github, the main one I do my coding on in Visual Studio, and the one used by github desktop) that I want to keep synced. It seems safest to me to keep all the changes in one place (or as few places as possible at least). If something doesn't work, I can always undo the last commit or something.

    Leave a comment:


  • Nick
    replied
    I don't use Github desktop, but here are a few thoughts:
    • From the state of your repo on Github, it looks like you have worked on two branches, master and Rubberband-master; I'm guessing the first is just an earlier version of the second.
    • I suspect the "Pulling without specifying how to reconcile divergent branches is discouraged" message is because you have a mismatch between the branch on Github that you are pulling from, and the local branch it is trying to merge into.
    • I usually don't use git pull; I use git fetch, and then git merge. This should end up with the same result, but I feel like I have more control that way. In particular, in your situation, you should be able to do a git fetch (which will get all the branches from Github), and then, while on the branch you want to merge into, do a git merge <branch you want to merge in>.
    • It is easy to make branches. Before doing anything experimental, make a new branch and try it out there to see if it works.

    Leave a comment:


  • will_asher
    replied
    Can I bump my previous post? Nobody on the github forum is helping, and it seems like any progress on my RubberBand variant is completely halted until I can get a solution for this.

    When I try to sync with Visual Studio using the origin "https://github.com/will2asher/RubberBand", it gives me this:
    "Opening repositories:
    C:\Users\Dajustiss\Documents\My Games\RubberBand\Angband\angband
    Warning: Pulling without specifying how to reconcile divergent branches is
    discouraged. You can squelch this message by running one of the following
    commands sometime before your next pull:
    git config pull.rebase false # merge (the default strategy)
    git config pull.rebase true # rebase
    git config pull.ff only # fast-forward only
    You can replace “git config” with “git config --global” to set a default
    preference for all repositories. You can also pass --rebase, --no-rebase,
    or --ff-only on the command line to override the configured default per
    invocation.
    Everything up-to-date"
    ...But everything isn't up to date. Why is it saying "Pulling without specifying how to reconcile divergent branches is discouraged"? I shouldn't have divergent branches. I already chose which changes to keep or not keep on Github desktop and pushed it all back to github.

    EDIT: Maybe I'll just have to re-clone the source from git.
    I'm not even sure if re-cloning will work, since it seems to have created a separate branch for all these changes which is not what I wanted it to do.

    Leave a comment:

Working...
😀
😂
🥰
😘
🤢
😎
😞
😡
👍
👎