Page 1 of 1

Trying to make small aesthetic change, having trouble, help?

Posted: Fri May 20, 2016 3:05 pm
by Frumple
So I'm trying make a small addon that changes the time hound ASCII display to a light blue Z. Being absolute pants at coding and having notable trouble parsing the various instructions I've noticed on the forum (and more or less copying the format of the shadowflame tree tweak addon), I've ended up with this, so far, in superload/data/talents/chronomancy/temporal-hounds.lua:

Code: Select all

local _M = loadPrevious(...)

summonTemporalHound = function(self, t)  
	local m = require("mod.class.NPC").new{
		display = "Z", color=colors.LIGHT_BLUE, image = ("npc/temp_hound_0%d.png"):format(rng.range(1, 12)),
	}
	end
	
return _M
The bright side is that it's stopped spitting out errors every time I try to load the addon (the first try just had the display line in there and nothing else, and it took several more to try the _M thing) and it actually recognizes the addon at all (which took a bit). The not so bright side is that temporal hounds are still showing up as light_black Cs. It... it feels like it should not be this difficult to change one letter and one word and get results, so I have the notable suspicion I'm either missing something terribly obvious or underestimating how much effort this is going to take. Anyone out there able to give me a hint as to what I'm screwing up?

Re: Trying to make small aesthetic change, having trouble, h

Posted: Mon May 23, 2016 4:58 am
by HousePet
I think you want _M.summonTemporalHound = ...

Re: Trying to make small aesthetic change, having trouble, h

Posted: Mon May 23, 2016 1:29 pm
by Frumple
It's giving me a new error, at least! Though thanks for the attempt at helping, aheh. M'pants at this stuff.

Code: Select all

Lua Error: .../superload//data/talents/chronomancy/temporal-hounds.lua:7: attempt to index local '_M' (a nil value)
	At [C]:-1 __newindex
	At .../superload//data/talents/chronomancy/temporal-hounds.lua:7 f
	At /engine/interface/ActorTalents.lua:44 loadDefinition
	At /engine/interface/ActorTalents.lua:40 load
	At /data/talents/chronomancy/chronomancer.lua:138 f
	At /engine/interface/ActorTalents.lua:44 loadDefinition
	At /engine/interface/ActorTalents.lua:40 load
	At /data/talents.lua:89 f
	At /engine/interface/ActorTalents.lua:44 loadDefinition
	At /mod/load.lua:173 
	At [C]:-1 require
	At /engine/Module.lua:160 load
	At /engine/Module.lua:1025 instanciate
	At /engine/utils.lua:2221 showMainMenu
	At /engine/init.lua:165 
	At [C]:-1 dofile
	At /loader/init.lua:217 
Hadn't seen the attempt to index thing, until now.

... honestly, it's becoming increasingly clear I both have no idea what the zog I'm doing and that overloading would be much more simple (and considerably worse, considering I'm trying to be as unobtrusive as possible, code wise :P). Overloading works, even! Just checked, just to be sure. At least now I know it's me not knowing how to work superloading and not something weird going on with the display stuff, heh. It'll even let you casually change the type, to properly make them zephyr hounds, too... so very, very much easier :(

Re: Trying to make small aesthetic change, having trouble, h

Posted: Tue May 24, 2016 2:25 am
by HousePet
Bleh, of course just suggesting something off the top of my head doesn't work...

You need to duplicate all the code in the summonTemporalHound function, not just the bit that sets the symbol.
You should also give you function a different name.
Then you need to edit the Temporal Hounds talent and change the callbackOnActBase function to use your summon function instead.

Re: Trying to make small aesthetic change, having trouble, h

Posted: Tue May 24, 2016 3:26 am
by Frumple
... those last two lines are so far beyond my capability at this stuff my eyes are trying to spin :lol: Though I think most of that is just recovering from being rather massively ill.

Think I sorta' get it, though. Copy the summon-bit code, fix the bits I want to fix, change the name, and then replace every reference (all three of them besides the summon-bit itself, yes, thank you n++) in the rest of the code to the old function with the new function. Not really sure how to do that last bit appropriately, but I think I can puzzle it out with that. So thanks again, aheh.

E: I'll say this now, though. I do believe I am developing a faintly vehement hatred of the words, "unexpected symbol near '='". Tell me what you're expecting so I can fix it, you bloody annoying thing ;_;

E2: Well, I'm... close. But... not quite: Image Is zephyr hound, not gundam. Was fortunately just extra Z in code, not something more exotic. Think I might just have a working addon in a few more minutes!

E3: Damnit, optimism. Now I have to figure out how to get command:blink to point at the right thing ;_;

E4: Holy hell, I just had a couple of extraneous lines. Looks like it works as a .teaa, too! Now to figure out how to upload the blighter :V

E5: And it's up! Probably kick on a feedback/etc. thread for it in a few seconds, just in case for some odd reason it's eventually needed.