Porting ToME2 to the T4 engine

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

What do you want to see in the next release?

Hey, why haven't you implemented my favorite race/subrace/class yet? (specify below)
1
17%
Hey, why haven't you implemented my favorite skill/talent/spell/ability yet? (specify below)
2
33%
Hey, why haven't you implemented my favorite scroll/potion/wand/staff/rod/other object yet? (specify below)
0
No votes
Hey, why haven't you implemented my favorite store/quest/event yet? (specify below)
0
No votes
Hey, that's not what that dungeon's supposed to look like! (specify below)
0
No votes
Hey, why haven't you implemented my favorite game mechanic/UI feature yet? (specify below)
2
33%
Hey, that's a bug! Go fix that bug! (specify below)
1
17%
Hey, you didn't list what I want to see! (specify below)
0
No votes
 
Total votes: 6

Message
Author
Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: Porting ToME2 to the T4 engine

#331 Post by Steven Aus »

Well, I got a princess quest on Level 6 of the Barrow-downs, but when I won it didn't create the level down (although it did give me the reward). Actually, ever since you put in the proxy quest message for the princess quest, I don't think it has successfully created a princess (either a random monster in a cage, or nothing in the cage).

Here is what happened:

error = "Lua Error: /engine/Level.lua:122: attempt to index local 'e' (a nil value)\
At [C]:-1 __index\
At /engine/Level.lua:122 removeEntity\
At /data/chats/quest-princess-finish.lua:43 \
At /engine/Game.lua:313 onTickEndExecute\
At /engine/Game.lua:304 tick\
At /engine/GameTurnBased.lua:49 tick\
At /mod/class/Game.lua:547 "

The rebinding (Alt-L instead of Ctrl-L) didn't work for my existing game.

Here are some other errors:

error = "Lua Error: /engine/interface/ActorTalents.lua:279: /engine/interface/ActorTalents.lua:256: /engine/interface/ActorTalents.lua:150: /data/general/grids/all.lua:123: attempt to index global 'DamageType' (a nil value)\
stack traceback:\
\9/data/general/grids/all.lua:123: in function 'change_for_dmgtype'\
\9/mod/class/Grid.lua:262: in function 'check'\
\9[string \"return function(self, x, y, what, ...) local ...\"]:1: in function 'checkAllEntities'\
\9/engine/interface/ActorProject.lua:211: in function 'project'\
\9/mod/spell-util.lua:1521: in function 'ball_spell'\
\9/data/talents/spell/fire.lua:72: in function </data/talents/spell/fire.lua:68>\
\9[C]: in function 'xpcall'\
\9/engine/interface/ActorTalents.lua:147: in function </engine/interface/ActorTalents.lua:140>\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/ActorTalents.lua:279 useTalent\
At /mod/class/Player.lua:640 useTalent\
At /engine/interface/PlayerHotkeys.lua:170 \
At /engine/interface/PlayerHotkeys.lua:162 activateHotkey\
At /mod/class/HotkeysIconsDisplay.lua:178 onMouse\
At /mod/class/Game.lua:1208 fct\
At /engine/Mouse.lua:58 "

This is when I tried to pick up 2 Short Bows when my inventory already had 2 Short Bows which looked the same from what I knew about them. Also, I have got the following error at other times too when picking things up (most likely when there was something similar already in my inventory). I don't think I've had the error before the latest version of the module files.

error = "Lua Error: /mod/class/Actor.lua:1491: invalid order function for sorting\
At [C]:-1 \
At [C]:-1 sort\
At /mod/class/Actor.lua:1491 sortInven\
At /mod/class/Player.lua:1133 pickupFloor\
At /mod/dialogs/UseItemDialog.lua:133 use\
At /mod/dialogs/UseItemDialog.lua:45 fct\
At /engine/ui/List.lua:155 onUse\
At /engine/ui/List.lua:81 fct\
At /engine/Mouse.lua:58 receiveMouse\
At /engine/Mouse.lua:98 delegate\
At /engine/ui/Dialog.lua:657 mouseEvent\
At /engine/ui/Dialog.lua:399 fct\
At /engine/Mouse.lua:58 "

Just in case you need my log from my playthrough today for any additional information, here it is:

https://www.dropbox.com/s/z6nwwf785y7cv ... 2.zip?dl=0

Btw: is there a weight limit for the inventory (I only have Strength 3)? I guess this is not implemented yet. When you do implement it, I might have to start another character.

When I encountered the princess quest on the level in the save below, I found the princess was a zombie giant salamander, stuck behind a wall. When I rescued the "princess" (after the save below) the wall disappeared but the zombie giant salamander remained, which I could kill. I think other times the princess square had no unit in it, although maybe another time there was a different unit there.

https://www.dropbox.com/s/a7thuliijbd85 ... 4.zip?dl=0

Note: you can put more items in Home (nee Thieves Guild) then you have room for - it goes up to x (so 24 items), but any items you put in there afterwards are lost permanently. Even though the Mathom-house allows you to put items that you lose control of, maybe the Mathom-house will take more than its capacity too, which might make them disappear (not that it matters as much if you lose control of items placed in the Mathom-house anyway, compared with Home which you don't).

Interface bug: when you have two doors adjacent to you, you can't use "o" to try out a door until it's unlocked, you have to push the direction key one by one until it opens. I suggest that if you are next to two locked doors at the same time, you are asked to give a valid direction to a door to keep trying to unlock. Currently it gives an error message (just a regular one, not a lua one) when you are next to two doors and press "o".

Globe of light sometimes currently gives an error when hitting enemies - although mostly it still does damage even if it gives the error:

error = "Lua Error: /engine/interface/ActorTalents.lua:279: /engine/interface/ActorTalents.lua:256: /engine/interface/ActorTalents.lua:150: /data/general/grids/all.lua:123: attempt to index global 'DamageType' (a nil value)\
stack traceback:\
\9/data/general/grids/all.lua:123: in function 'change_for_dmgtype'\
\9/mod/class/Grid.lua:262: in function 'check'\
\9[string \"return function(self, x, y, what, ...) local ...\"]:1: in function 'checkAllEntities'\
\9/engine/interface/ActorProject.lua:211: in function 'project'\
\9/mod/spell-util.lua:1521: in function 'ball_spell'\
\9/data/talents/spell/fire.lua:77: in function </data/talents/spell/fire.lua:68>\
\9[C]: in function 'xpcall'\
\9/engine/interface/ActorTalents.lua:147: in function </engine/interface/ActorTalents.lua:140>\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/ActorTalents.lua:279 useTalent\
At /mod/class/Player.lua:640 useTalent\
At /engine/interface/PlayerHotkeys.lua:170 \
At /engine/interface/PlayerHotkeys.lua:162 activateHotkey\
At /mod/class/HotkeysIconsDisplay.lua:178 onMouse\
At /mod/class/Game.lua:1208 fct\
At /engine/Mouse.lua:58 "

A very important balance issue: Globe of Light is not seeming to take any time to cast, which means you can keep using it until everything is dead, even if they are close. I don't think this is intended, or is it?

I quit the game before I died, but the last error I got was this, probably from a confusion causing monster. I wasn't carrying a weapon.

error = "Lua Error: /mod/class/interface/PlayerCombat.lua:117: attempt to call method 'hasFlag' (a nil value)\
At [C]:-1 hasFlag\
At /mod/class/interface/PlayerCombat.lua:117 one_blow\
At /mod/class/interface/PlayerCombat.lua:692 bumpInto\
At /mod/class/Actor.lua:899 attack\
At /mod/class/Actor.lua:514 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:286 moveDir\
At /mod/class/Player.lua:279 moveDir\
At /mod/class/Game.lua:812 move_or_scroll\
At /mod/class/Game.lua:823 \
At /engine/KeyBind.lua:230 "

Trying to use an identified Ranger Totem item that restores levels and stats (it's in my save right at the end of this post).

error = "Lua Error: /mod/class/Player.lua:1196: /mod/class/interface/ActorStats.lua:127: attempt to compare nil with number\
At [C]:-1 \
At [C]:-1 error\
At /mod/class/Player.lua:1196 playerUseItem\
At /mod/dialogs/UseItemDialog.lua:69 use\
At /mod/dialogs/UseItemDialog.lua:45 fct\
At /engine/ui/List.lua:155 onUse\
At /engine/ui/List.lua:81 fct\
At /engine/Mouse.lua:58 receiveMouse\
At /engine/Mouse.lua:98 delegate\
At /engine/ui/Dialog.lua:657 mouseEvent\
At /engine/ui/Dialog.lua:399 fct\
At /engine/Mouse.lua:58 "

I didn't die actually. I was able to use a Wand of Noxious Cloud on the unit attacking me while I was confused. However, it gave this error, maybe because the unit was killed and the poison couldn't do any more damage:

error = "Lua Error: /engine/interface/GameTargeting.lua:119: /data/general/grids/all.lua:149: attempt to index global 'DamageType' (a nil 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 "

Also, there was a possessor on the previous level. Not sure what they can do to player characters, apart from possessing them and then the player losing the game.

Does failing to use a wand correctly result in you losing any turns? Because I don't think that's currently happening.

Now using Globe of Light doesn't even damage rotting corpses. Here's the error:

error = "Lua Error: /engine/interface/ActorTalents.lua:279: /engine/interface/ActorTalents.lua:256: /engine/interface/ActorTalents.lua:150: /data/general/grids/all.lua:417: attempt to index global 'DamageType' (a nil value)\
stack traceback:\
\9/data/general/grids/all.lua:417: in function 'change_for_dmgtype'\
\9/mod/class/Grid.lua:262: in function 'check'\
\9[string \"return function(self, x, y, what, ...) local ...\"]:1: in function 'checkAllEntities'\
\9/engine/interface/ActorProject.lua:211: in function 'project'\
\9/mod/spell-util.lua:1521: in function 'ball_spell'\
\9/data/talents/spell/fire.lua:72: in function </data/talents/spell/fire.lua:68>\
\9[C]: in function 'xpcall'\
\9/engine/interface/ActorTalents.lua:147: in function </engine/interface/ActorTalents.lua:140>\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/ActorTalents.lua:279 useTalent\
At /mod/class/Player.lua:640 useTalent\
At /engine/interface/PlayerHotkeys.lua:170 \
At /engine/interface/PlayerHotkeys.lua:162 activateHotkey\
At /mod/class/HotkeysIconsDisplay.lua:178 onMouse\
At /mod/class/Game.lua:1208 fct\
At /engine/Mouse.lua:58 "

My most recent save in case you need it:

https://www.dropbox.com/s/wnp7wu0t9eg3a ... 7.zip?dl=0

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

Re: Porting ToME2 to the T4 engine

#332 Post by Atarlost »

Zizzo wrote:[Oh, and I also just noticed that I hadn't yet implemented the NPC cause-wounds spells' chance of cursing equipment; that's now implemented. :twisted: ]
I don't remember ever having this happen. Are you sure there's supposed to be a curse chance for cause minor and not just the higher curses?
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: Porting ToME2 to the T4 engine

#333 Post by Steven Aus »

As well as the other stuff above, would it be possible to make an addon where you can throw harmful potions at enemies and/or use blessed water to uncurse items? I'm not asking you to do so, just wondering if it would be possible.

Also, another question and an issue:

Does Magic Device need to be levelled separately even if you have high level Sorcery?

I had both high level Sorcery and high level Magic Device skill, but the increased effect for having a certain proficiency didn't seem to be working, such as identifying all items in inventory and on the floor with one charge (and I would guess the second increased effect, identifying all items in inventory, floor and 1 square away from the character on the floor). I would guess any other bonuses for having high Magic Device skill might not work either.

Zizzo
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

#334 Post by Zizzo »

Steven Aus wrote:Well, I got a princess quest on Level 6 of the Barrow-downs, but when I won it didn't create the level down (although it did give me the reward).
[sound F/X: source diving] Ah, it's trying to remove the non-existent princess before it places the down stairs. I've put in a similar emergency stopgap for that, so it should work for now.
Steven Aus wrote:The rebinding (Alt-L instead of Ctrl-L) didn't work for my existing game.
No, I meant I'd rebound my keys, from the "Key Bindings" entry on the game menu. We Apologize for the Confusion.™
Steven Aus wrote:Here are some other errors:
[sound F/X: source diving] Huh. I thought Entity:loadList() was supposed to pre-load engine.DamageType. Oh well; that should be fixed now.
Steven Aus wrote:This is when I tried to pick up 2 Short Bows when my inventory already had 2 Short Bows which looked the same from what I knew about them. Also, I have got the following error at other times too when picking things up (most likely when there was something similar already in my inventory). I don't think I've had the error before the latest version of the module files.
[sound F/X: source diving] Ooh, a tricky one: turns out false and nil are not as interchangeable in Lua as one might think, because "nil ~= nil" evaluates to true. I think that's fixed now.
Steven Aus wrote:Just in case you need my log from my playthrough today for any additional information, here it is:
Okay, I just added a bunch of debugging log lines to the princess quest room generation; post your log file the next time you get a princess quest without a princess.
Steven Aus wrote:Btw: is there a weight limit for the inventory (I only have Strength 3)? I guess this is not implemented yet.
As you say. One of the many things on my priority queue… :oops: :wink:
Steven Aus wrote:When I encountered the princess quest on the level in the save below, I found the princess was a zombie giant salamander, stuck behind a wall. When I rescued the "princess" (after the save below) the wall disappeared but the zombie giant salamander remained, which I could kill. I think other times the princess square had no unit in it, although maybe another time there was a different unit there.
:shock: :shock: :shock: Okay, something is going seriously wrong here. You're using your persistent-levels addon for all of this, yes? Maybe I should do some testing with that…
Steven Aus wrote:Note: you can put more items in Home (nee Thieves Guild) then you have room for - it goes up to x (so 24 items), but any items you put in there afterwards are lost permanently.
:shock: I thought that was supposed to be checked for by the engine code. Let me look into that.
Steven Aus wrote:Interface bug: when you have two doors adjacent to you, you can't use "o" to try out a door until it's unlocked, you have to push the direction key one by one until it opens. I suggest that if you are next to two locked doors at the same time, you are asked to give a valid direction to a door to keep trying to unlock. Currently it gives an error message (just a regular one, not a lua one) when you are next to two doors and press "o".
That's odd; what you describe is what's supposed to happen. I'll check that one too.
Steven Aus wrote:Globe of light sometimes currently gives an error when hitting enemies - although mostly it still does damage even if it gives the error:
Yeah, that's the same error as above. Should be fixed now.
Steven Aus wrote:A very important balance issue: Globe of Light is not seeming to take any time to cast, which means you can keep using it until everything is dead, even if they are close. I don't think this is intended, or is it?
[sound F/X: source diving] Ah, so that's why you're supposed to return true from the talent's action() method… :oops: Should be fixed.
Steven Aus wrote:I quit the game before I died, but the last error I got was this, probably from a confusion causing monster. I wasn't carrying a weapon.
[sound F/X: source diving] Huh. That's supposed to be covered already. I'll need to investigate that.
Steven Aus wrote:Trying to use an identified Ranger Totem item that restores levels and stats (it's in my save right at the end of this post).
[sound F/X: source diving] Stupid typo in the restore-stat method; that would have affected anything that tried to restore stats. Should be fixed now.
Steven Aus wrote:I didn't die actually. I was able to use a Wand of Noxious Cloud on the unit attacking me while I was confused. However, it gave this error, maybe because the unit was killed and the poison couldn't do any more damage:
No, that's just another manifestation of the bug you were getting from Globe of Light above.
Steven Aus wrote:Also, there was a possessor on the previous level. Not sure what they can do to player characters, apart from possessing them and then the player losing the game.
You mean a Novice possessor (soul) or something similar? Those are supposed to be able to possess corpses left behind by monsters you've killed, effectively bringing them back to life. Needless to say, that's not implemented yet. :oops: :wink:
Steven Aus wrote:Does failing to use a wand correctly result in you losing any turns? Because I don't think that's currently happening.
I'm pretty sure it's supposed to. I'll check.
Steven Aus wrote:Now using Globe of Light doesn't even damage rotting corpses. Here's the error:
Yeah, same bug again. Presumably it's choking trying to apply damage to the grid before it can get around to damaging the monster.
Atarlost wrote:
Zizzo wrote:[Oh, and I also just noticed that I hadn't yet implemented the NPC cause-wounds spells' chance of cursing equipment; that's now implemented. :twisted: ]
I don't remember ever having this happen. Are you sure there's supposed to be a curse chance for cause minor and not just the higher curses?
Yep, 33% chance. Of course, that's if it actually hits upon an item in its random equipment pick, and it's picking from all the equipment slots, including empty ones, and including the placeholder ones used for Possession and Mimicry (so all six ring slots, for instance), so there's a decent chance it's just missing everything you're wielding. I make an effort to reproduce this logic in my implementation, as a courtesy to the player. :mrgreen:
Steven Aus wrote:As well as the other stuff above, would it be possible to make an addon where you can throw harmful potions at enemies and/or use blessed water to uncurse items? I'm not asking you to do so, just wondering if it would be possible.
Well, throwing potions is implemented in the original T2, and will also be in the module once I implement the 'throw' command. There's no such thing as "blessed water" in T2, though; you're thinking of NetHack. :wink: I'm sure it would be doable in an addon, though I'm not sure how I'd do it OTTOMH.
Steven Aus wrote:Does Magic Device need to be levelled separately even if you have high level Sorcery?
Sorcery doesn't affect your ability to use wands and staffs, if that's what you mean.
Steven Aus wrote:I had both high level Sorcery and high level Magic Device skill, but the increased effect for having a certain proficiency didn't seem to be working, such as identifying all items in inventory and on the floor with one charge (and I would guess the second increased effect, identifying all items in inventory, floor and 1 square away from the character on the floor). I would guess any other bonuses for having high Magic Device skill might not work either.
That probably just means I've implemented Magic-Device and/or wands/staffs wrong. :oops: I'll investigate.
"Blessed are the yeeks, for they shall inherit Arda..."

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: Porting ToME2 to the T4 engine

#335 Post by Steven Aus »

Thanks for all your work! My addon code that I've been using can be found at:

https://www.dropbox.com/s/o9canhiaaqy6n ... s.zip?dl=0

And yes, I know I was thinking of Nethack. Nethack did a lot of things right, after all, including having a function for nearly everything you could possibly try in real life. I don't expect that here, it's just that Nethack gives a lot of good ideas. :)

Also, a lot of things when they go in my inventory don't get tested for being cursed or blessed (if that's a state) because they have already been partially identified. There is a difference between Identify and *Identify*, isn't there, and also between the pseudo-identification skills?

And I take it that currently potions of one type is always a potion of that type, there is no blessed/neutral/cursed property on it?

I got to the princess room in Level 12 Barrow-downs, and died to a hammerhead shark. However even though the save has gone, the log should have the information you need if the princess quest didn't work properly.

https://www.dropbox.com/s/htbvjz700ygcp ... l.zip?dl=0

The character dump caused an error, but still produced the character text file.

error = "Lua Error: /mod/dialogs/CharacterSheet.lua:544: attempt to call field 'self_knowledge' (a nil value)\
At [C]:-1 self_knowledge\
At /mod/dialogs/CharacterSheet.lua:544 dump\
At /mod/dialogs/CharacterSheet.lua:113 on_input\
At /engine/KeyCommand.lua:71 receiveKey\
At /engine/ui/Dialog.lua:666 keyEvent\
At /engine/ui/Dialog.lua:401 "

Also, you can't push past Neutral units (you can push past allies, but not neutrals).

The Globe of Light still isn't working properly (although you may still be in the process of fixing it):

error = "Lua Error: /engine/interface/ActorTalents.lua:279: /engine/interface/ActorTalents.lua:256: /engine/interface/ActorTalents.lua:150: /data/general/grids/all.lua:123: attempt to index global 'DamageType' (a nil value)\
stack traceback:\
\9/data/general/grids/all.lua:123: in function 'change_for_dmgtype'\
\9/mod/class/Grid.lua:262: in function 'check'\
\9[string \"return function(self, x, y, what, ...) local ...\"]:1: in function 'checkAllEntities'\
\9/engine/interface/ActorProject.lua:211: in function 'project'\
\9/mod/spell-util.lua:1521: in function 'ball_spell'\
\9/data/talents/spell/fire.lua:77: in function </data/talents/spell/fire.lua:68>\
\9[C]: in function 'xpcall'\
\9/engine/interface/ActorTalents.lua:147: in function </engine/interface/ActorTalents.lua:140>\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/ActorTalents.lua:279 useTalent\
At /mod/class/Player.lua:640 useTalent\
At /engine/interface/PlayerHotkeys.lua:170 \
At /engine/interface/PlayerHotkeys.lua:162 activateHotkey\
At /mod/class/HotkeysIconsDisplay.lua:178 onMouse\
At /mod/class/Game.lua:1208 fct\
At /engine/Mouse.lua:58 "

Now you can access doors by pressing "o" and a direction, but you're not able to keep trying doors until you unlock them, which you can do when there is only one door next to you. So basically, if there is only one door next to you, "o" works to try it repeatedly until 100 turns have passed or you open it. But if there are two or more doors next to you "o" makes you choose a direction, but it only tries the door once.

Zizzo
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

#336 Post by Zizzo »

Steven Aus wrote:Also, a lot of things when they go in my inventory don't get tested for being cursed or blessed (if that's a state) because they have already been partially identified. There is a difference between Identify and *Identify*, isn't there, and also between the pseudo-identification skills?
I think this may just be terminology confusion. A Potion of Weakness, for instance, will pseudo-ID as {cursed} before it's been identified, but it's not cursed in the same way that, say, a sword can be cursed; it's just a bad potion that you don't want to drink.
Steven Aus wrote:And I take it that currently potions of one type is always a potion of that type, there is no blessed/neutral/cursed property on it?
That's right. Only wearable equipment has a meaningful cursed state, and that should be visible if it's been identified.
Steven Aus wrote:I got to the princess room in Level 12 Barrow-downs,
:shock: Um… the Barrow-downs is only supposed to go to level 10. Was there a princess quest on level 10, with a down stair in the quest room? Because the code's supposed to catch that.
Steven Aus wrote:and died to a hammerhead shark.
Was that the quest monster? Odd; it has the AQUATIC flag, so it shouldn't be able to move or be generated outside a water grid. Maybe I didn't implement that? I'll check.
Steven Aus wrote: However even though the save has gone, the log should have the information you need if the princess quest didn't work properly.
[reads log file] Well, that certainly wasn't the error I was expecting. It's falling afoul of the code that prevents unique NPCs from being generated more than once; it thinks the princess has already been generated and won't generate her again. I thought I was clearing that flag at the end of the quest, though… I'll investigate.
Steven Aus wrote:The character dump caused an error, but still produced the character text file.
[sound F/X: source diving] Hmm, apparently I changed my mind about what the spell.self_knowledge() method should be called between implementing it and using it… :? Fixed.
Steven Aus wrote:Also, you can't push past Neutral units (you can push past allies, but not neutrals
[sound F/X: source diving] Interestingly, it turns out that's what the original T2 code does too. I think I'll go ahead and allow pushing past neutrals for now, though, until and unless we run into someplace where that causes problems.
Steven Aus wrote:The Globe of Light still isn't working properly (although you may still be in the process of fixing it):
Hmm, that's still using old code. Might be the persistent-levels thing; if the old code is "baked into" the persisted door grid, it wouldn't notice the change in the new code.
Steven Aus wrote:Now you can access doors by pressing "o" and a direction,
[checks watch] …Wait a minute, I only just fixed that a couple hours ago. Are you a Time Lord or something? :?
"Blessed are the yeeks, for they shall inherit Arda..."

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: Porting ToME2 to the T4 engine

#337 Post by Steven Aus »

Maybe the princess being unique check clashes with the way persistentdungeons works?

No, I know potions can't be cursed. What I mean is, you can get Staffs that have Identify, and you can get more expensive staffs that have *Identify*. When I use the first kind, it is not fully identified (because it still gives the message about "You may need to identify this item to find more about it" or whatever). I haven't been able to afford the staff that mentions *Identify*.

I got aquatic monsters for a lost sword quest too, and they were able to move about normally.

I think you might have already done a fix for the door issue yesterday, or at least a partial one. Anyway, doesn't matter.

Note: you can walk on lava with no damage currently.

Also, I think I might have done game:changeLevel(11) on level 10, because this was before you implemented the check to make sure the down level appeared, and I didn't know that it didn't go past level 10.

Zizzo
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

#338 Post by Zizzo »

Steven Aus wrote:Maybe the princess being unique check clashes with the way persistentdungeons works?
No, that was my sloppiness; I wasn't properly clearing the "unique has been generated" flag for the princess when I removed her on quest completion. That should be fixed, but you'll need to start a new game for it, since all your current games will have her flagged as generated.
Steven Aus wrote:No, I know potions can't be cursed. What I mean is, you can get Staffs that have Identify, and you can get more expensive staffs that have *Identify*.
[checks notes] Um… no, Greater Identify isn't available on staffs. I assume you mean scrolls?
Steven Aus wrote:When I use the first kind, it is not fully identified (because it still gives the message about "You may need to identify this item to find more about it" or whatever). I haven't been able to afford the staff that mentions *Identify*.
Oh, okay, I see what you're aiming at. Generally, only wearable equipment will have flags that aren't revealed by a standard Identify. [At least I can't think of anything else OTTOMH that would need *Identify*'ing, though I'm sure our readers will remind me if I've forgotten something. :oops: :wink: ] And within that, with the possible exception of rings and amulets, you generally only need to *identify* ego or artifact equipment. …Wait, I take back part of that; rods with egos may need to be *identify*'d too.

Oh, and on the subject of staffs and identifying stuff:
Steven Aus wrote:I had both high level Sorcery and high level Magic Device skill, but the increased effect for having a certain proficiency didn't seem to be working, such as identifying all items in inventory and on the floor with one charge (and I would guess the second increased effect, identifying all items in inventory, floor and 1 square away from the character on the floor).
That probably had to do with the staff itself. You've no doubt seen that wands and staffs all have [M|N] numbers in their name. Those are described in more detail in my T2 spell spoiler, in the section on wands and staffs; for our purposes here, the second number is the maximum spell level you can get by using the wand/staff. So if you have a Staff of Identify [1|16], for instance, then the effective spell level of the staff will never get higher than 16, no matter how high your Magic-Device skill level is. You can see the effective spell level you're getting in the wand/staff's tooltip description. Generally the [M|N] numbers will be higher for wands and staffs found at deeper levels, so further down you'll likely find a Staff of Identify [1|17] or so that you'll want to hang onto.
Steven Aus wrote:I got aquatic monsters for a lost sword quest too, and they were able to move about normally.
Yeah, I've fleshed out the block_move() method further to catch that — and on top of that, the princess/lost-sword quest generation was already supposed to be filtering out aquatic monsters. :oops:
Steven Aus wrote:Note: you can walk on lava with no damage currently.
What?! That's one of the first things I– [sound F/X: source diving] …I …never actually implemented that, apparently. :oops: Let me think about what the right way to implement that is.
Steven Aus wrote:Also, I think I might have done game:changeLevel(11) on level 10, because this was before you implemented the check to make sure the down level appeared, and I didn't know that it didn't go past level 10.
Yeah, that occurred to me later. That makes sense, as Game:changeLevel() no doubt assumes that its caller has already done the necessary bounds checking.
"Blessed are the yeeks, for they shall inherit Arda..."

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: Porting ToME2 to the T4 engine

#339 Post by Steven Aus »

Yes, I meant some scrolls have *Identify*.

I've just realised, if you get a princess quest, and before finishing go to another level and get another princess quest, you might get the same error. Since unlike with the base game, when the persistentdungeons addon is activated the princess is not deleted and recreated as you change levels. Can you make the princess non-unique without her appearing as a monster that you have to kill somewhere?

I don't have any more bug reports or suggestions for the moment. What are you planning to implement soon, apart from damage from certain floors such as lava?

Zizzo
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

#340 Post by Zizzo »

Steven Aus wrote:I've just realised, if you get a princess quest, and before finishing go to another level and get another princess quest, you might get the same error. Since unlike with the base game, when the persistentdungeons addon is activated the princess is not deleted and recreated as you change levels. Can you make the princess non-unique without her appearing as a monster that you have to kill somewhere?
That problem had occurred to me too. The solution I'm going with for now is to use the 'force_unique' parameter of Zone:makeEntityByName() to force the princess to be generated even if the game thinks she shouldn't be.
Steven Aus wrote:I don't have any more bug reports or suggestions for the moment. What are you planning to implement soon, apart from damage from certain floors such as lava?
I was actually thinking of making another release soon. After that, I'll probably go back and finish up the map generation work I left back on trunk.
"Blessed are the yeeks, for they shall inherit Arda..."

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

Re: Porting ToME2 to the T4 engine

#341 Post by Atarlost »

Does the princess actually need a unique flag at all? She's only generated by the quest.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: Porting ToME2 to the T4 engine

#342 Post by Steven Aus »

There is an error with the version I just downloaded, every time I move I get an:

error = "Lua Error: /mod/class/Player.lua:335: attempt to index global 't_eff' (a nil value)\
At [C]:-1 __index\
At /mod/class/Player.lua:335 describeFloor\
At /mod/class/Player.lua:290 moveDir\
At /mod/class/Player.lua:279 moveDir\
At /mod/class/Game.lua:812 move_or_scroll\
At /mod/class/Game.lua:826 \
At /engine/KeyBind.lua:230 "

Not sure what happens when you run.

Zizzo
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

#343 Post by Zizzo »

Atarlost wrote:Does the princess actually need a unique flag at all? She's only generated by the quest.
(shrug) Possibly not, but she's flagged as unique in T2's r_info.txt, and modifying my Perl conversion script to change that on the fly would have been slightly more work than the solution I eventually went with.
Steven Aus wrote:There is an error with the version I just downloaded, every time I move I get an:
Yeah, I didn't think that would work out of the gate… [sound F/X: source diving] Mm, just a stupid typo. Should be fixed now.
"Blessed are the yeeks, for they shall inherit Arda..."

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: Porting ToME2 to the T4 engine

#344 Post by Steven Aus »

Thunderstrike doesn't cost mana or time, even though it is meant to cost 1 mana per level and time to cast. So in regards to time, it is like Globe of Light before it was fixed. However, if you "fail to concentrate properly" it takes time, so that bit is working. You might want to check the other Thunderlord-specific talents to make sure they are properly requiring mana and using time.

Is the reason why "Perfect casting" talent is not working because the robe counts as a failure chance? Or is Perfect casting not implemented yet?

Trying to drink an unidentified average potion:

error = "Lua Error: /mod/class/Player.lua:1219: /engine/interface/ActorTemporaryEffects.lua:116: attempt to index local 'p' (a nil value)\
At [C]:-1 \
At [C]:-1 error\
At /mod/class/Player.lua:1219 playerUseItem\
At /mod/dialogs/UseItemDialog.lua:69 use\
At /mod/dialogs/UseItemDialog.lua:45 fct\
At /engine/ui/List.lua:155 onUse\
At /engine/ui/List.lua:81 fct\
At /engine/Mouse.lua:58 receiveMouse\
At /engine/Mouse.lua:98 delegate\
At /engine/ui/Dialog.lua:657 mouseEvent\
At /engine/ui/Dialog.lua:399 fct\
At /engine/Mouse.lua:58 "

Trying to merge stun durations of Thunder Strike I think:

error = "Lua Error: /engine/interface/GameTargeting.lua:119: /engine/interface/ActorTalents.lua:150: /mod/util.lua:569: attempt to index local 'def' (a nil value)\
stack traceback:\
\9/mod/util.lua:569: in function 'merge_effect_duration'\
\9/data/timed_effects.lua:262: in function 'on_merge'\
\9/engine/interface/ActorTemporaryEffects.lua:124: in function 'setEffect'\
\9/data/damage_types.lua:1102: in function 'side_effects_pre'\
\9/data/damage_types.lua:182: in function 'projector'\
\9/engine/interface/ActorProject.lua:219: in function 'project'\
\9/mod/spell-util.lua:1555: in function 'beam_spell'\
\9/data/talents/player/race-class.lua:338: in function </data/talents/player/race-class.lua:334>\
\9[C]: in function 'xpcall'\
\9/engine/interface/ActorTalents.lua:147: in function </engine/interface/ActorTalents.lua:140>\
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:1196 fct\
At /engine/Mouse.lua:58 "

It's so hard to hit the starting monsters in Bree with arrows (apart from the really weak ones). The battle scarred veteran, mean-looking mercenary and agent of the black market are especially hard to hit. Even if they hit and you did 2 damage, it would be better than firing 6 or 8 or 10 arrows and missing all of them. Is this intended? Even though they are the tougher "no XP" characters, how are you supposed to clear your way around Bree if you can't hit them with arrows? And what is the use of arrows btw if the "to hit" chance drops a lot with further squares? The whole point with Archers (and to a lesser extent Rangers) is to be far away from the enemy.

When I tried to equip something onto a slot that was already full (in this case, a robe) the item that was previously in the slot was not put into inventory and was lost because of an error. Note: the item I equipped was actually a cursed item. Why does the princess give cursed items by the way, and how can the items still have useful traits or abilities if they are cursed?

Note: somehow the thieves removed the cursed item, even though we can't, at the start of the thieves' guild quest. :)

error = "Lua Error: /mod/class/Player.lua:1414: /engine/interface/ActorInventory.lua:115: attempt to index local 'inven' (a nil value)\
At [C]:-1 \
At [C]:-1 error\
At /mod/class/Player.lua:1414 doWear\
At /mod/dialogs/UseItemDialog.lua:113 use\
At /mod/dialogs/UseItemDialog.lua:45 fct\
At /engine/ui/List.lua:155 onUse\
At /engine/ui/List.lua:81 fct\
At /engine/Mouse.lua:58 receiveMouse\
At /engine/Mouse.lua:98 delegate\
At /engine/ui/Dialog.lua:657 mouseEvent\
At /engine/ui/Dialog.lua:399 fct\
At /engine/Mouse.lua:58 "

How do you use dark rifts or fountains? There is a fountain that says, "The liquid here seems magical."

When I took the up stair on Barrow Downs Level 2 to go back to Level 1, I appeared at the exit to Bree (Barrow Downs Level 1) instead of a down stair. Is this just a funny interaction with the base module and the add-on, and is there any way to alter that behaviour?

When running to the Black Market:

error = "Lua Error: /data/general/objects/rod-tips.lua:543: attempt to index global 'DamageType' (a nil value)\
At [C]:-1 __index\
At /data/general/objects/rod-tips.lua:543 getval\
At /mod/class/Object.lua:836 getDesc\
At /engine/dialogs/ShowStore.lua:129 generateList\
At /engine/dialogs/ShowStore.lua:59 init\
At /mod/dialogs/ShowStore.lua:45 init\
At /engine/class.lua:147 new\
At /mod/class/Store.lua:428 interact\
At /mod/resolvers.lua:39 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:286 move\
At /engine/interface/PlayerRun.lua:136 runStep\
At /mod/class/Player.lua:501 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 "

After that, when trying to visit the Black Market, even by walking (the other shops work fine):

error = "Lua Error: /data/general/objects/rod-tips.lua:543: attempt to index global 'DamageType' (a nil value)\
At [C]:-1 __index\
At /data/general/objects/rod-tips.lua:543 getval\
At /mod/class/Object.lua:836 getDesc\
At /engine/dialogs/ShowStore.lua:129 generateList\
At /engine/dialogs/ShowStore.lua:59 init\
At /mod/dialogs/ShowStore.lua:45 init\
At /engine/class.lua:147 new\
At /mod/class/Store.lua:428 interact\
At /mod/resolvers.lua:39 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:286 moveDir\
At /mod/class/Player.lua:279 moveDir\
At /mod/class/Game.lua:812 move_or_scroll\
At /mod/class/Game.lua:823 \
At /engine/KeyBind.lua:230 "

When trying to identify a named but unidentified book (btw: how do you "read" a book? by *Identify*ing it?)

error = "Lua Error: /engine/interface/ActorTalents.lua:996: /engine/interface/ActorInventory.lua:149: attempt to index local 'o' (a nil value)\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/ActorTalents.lua:996 unload\
At /engine/Game.lua:419 unregisterDialog\
At /mod/dialogs/ShowEquipInvenFloor.lua:74 use\
At /engine/dialogs/ShowEquipInven.lua:49 fct\
At /engine/ui/ListColumns.lua:463 onUse\
At /engine/ui/ListColumns.lua:135 fct\
At /engine/Mouse.lua:58 receiveMouse\
At /engine/Mouse.lua:98 delegate\
At /engine/ui/Dialog.lua:657 mouseEvent\
At /engine/ui/Dialog.lua:399 fct\
At /engine/Mouse.lua:58 "

Also when Smeagol did his steal gold trick he teleported to the same square that I was on.

This game, which worked fine before when I saved it, its new save is not working (note: I saved it on the down stair of a princess quest, but after I'd left the level and come back to it a couple of times):

https://www.dropbox.com/s/netoho17pzanz ... r.zip?dl=0

error = "Lua Error: /mod/class/Grid.lua:57: attempt to call field 'attrs' (a table value)\
At [C]:-1 attrs\
At /mod/class/Grid.lua:57 check\
At /engine/Grid.lua:43 setupMinimapInfo\
At /engine/Map.lua:491 updateMap\
At /mod/class/Map.lua:390 redisplay\
At /engine/Map.lua:391 loaded\
At /mod/class/Map.lua:32 loaded\
At /engine/Savefile.lua:552 delay\
At /engine/Module.lua:1050 instanciate\
At /engine/utils.lua:2221 showMainMenu\
At /engine/init.lua:165 \
At [C]:-1 dofile\
At /loader/init.lua:217 "

Zizzo
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

#345 Post by Zizzo »

Steven Aus wrote:Thunderstrike doesn't cost mana or time, even though it
is meant to cost 1 mana per level and time to cast.
[sound F/X: source diving] Ah, one last thing that was broken by my earlier ill-fated Thnder Strike fix. Should be fixed now.
Steven Aus wrote:Is the reason why "Perfect casting" talent is not working because the robe counts as a failure chance? Or is Perfect casting not implemented yet?
The Prefect Casting ability doesn't mean all spells get a zero fail chance; it just removes the minimum 5% fail chance, so that you can get a spell's fail chance to zero with sufficiently high INT and skill level.
Steven Aus wrote:Trying to drink an unidentified average potion:
[sound F/X: source diving] Could have been a Potion of Heroism or Berzerk Strength; both of those were missing the parameter table in :setEffect(). Fixed.
Steven Aus wrote:Trying to merge stun durations of Thunder Strike I think:
[sound F/X: source diving] You are correct. I also got that wrong in the Cut and Hasted effects. Fixed.
Steven Aus wrote:It's so hard to hit the starting monsters in Bree with arrows (apart from the really weak ones).
Didn't we touch on this before? [re-reads thread] Oh, right, we found that your attack power was unusually low, and I put in some debugging log messages to try to track down why. I've put in a few more log messages; try it again and send me a log file.
Steven Aus wrote:When I tried to equip something onto a slot that was already full (in this case, a robe) the item that was previously in the slot was not put into inventory and was lost because of an error.
Ulk, that stack trace doesn't really give any indication of what's breaking, unfortunately. So the item that got swapped out was not cursed, but the item you were wearing was? That may have something to do with it; I'll investigate.
Steven Aus wrote:Why does the princess give cursed items by the way,
:shock: She's not supposed to. I'll need to look into that.
Steven Aus wrote:Note: somehow the thieves removed the cursed item, even though we can't, at the start of the thieves' guild quest. :)
Hmm, I forget whether that's intended behavior; I'll need to check the T2 code.
Steven Aus wrote:How do you use dark rifts or fountains? There is a fountain that says, "The liquid here seems magical."
Fountains aren't implemented yet. On void jumpgates, use your change-level key (usually '>' or '<'); it should (I hope…) teleport you to the pair gate.
Steven Aus wrote:When I took the up stair on Barrow Downs Level 2 to go back to Level 1, I appeared at the exit to Bree (Barrow Downs Level 1) instead of a down stair. Is this just a funny interaction with the base module and the add-on, and is there any way to alter that behaviour?
You had a princess quest on level 1, I assume? So there were no down stairs when level 1 was created, and the princess quest stair wouldn't have been added to the list of "places to remember that there's a down stair" (since I wasn't expecting to need to), so the change-level code wouldn't have known there was a down stair it could put you on and would have used the up stair as a fallback. I'll have to dig around in the level-generation code to see how to get that information set up right.
Steven Aus wrote:When running to the Black Market:
[sound F/X: source diving] Mm, the problem is something in the Black Market's stock — in this case, it looks like a Rod Tip of Acid Balls, but it looks like all rod tips were broken [I can never keep track of when I can count on the engine to require() modules like DamageType for me and when I have to do it myself…]. That should be fixed for future rod tips, but the one currently in the Black Market has probably already been persisted with the broken code, so it'll be a problem until it cycles out of stock.
Steven Aus wrote:When trying to identify a named but unidentified book
…? Not sure how you could get one of those. [sound F/X: source diving] Hmm, AFAICT the error is happening in ActorInventory:addObject(), which isn't obviously connected; were you using a stack of Staffs of Identify, by any chance?
Steven Aus wrote:(btw: how do you "read" a book? by *Identify*ing it?)
There should be a "Browse spells" option in the use-item dialog for the book.
Steven Aus wrote:Also when Smeagol did his steal gold trick he teleported to the same square that I was on.
:shock: Well, that's certainly not supposed to happen. I'll investigate.
Steven Aus wrote:This game, which worked fine before when I saved it, its new save is not working (note: I saved it on the down stair of a princess quest, but after I'd left the level and come back to it a couple of times):
:shock: :shock: O-kay, that's something deep in the bowels of the map handling code that is apparently not getting reinitialized properly on reload. I'll investigate.
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply