ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Mon Oct 22, 2018 2:46 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Apr 11, 2018 4:21 am 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1566
Location: A shallow water area south of Bree
So, in my T2 module I occasionally have need of an NPC entity for a chat dialog that doesn't correspond to anything on the map — Liron from the Invasion of Gondolin quest, for instance. So far I've just been cobbling together Entities on the fly, like so:
Code:
local npc = Actor.new {
  name = [[Liron, rider of Tolan]],
  display = 'B',
  color = colors.C_U,
  image = 'npc/bronze_thunderlord.png',
}

but the results are aesthetically unsatisfying:
Attachment:
liron.png
liron.png [ 55.57 KiB | Viewed 430 times ]

Is there some magic I can do to this ad hoc Entity to give it a proper display like the player's? I'm eyeing Entity:makeMapObject() or something related thereto, but the comments on that method are adamant that I don't want to touch it, so I'm hesitant. :wink:

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Wed Apr 11, 2018 9:05 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10230
Location: Angolwen
And the comments are right, Entity:makeMapObject() should really be considered offlimits if you dont want stuff to explode in your face :)

As for your problem you mean to say the problem is that Liron is too small a letter ?
You can fix that by superloading dialogs.Chat:init and changing the ActorFrame initializations to pass in addition to their parameters:
Code:
tiles=game.level.map.tiles


That's because your level tiles is configured rather differently from the rest.

Ther superloading is not that great and at an addon level i'd scream bloody murder but at a mod level it's only jsut super fugly ;)
I'll tyr to think of a way to let you do that more easily in the future

_________________
[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 ;)


Top
 Profile  
 
PostPosted: Thu Apr 12, 2018 12:15 am 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1566
Location: A shallow water area south of Bree
darkgod wrote:
As for your problem you mean to say the problem is that Liron is too small a letter ?
You can fix that by superloading dialogs.Chat:init and changing the ActorFrame initializations to pass in addition to their parameters:

[sound F/X: source diving] Ah, okay, yeah, I think I know how to get that wedged in there. Thanks.

darkgod wrote:
That's because your level tiles is configured rather differently from the rest.

…? Am I doing it wrong?

darkgod wrote:
Ther superloading is not that great and at an addon level i'd scream bloody murder but at a mod level it's only jsut super fugly ;)

(shrug) No worries; I already had to do surgery on the chat dialog to get it to work with ActorTalents:talentDialog(). And you probably don't want to know what I've done to the Map… :twisted:

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Thu Apr 12, 2018 1:08 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10230
Location: Angolwen
Quote:
…? Am I doing it wrong?

Na :)

As for chat and talents, why ? It already works fine. Example in the rogue's artifices code:
Code:
   action = function(self, t)
      local chat = Chat.new("artifice", self, self, {player=self, slot=3, chat_tid=t.id, tool_ids=artifice_tool_tids})
      local d = chat:invoke()
      d.key:addBinds{ EXIT = function()
         game:unregisterDialog(d)
      end}
      local tool_id, m_id = self:talentDialog(d)
      artifice_tools_setup(self, t)
      self:updateModdableTile()
      return tool_id ~= nil -- only use energy/cooldown if a tool was prepared
   end,

_________________
[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 ;)


Top
 Profile  
 
PostPosted: Thu Apr 12, 2018 3:12 am 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1566
Location: A shallow water area south of Bree
darkgod wrote:
As for chat and talents, why ? It already works fine.

[sound F/X: source diving] Well, yeah, for a single-stage chat, I don't doubt it. When you get into chats with multiple jumps, though, like my "do-you-really-want-to-wear-the-One-Ring?" chat, the special unload() method gets lost unless you propagate it manually across Chat:regen().

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Thu Apr 12, 2018 7:51 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10230
Location: Angolwen
Ahhh yeah ;)

_________________
[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 ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group