Addon causes game to fail to create a new character.

Have a really dumb question? Ask it here to get help from the experts (or those with too much time on their hands)

Moderator: Moderator

Post Reply
Message
Author
geoclasm
Low Yeek
Posts: 6
Joined: Wed Jul 19, 2017 7:08 pm

Addon causes game to fail to create a new character.

#1 Post by geoclasm »

I'm trying to implement an addon that modifies the Actor.levelup( ) function.
I'm trying to superload the Actor.lua file but it's getting stuck when trying to create the initial level for some reason.
In order to rule out addon collisions, I've unsubscribed and removed all existing ( non-inclusive ) addons.

I've checked the path to the file, and dumbed down the code in the file to test if the problem was the code, but it's still not working...

This is all the code that I have in the file -

Code: Select all

local _M = loadPrevious(...)
local base_levelup = _M.levelup

function _M:levelup()
	base_levelup( )
end
I've checked the init file, and all that looks fine -

Code: Select all

-- GenerousLevels - Gives more per level.
-- tome-GenerousLevels/init.lua

long_name = "Generous Levels"
short_name = "Generous Levels" -- Determines the name of your addons file.
for_module = "tome"
version = {1,5,5}
addon_version = {0,0,2}
weight = 100 -- lower the value, sooner the addon will load relative to other addons.

homepage = {'http://www.stackoverflow.com'}
description = [[Is more generous with talents, types and stat points for each level gained.
Birth stats remain unchanged.
5 stat points per level, up 2 from 2.
2 talent points per level ( 3 if a multiple of 5 ), 1 ( 2 ) up from 1 ( 2 ).
2 generic points per level ( 1 if a multiple of 5 ), 1 ( 1 ) up from 1 ( 0 ).
4(!) category points per instance at levels 10, 20 and 36 ( and for every 30 levels after if that's a thing ), up 3 from 1.
2 prodigies at levels 30 and 42 ( up from 1 ). Additionally, +1 prodigies every 50 levels ( so 5 total at 50, and 1 more every 50 levels thereafter ).]]
tags = {'talents', 'categories', 'stats', 'levelup'}

overload = false
superload = true
data = false
hooks = false
Is this the correct place to be asking this question?
What am I doing wrong here?

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

Re: Addon causes game to fail to create a new character.

#2 Post by HousePet »

We need an error message to help with this.
If it is erroring in level generation, you may need to enable flush log to get it.
My feedback meter decays into coding. Give me feedback and I make mods.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Addon causes game to fail to create a new character.

#3 Post by jenx »

Place this at the end of your code

Code: Select all

return _M
MADNESS rocks

geoclasm
Low Yeek
Posts: 6
Joined: Wed Jul 19, 2017 7:08 pm

Re: Addon causes game to fail to create a new character.

#4 Post by geoclasm »

HousePet wrote:We need an error message to help with this.
If it is erroring in level generation, you may need to enable flush log to get it.
No error message. It just gets stuck on the "Creating Level" dialog.

geoclasm
Low Yeek
Posts: 6
Joined: Wed Jul 19, 2017 7:08 pm

Re: Addon causes game to fail to create a new character.

#5 Post by geoclasm »

jenx wrote:Place this at the end of your code

Code: Select all

return _M
Within the function, or just at the end of the script?

Nvm - At either place it didn't have any affect on the outcome.

geoclasm
Low Yeek
Posts: 6
Joined: Wed Jul 19, 2017 7:08 pm

Re: Addon causes game to fail to create a new character.

#6 Post by geoclasm »

Figured it out. Should've paid more attention to the wiki -

Proper code -

Code: Select all

local _M = loadPrevious(...)
local base_levelup = _M.levelup
function _M:levelup( )
	--Your ( My ) Code Here
	return base_levelup(self)
end
return _M

Post Reply