Porting ToME2 to the T4 engine
Moderator: Moderator
-
- Archmage
- Posts: 366
- Joined: Sat Dec 13, 2014 3:38 pm
Re: Porting ToME2 to the T4 engine
What about the Preserve Artifacts option? If it is on, artifacts could be duplicated, if it is off, you might get the message about an artifact being on the level every level.
You might have spelt "IsFollowing" wrong. When I hover over most spells, there is an error saying "IsFolllowing" is empty:
error = "Lua Error: /mod/spell-util.lua:370: attempt to call method 'isFolllowing' (a nil value)\
At [C]:-1 isFolllowing\
At /mod/spell-util.lua:370 fail_prob\
At /mod/class/Actor.lua:1264 getTalentFullDescription\
At /data/hotkey-icons.lua:86 tooltipText\
At /mod/class/HotkeysIconsDisplay.lua:189 onMouse\
At /mod/class/Game.lua:1208 fct\
At /engine/Mouse.lua:78 "
Also, I can't get any new birth options to show up when starting a new game - neither with the "birth" option or a custom group with show_in_birther = true. It's not showing any other errors with most of the things I've tried (including current code), so either your option code is somehow not receiving the information or I've done something incorrectly. My current addon code attached below - can you first please check it so see whether I've got everything correct on my side, and if your module needs it, update your module code so that addons correctly get added to options, birth (if addon calls for it) and in-game?
https://www.dropbox.com/s/o9canhiaaqy6n ... s.zip?dl=0
You might have spelt "IsFollowing" wrong. When I hover over most spells, there is an error saying "IsFolllowing" is empty:
error = "Lua Error: /mod/spell-util.lua:370: attempt to call method 'isFolllowing' (a nil value)\
At [C]:-1 isFolllowing\
At /mod/spell-util.lua:370 fail_prob\
At /mod/class/Actor.lua:1264 getTalentFullDescription\
At /data/hotkey-icons.lua:86 tooltipText\
At /mod/class/HotkeysIconsDisplay.lua:189 onMouse\
At /mod/class/Game.lua:1208 fct\
At /engine/Mouse.lua:78 "
Also, I can't get any new birth options to show up when starting a new game - neither with the "birth" option or a custom group with show_in_birther = true. It's not showing any other errors with most of the things I've tried (including current code), so either your option code is somehow not receiving the information or I've done something incorrectly. My current addon code attached below - can you first please check it so see whether I've got everything correct on my side, and if your module needs it, update your module code so that addons correctly get added to options, birth (if addon calls for it) and in-game?
https://www.dropbox.com/s/o9canhiaaqy6n ... s.zip?dl=0
Last edited by Steven Aus on Tue Mar 15, 2016 8:57 am, edited 1 time in total.
Re: Porting ToME2 to the T4 engine
Looks like you've got yourself a very motivated tester Zizzo, that's cool ! 

[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

-
- Archmage
- Posts: 366
- Joined: Sat Dec 13, 2014 3:38 pm
Re: Porting ToME2 to the T4 engine
When I start a new game using Thunderlord, the Return to Town description text still mentions "none" for town. Does this update when you leave a town (Bree being the first), when you enter a dungeon or when you get to the required level of 7? As well, that Thunderlord that was at Level 7 still has no town recall target, so I'm not sure if the fix you did only applies to new games, or whether there's still something there to sort out. 

-
- Sher'Tul Godslayer
- Posts: 2517
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
Found it! Thunder Strike was firing two separate and independent beams of lightning and sound damage and separately requesting targets for both of them — if you unknowingly cancel out of the sound beam's targeting, you would only get the lightning damage. The right thing to do, obviously, is to reuse the lightning beam's selected target for the sound beam. Fixed; We Apologize for the Confusion.™Steven Aus wrote:Anyway I was wondering whether those low-level but annoying units in Bree are immune to sound damage, because even when not getting killed by the 2 lightning damage at L1 Thunderlord, they don't get sound damage.

If I understand the persistence handling correctly, artifacts left on a persisted level won't have Entity:removed() called on them, and that's where preserve mode does its magic to put artifacts back into circulation. It's true that the precomputed level feeling probably won't change if you leave and return to a persisted level, and will probably be re-reported even if it's no longer appropriate. No idea how the original code handled that.Steven Aus wrote:What about the Preserve Artifacts option? If it is on, artifacts could be duplicated, if it is off, you might get the message about an artifact being on the level every level.
[reads more closely] Oh, three 'l's.Steven Aus wrote:You might have spelt "IsFollowing" wrong. When I hover over most spells, there is an error saying "IsFolllowing" is empty:



[sound F/X: downloading] Let's see:Steven Aus wrote:Also, I can't get any new birth options to show up when starting a new game - neither with the "birth" option or a custom group with show_in_birther = true. It's not showing any other errors with most of the things I've tried (including current code), so either your option code is somehow not receiving the information or I've done something incorrectly. My current addon code attached below - can you first please check it so see whether I've got everything correct on my side, and if your module needs it, update your module code so that addons correctly get added to options, birth (if addon calls for it) and in-game?
- Well, the proximate problem is that "ToME:load" is a T4 module hook; the corresponding hook in the T2 module is "T2:load".
- You're missing a lot of commas in your option definition. Check the module's option definitions to see the syntax.
- You need to set the 'persistent' field in the zone definition table. [sound F/X: downloading] In the context of the "Zone:create" hook, 'self' is the zone definition table, so you'll want to say 'self.persistent = "zone"'.
- You don't seem to be actually using the game option you're defining. To have the persistent flag added only when the "Persistent dungeons" option is enabled, wrap it in an 'if config.settings.tome2.persistentdungeons' block.
- Oh, and Lua doesn't use C-style /* */ comments. Lua comments are -- to end of line.
This. When I implemented it that way, I hadn't anticipated that that information would be visible to the player that early; I may rearrange that later.Steven Aus wrote:When I start a new game using Thunderlord, the Return to Town description text still mentions "none" for town. Does this update when you leave a town (Bree being the first),
Very likely it only applies to new games. Your old character might gain that information the next time it enters and leaves a town (or if it's saved in town, you might need to leave, return and leave again), but I don't promise anything.Steven Aus wrote: As well, that Thunderlord that was at Level 7 still has no town recall target, so I'm not sure if the fix you did only applies to new games, or whether there's still something there to sort out.
"Blessed are the yeeks, for they shall inherit Arda..."
-
- Archmage
- Posts: 366
- Joined: Sat Dec 13, 2014 3:38 pm
Re: Porting ToME2 to the T4 engine
I haven't been able to get the addon to load since fixing (hopefully most of the) errors. Currently I'm getting an error on line 26 of my load.lua and line 50 of the module's GameOptions:
error = "Lua Error: /engine/utils.lua
cannot open /data/option.lua: No error\
At [C]:-1 \
At [C]:-1 error\
At /engine/utils.lua:1806 loadfilemods\
At /mod/dialogs/GameOptions.lua:50 loadDefinition\
At /hooks/persistentdungeons/load.lua:26 \
At [string \"return function(l, self, data) local ok=false...\"]:1 triggerHook\
At /mod/load.lua:206 \
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 "
Here's the current version of my addon code:
https://www.dropbox.com/s/o9canhiaaqy6n ... s.zip?dl=0
error = "Lua Error: /engine/utils.lua
At [C]:-1 \
At [C]:-1 error\
At /engine/utils.lua:1806 loadfilemods\
At /mod/dialogs/GameOptions.lua:50 loadDefinition\
At /hooks/persistentdungeons/load.lua:26 \
At [string \"return function(l, self, data) local ok=false...\"]:1 triggerHook\
At /mod/load.lua:206 \
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 "
Here's the current version of my addon code:
https://www.dropbox.com/s/o9canhiaaqy6n ... s.zip?dl=0
-
- Archmage
- Posts: 366
- Joined: Sat Dec 13, 2014 3:38 pm
Re: Porting ToME2 to the T4 engine
Look forward to hearing from you Zizzo! Best wishes. 

-
- Sher'Tul Godslayer
- Posts: 2517
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
We Apologize for the Delay;™ was in deep-dev mode.
to
Hmm, are you… [sound F/X: source diving] ah, there it is: The engine's addon-loading infrastructure virtually mounts your addon's /data directory onto the path /data-<short_name>, where <short_name> is as defined in init.lua. So in your hooks/load.lua, you need to change:Steven Aus wrote:I haven't been able to get the addon to load since fixing (hopefully most of the) errors. Currently I'm getting an error on line 26 of my load.lua and line 50 of the module's GameOptions:
error = "Lua Error: /engine/utils.luacannot open /data/option.lua: No error\
Code: Select all
GameOptions:loadDefinition('/data/option.lua')
Code: Select all
GameOptions:loadDefinition('/data-persistentdungeons/option.lua')
"Blessed are the yeeks, for they shall inherit Arda..."
-
- Archmage
- Posts: 366
- Joined: Sat Dec 13, 2014 3:38 pm
Re: Porting ToME2 to the T4 engine
The 'birth' group is not accessible as the group for newOption{} in my option file (and I get an "unrecognised option group 'birth'" error). When I create a newOptionGroup{} separate from the built-in ones (with "show_in_birther = true,") the game loads, but the extra option is not there. I don't see any reason why you wouldn't be able to use your built-in option groups (unless they haven't loaded at that point or something). When I define it again, the game loads but the extra Birth Option is not there. And definitely, when a newOption{} is defined with "show_in_birther = true,", it should be showing up when you start a new game, and it isn't currently, even though the game is loading properly with the addon running.
Btw: have you checked in any changes in the last few days so that it would be good to update on my computer from your SVN? If not, what have you been working on recently that is still in progress?
Also, the random quest option is allowing number input on my computer, but I'm not sure if that is because I am trying to define another option after it. You might want to check to see whether it is working for you.
Someone said that no-one used Runecrafters in ToME2 because they didn't have enough storage space to store enough different types of runes. Is it possible that the inventory could be made bigger (maybe 30 items) either for the Runecrafter specifically, or if not for all player characters? And could this be done in an addon? If it not possible to extend the inventory at all, maybe the Runecrafter could have a "Rune Pouch" which would be like a mini-inventory inside the inventory, which would hold only runes (maybe 10 max, or more if it proves necessary) or it could even be an alternative inventory, a bit like the transmogrifier in ToME4 (but without conversion to gold and/or energy each level change, obviously).
Btw: have you checked in any changes in the last few days so that it would be good to update on my computer from your SVN? If not, what have you been working on recently that is still in progress?
Also, the random quest option is allowing number input on my computer, but I'm not sure if that is because I am trying to define another option after it. You might want to check to see whether it is working for you.
Someone said that no-one used Runecrafters in ToME2 because they didn't have enough storage space to store enough different types of runes. Is it possible that the inventory could be made bigger (maybe 30 items) either for the Runecrafter specifically, or if not for all player characters? And could this be done in an addon? If it not possible to extend the inventory at all, maybe the Runecrafter could have a "Rune Pouch" which would be like a mini-inventory inside the inventory, which would hold only runes (maybe 10 max, or more if it proves necessary) or it could even be an alternative inventory, a bit like the transmogrifier in ToME4 (but without conversion to gold and/or energy each level change, obviously).
-
- Sher'Tul Godslayer
- Posts: 2517
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
Hmm… [sound F/X: testing] Oh, you want:Steven Aus wrote:The 'birth' group is not accessible as the group for newOption{} in my option file (and I get an "unrecognised option group 'birth'" error). When I create a newOptionGroup{} separate from the built-in ones (with "show_in_birther = true,") the game loads, but the extra option is not there. I don't see any reason why you wouldn't be able to use your built-in option groups (unless they haven't loaded at that point or something). When I define it again, the game loads but the extra Birth Option is not there. And definitely, when a newOption{} is defined with "show_in_birther = true,", it should be showing up when you start a new game, and it isn't currently, even though the game is loading properly with the addon running.
Code: Select all
local GameOptions = require "mod.dialogs.GameOptions"
Code: Select all
local GameOptions = require "mod/dialogs/GameOptions"
Ah, and I see my documentation was incomplete: after loading your options file, you should also call GameOptions:setupOptions(), which does the setting up of default values. We Apologize for the Omission.™
That's what the "svn log" command is for. In particular:Steven Aus wrote:Btw: have you checked in any changes in the last few days so that it would be good to update on my computer from your SVN? If not, what have you been working on recently that is still in progress?
Code: Select all
svn log -v -r BASE:HEAD
That was commit #2270Steven Aus wrote:Also, the random quest option is allowing number input on my computer, but I'm not sure if that is because I am trying to define another option after it. You might want to check to see whether it is working for you.

Possibly. [sound F/X: source diving] I think it would involve directly manipulating the inventory definitions, probably somewhere in a superloaded Player:init(). That kind of juggling is something I'm not looking forward to having to figure out when I get around to implementing Possession…Steven Aus wrote:Someone said that no-one used Runecrafters in ToME2 because they didn't have enough storage space to store enough different types of runes. Is it possible that the inventory could be made bigger (maybe 30 items) either for the Runecrafter specifically, or if not for all player characters? And could this be done in an addon?

Again, possible in theory. I had a T2 mod once (that probably got lost in a hard drive replacement) that did something similar for the Essences that Alchemists accumulate. It would depend heavily on how I end up implementing Runecraft, once I eventually do.Steven Aus wrote:If it not possible to extend the inventory at all, maybe the Runecrafter could have a "Rune Pouch" which would be like a mini-inventory inside the inventory, which would hold only runes (maybe 10 max, or more if it proves necessary) or it could even be an alternative inventory, a bit like the transmogrifier in ToME4 (but without conversion to gold and/or energy each level change, obviously).
"Blessed are the yeeks, for they shall inherit Arda..."
-
- Archmage
- Posts: 366
- Joined: Sat Dec 13, 2014 3:38 pm
Re: Porting ToME2 to the T4 engine
Your code for putting in a value when an option is populated for the first time didn't consider boolean values, so after it had been created with 'nil' I had to convert it to a usual value (false, the default). Let me know when you've fixed that bit, so I can remove this code from my hooks/load.lua file. I've renamed the key and references to it to use 'persistentdungeonlevels' so it is not the same as the shortname for the addon, which is 'persistentdungeons'. Btw: the maps seem to be persistent now with the addon on. I also have Preserve Artifacts On, so hopefully, since artifacts aren't removed, there won't be copied artifacts or annoying messages. I may also change the Preserve Artifacts setting with my addon, of course mentioning that it is for best compatibility and least annoyance for the base ToME2 port.
I've tried the module (version 2992) with my addon off, these are the errors I've found so far:
error = "Lua Error: /mod/class/Object.lua:552: attempt to index field 'check' (a nil value)\
At [C]:-1 __index\
At /mod/class/Object.lua:552 field_list\
At /mod/class/Object.lua:612 getFlagsDesc\
At /mod/class/Object.lua:749 getDesc\
At /mod/dialogs/ShowEquipInvenFloor.lua:118 generateList\
At /engine/dialogs/ShowEquipInven.lua:59 init\
At /mod/dialogs/ShowEquipInvenFloor.lua:45 init\
At /engine/class.lua:147 new\
At /mod/class/Player.lua:1025 showEquipInvenFloor\
At /mod/class/Game.lua:884 \
At /engine/KeyBind.lua:236 "
error = "Lua Error: /engine/interface/GameTargeting.lua:119: /engine/interface/ActorTalents.lua:155: attempt to index local 'special' (a number value)\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/GameTargeting.lua:119 fct\
At /engine/interface/GameTargeting.lua:125 targetMode\
At /engine/interface/GameTargeting.lua:254 targetMouse\
At /mod/class/Game.lua:1189 fct\
At /engine/Mouse.lua:58 "
error = "Lua Error: /mod/class/Object.lua:339: attempt to index global 'o' (a nil value)\
At [C]:-1 __index\
At /mod/class/Object.lua:339 getName\
At /engine/Object.lua:49 resolve\
At /mod/class/Object.lua:122 resolve\
At /engine/Zone.lua:676 finishEntity\
At /engine/Zone.lua:448 makeEntityByName\
At /mod/class/Store.lua:287 loadup\
At /mod/resolvers.lua:38 check\
At [string \"return function(self, x, y, what, ...) local ...\"]:1 checkAllEntities\
At /engine/Actor.lua:209 move\
At /mod/class/Actor.lua:445 move\
At /mod/class/Player.lua:285 move\
At /engine/interface/PlayerRun.lua:136 runStep\
At /mod/class/Player.lua:478 act\
At /engine/GameEnergyBased.lua:129 tickLevel\
At /mod/class/GameEnergyBasedEvilHack.lua:32 tick\
At /engine/GameTurnBased.lua:51 tick\
At /mod/class/Game.lua:547 "
error = "Lua Error: /mod/class/Object.lua:339: attempt to index global 'o' (a nil value)\
At [C]:-1 __index\
At /mod/class/Object.lua:339 getName\
At /engine/Object.lua:49 resolve\
At /mod/class/Object.lua:122 resolve\
At /engine/Zone.lua:676 finishEntity\
At /engine/Zone.lua:448 makeEntityByName\
At /mod/class/Store.lua:287 loadup\
At /mod/resolvers.lua:38 check\
At [string \"return function(self, x, y, what, ...) local ...\"]:1 checkAllEntities\
At /engine/Actor.lua:209 move\
At /mod/class/Actor.lua:445 move\
At /mod/class/Player.lua:285 move\
At /engine/interface/PlayerRun.lua:136 runStep\
At /mod/class/Player.lua:478 act\
At /engine/GameEnergyBased.lua:129 tickLevel\
At /mod/class/GameEnergyBasedEvilHack.lua:32 tick\
At /engine/GameTurnBased.lua:51 tick\
At /mod/class/Game.lua:547 "
Code: Select all
if type(config.settings.tome2.persistentdungeonlevels) == 'nil' then
config.settings.tome2.persistentdungeonlevels = false
end
I've tried the module (version 2992) with my addon off, these are the errors I've found so far:
error = "Lua Error: /mod/class/Object.lua:552: attempt to index field 'check' (a nil value)\
At [C]:-1 __index\
At /mod/class/Object.lua:552 field_list\
At /mod/class/Object.lua:612 getFlagsDesc\
At /mod/class/Object.lua:749 getDesc\
At /mod/dialogs/ShowEquipInvenFloor.lua:118 generateList\
At /engine/dialogs/ShowEquipInven.lua:59 init\
At /mod/dialogs/ShowEquipInvenFloor.lua:45 init\
At /engine/class.lua:147 new\
At /mod/class/Player.lua:1025 showEquipInvenFloor\
At /mod/class/Game.lua:884 \
At /engine/KeyBind.lua:236 "
error = "Lua Error: /engine/interface/GameTargeting.lua:119: /engine/interface/ActorTalents.lua:155: attempt to index local 'special' (a number value)\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/GameTargeting.lua:119 fct\
At /engine/interface/GameTargeting.lua:125 targetMode\
At /engine/interface/GameTargeting.lua:254 targetMouse\
At /mod/class/Game.lua:1189 fct\
At /engine/Mouse.lua:58 "
error = "Lua Error: /mod/class/Object.lua:339: attempt to index global 'o' (a nil value)\
At [C]:-1 __index\
At /mod/class/Object.lua:339 getName\
At /engine/Object.lua:49 resolve\
At /mod/class/Object.lua:122 resolve\
At /engine/Zone.lua:676 finishEntity\
At /engine/Zone.lua:448 makeEntityByName\
At /mod/class/Store.lua:287 loadup\
At /mod/resolvers.lua:38 check\
At [string \"return function(self, x, y, what, ...) local ...\"]:1 checkAllEntities\
At /engine/Actor.lua:209 move\
At /mod/class/Actor.lua:445 move\
At /mod/class/Player.lua:285 move\
At /engine/interface/PlayerRun.lua:136 runStep\
At /mod/class/Player.lua:478 act\
At /engine/GameEnergyBased.lua:129 tickLevel\
At /mod/class/GameEnergyBasedEvilHack.lua:32 tick\
At /engine/GameTurnBased.lua:51 tick\
At /mod/class/Game.lua:547 "
error = "Lua Error: /mod/class/Object.lua:339: attempt to index global 'o' (a nil value)\
At [C]:-1 __index\
At /mod/class/Object.lua:339 getName\
At /engine/Object.lua:49 resolve\
At /mod/class/Object.lua:122 resolve\
At /engine/Zone.lua:676 finishEntity\
At /engine/Zone.lua:448 makeEntityByName\
At /mod/class/Store.lua:287 loadup\
At /mod/resolvers.lua:38 check\
At [string \"return function(self, x, y, what, ...) local ...\"]:1 checkAllEntities\
At /engine/Actor.lua:209 move\
At /mod/class/Actor.lua:445 move\
At /mod/class/Player.lua:285 move\
At /engine/interface/PlayerRun.lua:136 runStep\
At /mod/class/Player.lua:478 act\
At /engine/GameEnergyBased.lua:129 tickLevel\
At /mod/class/GameEnergyBasedEvilHack.lua:32 tick\
At /engine/GameTurnBased.lua:51 tick\
At /mod/class/Game.lua:547 "
-
- Sher'Tul Godslayer
- Posts: 2517
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
Are you calling GameOptions:setupOptions() after you load your option definition file? That should do that setup for you. (I neglected to mention that in the documentation; We Apologize for the Error.™Steven Aus wrote:Your code for putting in a value when an option is populated for the first time didn't consider boolean values, so after it had been created with 'nil' I had to convert it to a usual value (false, the default). Let me know when you've fixed that bit, so I can remove this code from my hooks/load.lua file.Code: Select all
if type(config.settings.tome2.persistentdungeonlevels) == 'nil' then config.settings.tome2.persistentdungeonlevels = false end

[Of course, over in the T4 module, addons that define a game option are expected to do the kind of default-value setup you describe above — and build their own Textzone to describe the option, and set up their own data entry for anything more complicated than a boolean value… I tell ya, kids these days don't know how good they've got it.

That shouldn't be a problem.Steven Aus wrote:I've renamed the key and references to it to use 'persistentdungeonlevels' so it is not the same as the shortname for the addon, which is 'persistentdungeons'.
Hmm, it just occurred to me: this might screw up princess quests and lost sword quests if you kill some of the quest monsters and then leave the level and come back. Currently both quests are set up to reset their kill count when you leave the level, on the assumption that all of them will be recreated when you return to the level.Steven Aus wrote: Btw: the maps seem to be persistent now with the addon on.
What were you doing when you got this error? Clearly it was some kind of targeted talent; couldn't have been archery, because that didn't work until a few minutes ago…Steven Aus wrote:error = "Lua Error: /engine/interface/GameTargeting.lua:119: /engine/interface/ActorTalents.lua:155: attempt to index local 'special' (a number value)\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/GameTargeting.lua:119 fct\
At /engine/interface/GameTargeting.lua:125 targetMode\
At /engine/interface/GameTargeting.lua:254 targetMouse\
At /mod/class/Game.lua:1189 fct\
At /engine/Mouse.lua:58 "

"Blessed are the yeeks, for they shall inherit Arda..."
-
- Archmage
- Posts: 366
- Joined: Sat Dec 13, 2014 3:38 pm
Re: Porting ToME2 to the T4 engine
I think I was firing a Manathrust. EDIT: Confirmed, I got the same error with 2295.
Fire Arrow doesn't seem to be hitting enemies, even if they are in the way of the arrow (it doesn't move as fast as a Manathrust, so they can sometimes move out of the way, but the arrows are now dropping harmlessly one square beyond the enemy without hitting them).
Also, is possible to check for Persistent Dungeons being on and then modify the quests if necessary? Or replace them?
I'm pretty sure when you turn the addon off and on, and then use the addon, if shortname and the key name are the same it overwrites the variable - because the addon is on, you get a true for it.
What I mean is, the variable for indicating the addon is active is:
config.settings.tome2.persistentdungeons
and if the key is exactly the same, the addon being active will always overwrite the key, because the key for the option would also be:
config.settings.tome2.persistentdungeons
I think. =)
Fire Arrow doesn't seem to be hitting enemies, even if they are in the way of the arrow (it doesn't move as fast as a Manathrust, so they can sometimes move out of the way, but the arrows are now dropping harmlessly one square beyond the enemy without hitting them).
Also, is possible to check for Persistent Dungeons being on and then modify the quests if necessary? Or replace them?
I'm pretty sure when you turn the addon off and on, and then use the addon, if shortname and the key name are the same it overwrites the variable - because the addon is on, you get a true for it.
What I mean is, the variable for indicating the addon is active is:
config.settings.tome2.persistentdungeons
and if the key is exactly the same, the addon being active will always overwrite the key, because the key for the option would also be:
config.settings.tome2.persistentdungeons
I think. =)
-
- Sher'Tul Godslayer
- Posts: 2517
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
[sound F/X: source diving] Ah, crap, my fix for Thunder Strike broke literally almost everything else. That should be fixed now.Steven Aus wrote:I think I was firing a Manathrust. EDIT: Confirmed, I got the same error with 2295.
No, Fire Arrow moves exactly as fast as Manathrust (the original T2 predates T4's projectile handling); what you're seeing is the arrow hitting (or missing) the target and falling to the ground and then the target moving. I've seen arrows hit in testing; the log should report something along the lines of "player's arrow hits target for n damage. As currently implemented, arrows don't break if they miss, and have a chance of breaking if they hit (decreasing with increased Archery skill).Steven Aus wrote:Fire Arrow doesn't seem to be hitting enemies, even if they are in the way of the arrow (it doesn't move as fast as a Manathrust, so they can sometimes move out of the way, but the arrows are now dropping harmlessly one square beyond the enemy without hitting them).
Probably. [sound F/X: source diving] My approach would probably be to superload Player:on_quest_grant() and remove or modify the quests' on_leave_level() callback before it's installed; in extremis, you could overload the quest definition files themselves, but that tends to be fragile.Steven Aus wrote:Also, is possible to check for Persistent Dungeons being on and then modify the quests if necessary? Or replace them?
Um… no, that lives in game.__mod_info.addons.persistentdungeons [cf. engine.Game:isAddonActive()]. config.settings.<module_name> is just for game settings.Steven Aus wrote:I'm pretty sure when you turn the addon off and on, and then use the addon, if shortname and the key name are the same it overwrites the variable - because the addon is on, you get a true for it.
What I mean is, the variable for indicating the addon is active is:
config.settings.tome2.persistentdungeons
"Blessed are the yeeks, for they shall inherit Arda..."
-
- Archmage
- Posts: 366
- Joined: Sat Dec 13, 2014 3:38 pm
Re: Porting ToME2 to the T4 engine
With my L1 High Elf Ranger, I shot about 8 arrows and they all missed.
https://www.dropbox.com/s/onxe35v7pltqq ... r.zip?dl=0
Also, even when trying to hit monsters in Bree with a preferred melee weapon, they are missing all the time. Does this mean you might have accidentally affected the chance to hit somehow with ranged and melee weapons wielded by player characters?
I don't think a Petty Dwarf or Human Haftedmaster would miss 5 or 10 times in a row with the easy Bree monsters. The monsters pretty much always hit, the player characters are missing all the time now with everything except spells.
NOTE: there is still an error for at least the Manathrust spell, with both characters created before and after the latest SVN was installed producing this error when using Manathrust:
error = "Lua Error: /engine/interface/GameTargeting.lua:119: /engine/interface/ActorTalents.lua:155: attempt to index local 'special' (a number value)\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/GameTargeting.lua:119 fct\
At /engine/interface/GameTargeting.lua:125 targetMode\
At /engine/interface/GameTargeting.lua:254 targetMouse\
At /mod/class/Game.lua:1189 fct\
At /engine/Mouse.lua:58 "
The following code doesn't cause any errors, but I'm wondering whether it would prevent the kill count being reset in princess and lost sword quests if persistentdungeonlevels is on. (superload/class/Player.lua with superload enabled in init.lua)
I looked at all the quests and only princess and lost sword quests have the "on_leave_level" callback, and the only thing the callback does is reset the kill count if you leave the level before completing the quest.
Also, does Petty Dwarf sometimes reveal the whole level when he goes in? I've gone into the dungeons two times with a Petty Dwarf character, the first time the whole level was revealed and the second time it wasn't. I've never seen the whole level revealed when you enter it before. If that is an ability of the Petty Dwarf (and maybe the regular Dwarf - not sure) I will need to see if it triggers every time you enter a particular level, or only the first time when it is created. Because that would be an exploit if persistent levels was on, and all you needed to do was keep exiting and entering the level until it revealed the whole level. However if it only happens on creation it won't require further adjustment for the addon.
https://www.dropbox.com/s/onxe35v7pltqq ... r.zip?dl=0
Also, even when trying to hit monsters in Bree with a preferred melee weapon, they are missing all the time. Does this mean you might have accidentally affected the chance to hit somehow with ranged and melee weapons wielded by player characters?
I don't think a Petty Dwarf or Human Haftedmaster would miss 5 or 10 times in a row with the easy Bree monsters. The monsters pretty much always hit, the player characters are missing all the time now with everything except spells.
NOTE: there is still an error for at least the Manathrust spell, with both characters created before and after the latest SVN was installed producing this error when using Manathrust:
error = "Lua Error: /engine/interface/GameTargeting.lua:119: /engine/interface/ActorTalents.lua:155: attempt to index local 'special' (a number value)\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/GameTargeting.lua:119 fct\
At /engine/interface/GameTargeting.lua:125 targetMode\
At /engine/interface/GameTargeting.lua:254 targetMouse\
At /mod/class/Game.lua:1189 fct\
At /engine/Mouse.lua:58 "
The following code doesn't cause any errors, but I'm wondering whether it would prevent the kill count being reset in princess and lost sword quests if persistentdungeonlevels is on. (superload/class/Player.lua with superload enabled in init.lua)
Code: Select all
local _M = loadPrevious(...)
local callbackon_leave_level = _M.callbackon_leave_level
if config.settings.tome2.persistentdungeonlevels then
function _M.callbackon_leave_level()
end
end
return _M
Also, does Petty Dwarf sometimes reveal the whole level when he goes in? I've gone into the dungeons two times with a Petty Dwarf character, the first time the whole level was revealed and the second time it wasn't. I've never seen the whole level revealed when you enter it before. If that is an ability of the Petty Dwarf (and maybe the regular Dwarf - not sure) I will need to see if it triggers every time you enter a particular level, or only the first time when it is created. Because that would be an exploit if persistent levels was on, and all you needed to do was keep exiting and entering the level until it revealed the whole level. However if it only happens on creation it won't require further adjustment for the addon.
-
- Sher'Tul Godslayer
- Posts: 2517
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Porting ToME2 to the T4 engine
[sound F/X: testing] Odd, my High-Elf Ranger just hit a Singing Happy Drunk with the first two arrows he shot.Steven Aus wrote: my L1 High Elf Ranger, I shot about 8 arrows and they all missed.
[unzips] Hmm, this logfile appears to be truncated; it ends right around the addon check. Usually this means you need to use the --flush-stdout option to make sure every line of the log gets written out, but I don't really know how to do that in Windows or Steam. [I'm pretty sure I've seen someone mention how to do that at one point; anyone know what I'm thinking of?]Steven Aus wrote:https://www.dropbox.com/s/onxe35v7pltqq ... r.zip?dl=0
[sound F/X: testing] …Now, that is very odd, because I'm not getting that error anymore.Steven Aus wrote:NOTE: there is still an error for at least the Manathrust spell, with both characters created before and after the latest SVN was installed producing this error when using Manathrust:
That's… not going to do anything, because mod.class.Player doesn't have a :callbackon_leave_level() method; the on_leave_level() callback lives in the quest object. You'll want to remove that callback from the quest object in Player:on_quest_grant(), something like:Steven Aus wrote:The following code doesn't cause any errors, but I'm wondering whether it would prevent the kill count being reset in princess and lost sword quests if persistentdungeonlevels is on. (superload/class/Player.lua with superload enabled in init.lua)Code: Select all
local _M = loadPrevious(...) local callbackon_leave_level = _M.callbackon_leave_level if config.settings.tome2.persistentdungeonlevels then function _M.callbackon_leave_level() end end return _M
Code: Select all
local super_on_quest_grant = _M.on_quest_grant
function _M:on_quest_grant(quest)
if config.settings.tome2.persistentdungeonlevels then
-- Princess/lost sword quest IDs vary by zone/level.
if quest.id:sub(1, 9) == 'princess-' or quest.id:sub(1, 11) == 'lost-sword-' then
-- Remove the on_leave_level() callback.
quest.callbacks.on_leave_level = nil
end
end
-- Parent method installs the callbacks (unless we just removed it).
super_on_quest_grant(self, quest)
end
Was it a big empty level, with a bunch of rooms and no corridors between them? Those are called 'arena' levels; they'll happen on occasion if you have the "Allow empty 'arena' levels" game option enabled, and about 80% of them will be fully lit.Steven Aus wrote:Also, does Petty Dwarf sometimes reveal the whole level when he goes in? I've gone into the dungeons two times with a Petty Dwarf character, the first time the whole level was revealed and the second time it wasn't.
"Blessed are the yeeks, for they shall inherit Arda..."