Help, would you kindly?

I am attempting to create a new purchasable item for the shop, however, I am having some very interesting difficulties. When I run the mod, in the shop interface, instead of the new item appearing, all of the 'ring' type items (my item is a ring) appear as black squares with the phrase [DISPLAY NAME MISSING] next to them. Hovering the mouse cursor over them returns the tool-tip [no text]. The prices, however, are still displaying as normal, my item included.

 

The rest of the game is unaffected - I managed to play through two entire games without problem. The AI seems to simply ignore the blacked-out items - no problem there. However, trying to click on one of the blacked-out items will chrash the game, and the demigod.log file shows the error "'ring_item_050' not found" or "'ring_item_010 not found" ect. depending on what you click.

 

This, along with many hours of grueling trial-and-error has led me to the conclusion that the issue is either:

1) A typing error in one of the vital functions so simple, stupid and basic that I'm just completely overlooking it (I really don't think this is the case - but it can never be totally ruled out);

B ) Some sort of issue with the hooking process that is overwriting the original Ring_Items.lua file rather than just merging with it;

or - as I am rapidly beginning to suspect is the case - #) Some sort of absolute restriction on the number and type of abilities that can be placed on a single item (you will see what I mean when you open the mod file).

 

If the problem were 1, I likely would have found it by now - but there's only so long I can look at a piece of text without mentally filtering most of it out, and a fresh set of eyes would probably see it in a heartbeat. Obviously, if the problem is B or #, fixing it would require a greater level of technical skill than I have, so...

Here's the mod: http://www.mediafire.com/?jzmd0gnei5h

I'm not a pro at making mods, but I have made more than a few, and I can usually fix any issues I come across very quickly. I don't mind telling you that I've exhausted every tool and trick in my repertoire - twice - so anything you can come up with would be immensely beneficial.

1,683 views 7 replies
Reply #2 Top

Thanks, but I've already read that... This isn't exactly a 'standard' issue, as far as I know.

I'm not sure I mentioned (in fact, I think I forgot to) but I used several other 'new item' type mods that I know work as reference while I made this, so as near as I can determine, the technical aspects (file pathing, general file layout, ect.) are all correct.

Reply #3 Top

From the description of the problem, I can tell you it's gonna be a parse error somewhere in your Ring_Items.lua.  To find out where, you'll have to turn logging on - I'd recommend creating a debug shortcut for the game that adds these commandline parameters:

/skipintro  (obvious)

/size x y  (runs in windowed mode, where x and y are the resolution of the window - use something smaller than your desktop, like 1024 768)

/showlog  (displays the log window, which is updated in realtime)

/log 'filename'  (dumps all log messages to a text file with the file path and name provided - I think the default directory with no path is the main demigod directory, but it could also be bindata or something like that)

 

The log will tell you the exact line number that the parse error(s) occurred on, however, that's the ENTIRE length of the joined file, which includes all hooked copies in mods.  This means you have to subtract the number of lines in the original Ring_Items.lua from the line number in the error message to get the actual line number of the error in YOUR file.  This assumes you aren't running any other mods that modify this file, which you should not be when debugging a mod.  If you are, you need to know their load order (are they before or after yours?) and subtract their total number of lines as well if they're loaded before yours.

Looking at that file, I would expect a -lot- of errors, since I'm seeing what look like a ton of extra brackets.  You'll probably have to remove/comment huge parts of the file at once to find them all.  Make sure you're tabbing/indenting properly, and make sure you're closing all of your table brackets properly.  You're missing at least one closing bracket, as the ItemBlueprint { table doesn't close in my editor unless I add one more closing bracket to the end.  That might be the least of your problems, though.

In general, I would hesitate to create a file/item that large without testing more basic implementations of it first.  First have your item appearing in the shop with no bonuses, THEN start on actually populating it with abilities and buffs, and do so in chunks so you know where you've made a mistake.  Otherwise you end up with a 400-line file that's supposed to be one contiguous table with dozens and dozens of nested subtables, but you have absolutely no assurance of such.

 

Another quick note - most of your attempts at merging things look good, but your ugbshop06_shoplayout.lua doesn't need to (and shouldn't) re-define Layout = {}.  All you need is the line on the bottom that accesses [7][2] in Layout.

Reply #4 Top

What can I say? When you're right, you are right. 'Least of your problems' was the understatement of the year

I spent two hours looking for an unclosed bracket - what the log said was the issue - only to find that the real problem was that I spelled 'function' with a capital 'F'... other than that it's been easy - long and tedious, coding it three lines at a time - but relatively trouble-free.

I'm about half-way recoding it - this time without the bugs - but I've run into some unrelated trouble with a bug making the game crash, so I'll have to reinstall before I can finish testing, so it'll probably be Monday before I'm done.

On the flip side, I've learned more about Demigod coding in the past three days than I did in the three months previous - alls well that ends well, I guess.

Either way, thank you for your help - I'm quite certain I never would have figured it out without your input.

 

As a side note, I was thinking while I worked (imagine that!) and I got struck by an idea that might make this item balanced - and in a fun way too.

When I was looking over the 'aura' code, I noticed that both the time between pulses and the duration of each pulse are defined - and I thought I could make all the effects (or most at least) of the ring into an aura, reduce them to more modest levels (read: about 1/500th of the current amount) and then set the pulse duration to 25 or 30, and the pulse time to 5 or 6.

The theoretical effect of this would be that all the bonuses - say, a hundred or so to health and mana, a hundred or two to armor, 5 or 6% to move/attack speed, and so on - would not only effect all your allies nearby, but would increase over time. Say, an ally enters the field - they would receive 150 bonus to health, then a few seconds later, another 150 (for a total bonus of three hundred) then a few seconds later, another 150 (for a total of 450) up to a max bonus of 600 or 750.

My only worry is that the item might be a little OP on an individual basis - because the person wearing the item would get a permanent bonus to all those stats - and I was thinking about making the bonuses larger for other people, maybe by adding a non-aura bonus of negative stats - so you get the ring, and lose 450 points of health, then when the aura stacks up over time to 750, you end with a net result increase of 300 points - or something like that.

What do you think?

Reply #5 Top

I'm not sure how to get an aura pulse buff to stack like that.  You would at least have to make sure it's set to Stack = 'ALWAYS', but there may be some other change required to get it to do that.  As for using negative bonuses, that should work, but there's a chance that it'll kill the player that puts it on if he has less than that amount of health.

Reply #6 Top

Turns out the aura buffs will stack, just as a matter of course: all you have to do is alter the duration function, like I thought. Only now, I find myself with a new issue. Whe the buff runs out, your helath and mana (and presumably all the other stats as well, though I didn't notice it) drop slightly before the next pulse kicks in. I'm working on some variations in the timing to see if I can get it to overlap seemlessly, but we'll see.

As a side note:

.... .... .... .... .... before now, I never realized what happens when a damage reduction bonus (like Bulwark) gets boosted above 100%.... .... .... your attacks do negative damage.... imagine an LE and a TB, standing in the center of Crucible, at level 20, surrounded on either side by horde upon horde reinforcements.... .... .... .... and taking NO DAMAGE WHATSOEVER.

 

That situation was a result of typo on my part, (.5 instead of .05) but still extremely amusing.

Reply #7 Top

Only now, I find myself with a new issue. Whe the buff runs out, your helath and mana (and presumably all the other stats as well, though I didn't notice it) drop slightly before the next pulse kicks in. I'm working on some variations in the timing to see if I can get it to overlap seemlessly, but we'll see.

 

Easy to fix. Make a buff (quiet) that is a permanent buff that affects you when you equip the item, then make a second buff (replicate with the buff that you want that doesnt effect you:

 

ie buffname.1 = quiet buff

buffname.2 = aura

in the ability code for buffname.2  (psuedocode -- at work)

OnAbilityEffect (function)

if unit:HasBuff buffname.1 then

continue

end

 

Something along those lines should allow you to have a permenant buff and allow you to not buff yourself (or others) with this item

 

Exx