Simple Request?

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
Flython
Low Yeek
Posts: 7
Joined: Sun May 31, 2015 4:11 am

Simple Request?

#1 Post by Flython »

All I want to do is make the high score list read a little better. I'd be happy just having it say "so and so died in The Trollmire, killed by Ce'Nelaith the rattlesnake. It'd be better if it would just say that for named monsters and for regular monsters say "killed by a skeleton mage/ an army ant" but that's splitting hairs.

From what I've seen it should just be a simple edit to mod/init.lua but I just can't get it too work. Well that's not quite right, I did get it to work once by editing the tome.team file directly but doing so again stops me from picking anything when I start a new game.

I know this is a stupid complaint but If I'm going to die as often as I do I'd like my record of failure to read nicely.

Crim, The Red Thunder
Sher'Tul Godslayer
Posts: 2000
Joined: Fri May 07, 2004 8:26 pm
Location: Nahgharash

Re: Simple Request?

#2 Post by Crim, The Red Thunder »

If you got it working once, there's no reason you shouldn't be able to get it working as an addon.

How far into making it an addon did you get before you gave up? It's entirely possible we can help you fix it up.
Currently playing under the name Aura of the Dawn 4 down, 227 to go!
Proud author of Orc Pit Restoration Project, Faction Allies, Dwarven Adventurer addons
SadistSquirrel wrote:DarkGod has two arms, one with an opened hand, one with a closed fist. You got the fist.

Flython
Low Yeek
Posts: 7
Joined: Sun May 31, 2015 4:11 am

Re: Simple Request?

#3 Post by Flython »

Crim, The Red Thunder wrote:If you got it working once, there's no reason you shouldn't be able to get it working as an addon.

How far into making it an addon did you get before you gave up? It's entirely possible we can help you fix it up.
I'm not a coder in any way, shape or form but I thought I'd give this a go because it seemed so simple.

From what I could see I only needed to change two lines in the mod/init.lua file by making a folder containing a copy of the file with my changes and arranged like this tome-test/overload/mod/init.lua.

Code: Select all

score_formatters = {
	["Maj'Eyal"] = {
		alive="#LIGHT_GREEN#{score} : #BLUE#{name}#LAST# the #LIGHT_RED#level {level} {subrace} {subclass}#LAST# is still alive and well on #GREEN#{where}#LAST##WHITE#",
		dead="{score} : #BLUE#{name}#LAST# the #LIGHT_RED#level {level} {subrace} {subclass}#LAST# died on #GREEN#{where}#LAST#, killed by a #RED#{killedby}#LAST#"

to

score_formatters = {
	["Maj'Eyal"] = {
		alive="#LIGHT_GREEN#{score} : #BLUE#{name}#LAST# the #LIGHT_RED#level {level} {subrace} {subclass}#LAST# is still alive and well in the #GREEN#{where}#LAST##WHITE#",
		dead="{score} : #BLUE#{name}#LAST# the #LIGHT_RED#level {level} {subrace} {subclass}#LAST# died in the #GREEN#{where}#LAST#, killed by #RED#{killedby}#LAST#"
All I needed to do after that was borrow an init.lua file from another mod and modify it suit mine. Stuff like short_name = "Archeryfix" to short_name = "test" and so on.

I just don't see why it doesn't work, do I need use hooks or is init.lua a difficult file to change or something? At this point I'm just so frustrated that something so seemingly simple has beaten me. Thanks for replying Crim. :)

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Simple Request?

#4 Post by HousePet »

I'm not sure it is safe to modify init.lua.

But we still don't have enough info to see what has gone wrong.

In what way does it not work?
Does it do nothing, or refuse to load or what?
My feedback meter decays into coding. Give me feedback and I make mods.

Flython
Low Yeek
Posts: 7
Joined: Sun May 31, 2015 4:11 am

Re: Simple Request?

#5 Post by Flython »

It does nothing. Sorry I should have put that in the first post.

I've done a little test and I think you might be right about the init.lua file. I changed nothing about my mod except for adding a mod/class/actor.lua file with a change to give 30 skill points of level up. That change worked perfectly. :lol:

Looks like it's just ignoring my changes to the high score list.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Simple Request?

#6 Post by HousePet »

I'll have a look when I get home to see where the score_formatters table is stored.
If I can find it, I can give you some code to edit it via the load hook.
My feedback meter decays into coding. Give me feedback and I make mods.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Simple Request?

#7 Post by HousePet »

Instead of the overload, try putting this code into your-mod/hooks/load.lua:

Code: Select all

class:bindHook("ToME:load", function(self, data)
      game.__mod_info.score_formatters.["Maj'Eyal"] = {
      alive="#LIGHT_GREEN#{score} : #BLUE#{name}#LAST# the #LIGHT_RED#level {level} {subrace} {subclass}#LAST# is still alive and well in the #GREEN#{where}#LAST##WHITE#",
      dead="{score} : #BLUE#{name}#LAST# the #LIGHT_RED#level {level} {subrace} {subclass}#LAST# died in the #GREEN#{where}#LAST#, killed by #RED#{killedby}#LAST#"
      }
end)
My feedback meter decays into coding. Give me feedback and I make mods.

Flython
Low Yeek
Posts: 7
Joined: Sun May 31, 2015 4:11 am

Re: Simple Request?

#8 Post by Flython »

HousePet wrote:Instead of the overload, try putting this code into your-mod/hooks/load.lua:

Code: Select all

class:bindHook("ToME:load", function(self, data)
      game.__mod_info.score_formatters.["Maj'Eyal"] = {
      alive="#LIGHT_GREEN#{score} : #BLUE#{name}#LAST# the #LIGHT_RED#level {level} {subrace} {subclass}#LAST# is still alive and well in the #GREEN#{where}#LAST##WHITE#",
      dead="{score} : #BLUE#{name}#LAST# the #LIGHT_RED#level {level} {subrace} {subclass}#LAST# died in the #GREEN#{where}#LAST#, killed by #RED#{killedby}#LAST#"
      }
end)
Sorry I haven't replied to this HousePet, work's been crazy the past few days. I'll give this a go and report my findings.

Post Reply