Complete Mudlet Newb - Containers question

Post Reply
Nilats
Posts: 11
Joined: Mon Aug 03, 2020 1:16 am

Complete Mudlet Newb - Containers question

Post by Nilats »

I'm trying to migrate away from zmud to mudlet.

I'm trying to sidestep building from the ground up so I'm using a prebuilt script from another player that isn't around anymore.

I see in the script where the container sizes and placement are and how they are labled - but I cannot figure out how/where in the script each container is specifically drawing its information from. i.e. One container specifically shows the overland map as you move but I cant deduce how it's doing it. I'm trying to read thru the help files but its a bit overwhelming at first.

Any help is appreciated thanks!

User avatar
demonnic
Posts: 704
Joined: Sat Dec 05, 2009 3:19 pm

Re: Complete Mudlet Newb - Containers question

Post by demonnic »

Hard to say for sure without seeing the code honestly. But containers themselves don't generally display any information, they're a way to lay out and group other UI elements, such as miniconsoles, labels, etc. Then other code (triggers or event handlers usually) handles echoing the information onto those labels and miniconsoles for display.

There's one type of widget, the Mapper, which uses Mudlet's built in mapper and when combined with a mapping script will follow you around and allow pathfinding and the like, which could be how the overland map is being handled.

Nilats
Posts: 11
Joined: Mon Aug 03, 2020 1:16 am

Re: Complete Mudlet Newb - Containers question

Post by Nilats »

Well see I'm probably using the wrong term then! Not entirely sure how I'd upload a script - suppose I'd have to dropbox and create a link.

I'll add a pic maybe someone can clarify. The 3 smaller boxes on the right display:
(top) Group Status
(Middle) Map which would normally be displayed in the main screen but is defaulted somehow to this window
(bottom) Communications window

somehow i failed at using the insert image. here's the link to screen shot: Image

I guess for just sake of basic understanding on my part - those would just be called boxes?

Edited - by SlySven 2020/11/03T10:26UTC - insert image that OP could not...

User avatar
demonnic
Posts: 704
Joined: Sat Dec 05, 2009 3:19 pm

Re: Complete Mudlet Newb - Containers question

Post by demonnic »

Those are probably miniconsoles. There are probably triggers which have code in them that echo to those miniconsoles, and for the map probably deletes the output in the main window. You can do a search in the script editor for "echo" using the search bar on the bottom left (icon is a pair of binoculars) to help you find it.

Nilats
Posts: 11
Joined: Mon Aug 03, 2020 1:16 am

Re: Complete Mudlet Newb - Containers question

Post by Nilats »

OK so I found the miniconsoles and label boxes x/y etc. The middle console labeled map_label has a output display that is exceedingly small and I'm not sure if it can be enlarged as the miniconsole has plenty of height/width to it. Would the display output be based in the script area or trigger area? I copied the script and a screenshot of the actual trigger labeled mapcapture
Image

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
	<ScriptPackage>
		<Script isActive="yes" isFolder="no">
			<name>Boxes</name>
			<packageName></packageName>
			<script>-------------------------------------------------
--         Put your Lua functions here.        --
--                                             --
-- Note that you can also use external Scripts --
-------------------------------------------------

setConsoleBufferSize("main", 5000000, 1000)

setBorderBottom(24)

right_container = Geyser.Container:new({
  name = "right_container",   
  x="60%", y=0,                  
  width = "38%", height="100%",
})

chat_label = Geyser.Label:new({
  name = "chat_label",
  x = 0, y = "69%",
  width = "100%",
  height = "24%",
}, right_container)

map_label = Geyser.Label:new({
  name = "map_label",
  x = 0, y = "44%",
  width = "100%",
  height = "24%",
}, right_container)

group_label = Geyser.Label:new({
  name = "group_label",
  x = 0, y = "1%",
  width = "100%",
  height = "42%",
}, right_container)


chat_label:setStyleSheet([[
  background-color: rgba(0,0,0,0%);
  border-style: solid;
  border-width: 1px;
  border-color: purple;
  margin: 1px;
]])

map_label:setStyleSheet([[
  background-color: rgba(0,0,0,0%);
  border-style: solid;
  border-width: 1px;
  border-color: blue;
  margin: 1px;
]])

group_label:setStyleSheet([[
  background-color: rgba(0,0,0,0%);
  border-style: solid;
  border-width: 1px;
  border-color: green;
  margin: 1px;
]])


chat_box = Geyser.MiniConsole:new({
  name="chat_box",
  x="2%", y="3%",
  width="96%", height="54%",
}, chat_label)
chat_box:setWrap(72)
chat_box:setColor("black")

group_box = Geyser.MiniConsole:new({
  name="group_box",
  x="1%", y="2%",
  width="98%", height="%96",
}, group_label)
group_box:setColor("black")

map_box = Geyser.MiniConsole:new({
  name="map_box",
  x="1%", y="3%",
  width="98%", height="94%",
}, map_label)
map_box:setColor("black")

prompt_box = Geyser.MiniConsole:new({
  name="prompt_box",
  x=0, y="95%",
  width="60%", height="5%",
})
prompt_box:setColor("black")</script>
			<eventHandlerList />
		</Script>
	</ScriptPackage>
</MudletPackage>
Edited - by SlySven 2020/11/03T10:30UTC to include image directly and format code...

User avatar
demonnic
Posts: 704
Joined: Sat Dec 05, 2009 3:19 pm

Re: Complete Mudlet Newb - Containers question

Post by demonnic »

I believe the default font size for the miniconsoles is 8 or 9, you could try doing map_box:setFontSize(10) or higher and see if that makes it look better

Nilats
Posts: 11
Joined: Mon Aug 03, 2020 1:16 am

Re: Complete Mudlet Newb - Containers question

Post by Nilats »

Oh that was spot on. Thanks!

User avatar
demonnic
Posts: 704
Joined: Sat Dec 05, 2009 3:19 pm

Re: Complete Mudlet Newb - Containers question

Post by demonnic »

Glad I could help =)

Post Reply