#plugin-lua-and-fun
1 messages · Page 5 of 1
colors are a native json function (though european buildings plugin uses lua solely because of the implementation)
Ooo, wait soo i can technically colour them in json without using Lua?
yes
Wow, now i want to know how to do that :0
"colors" array on your animation drafts
hmm
Oh yea, what is nesting?
How and where can we use it?
Is it like "colors": [{r, g, b}], or is it something else?
That and as a hex "#FFFFFF"
Also this isnt really lua so we should maybe moooove the chat?
never actually used the rgba format outside of lua where it is strictly required
I recommend to use hex
You made me use that that one time i had to change opacity lmao, took me forever to learn that i can use hex
well hex doesn't record alpha values
Oooo, i see
emmmm
thank you for your insight 🙏
Is there a way to automatically close a City.showNotification without having to press the button?
And yep, I know that they close automatically after +- 4 months in game, but if there is a way to make them close earlier, much better.
you could write your own version of it
alternatively you can try to find out the id of the gui created by it
Ppunish 772714302284365825
artaaaaaaaaa was banned for the following reason: Sharing or spreading scams or phishing content.
@light plinth pidroid is kinda slow
Pping
Pong!
:stopwatch: 199ms
:heartbeat: 118ms
Works just fine
would disagree, he isnt catching the scam links anymore
whaat
oh so thats automod not doing its job, good to know
but punishment stuff was kinda slow and the tag command when i tried today
Bro please I have a question 🤔
The Vanilla IAP ufo works like your clouds plugin?
lol what
No, the clouds are just an overlay.
The ufo aren’t overlay?
POV:you’re a dictator 💀
where's the lua in that
thats my goal fr
I was just looking through TreeTool, and found the variables hoverX, hoverY, which are sort of not set anywhere. Are these really variables that are already in the game code?
isn't it in function script:draw(tx, ty, hoverX, hoverY)?
it will be local for the block on the function and in another script that function will be called with the real arguments/variables.
-- like script:draw
local function foo(a, b)
print(a, b)
end
do -- another script/code you can't see
local a = 10
local b = 42
foo(a, b)
end
-- print nil because a, b are not global vars.
print(a, b)```
hm
So, is there any ways i can get cursor's position?
yes, a simple way just declare the vars to be a local.
-- cursor position depends on the tile.
local mouseX = -1 -- declare invalid tile posts
local mouseY = -1
function script:draw(tx, ty, hx, hy)
if tx == hx and tx == ty then
mouseX = tx
mouseY = ty
-- actually you can call a function here
Drawing.setTile(tx, ty, 16, -32)
Drawing.drawText("Mouse was here", 0, 0, nil, 0.5, 0.5)
end
end```
how i can use in-game frames with drawImage (frame, x, y)? (like night frames ot like them)
you can fetch the draft with Draft.getDraft
then use the various getFrames functions
for night frames, you have to get it's night animation
uuuuh
how do i get nightAnimation draft?
on closer inspection
i dont see a way to retrieve it from a draft itself
unless you were to use unsupported functionality
but i dont support it
doesnt look possible to me
if EVENT_PLACED == Script.EVENT_PLACED then
(blame yourself for naming the parameter like that)
also
script:event, not script.event
function script:event (x, y, level, event, source)
if event == Script.EVENT_PLACED then
Debug.toast("building")
end
end
can i call its without x, y?
the function signature is wrong
it has to be script:event (x, y, level, event, source)
restart the game
still
is that the entire file?
function script:event (x, y, level, event, source)
if event == Script.EVENT_PLACED then
Debug.toast("building")
end
end```
init?
put it under the function
still
if im put it in script:init
if under the function, #plugin-lua-and-fun message
show the entire code
init is game start
you can't use the tile module if there are no tiles to begin with
enterCity?
what is even the point of that function?
- init is called during game boot up, Tile library will not be accessible at that point in time
- you are assigning the result of the entire tile.getBuild... to a global building variable, set it to a local one instead
- if there's no building at the tile 1x1, the getDraft call will fail
please read these before:
https://doc.theotown.com/topics/00-intro.md.html
also luawrapper loses certain error reporting capabilities
btw, the topics nav is gone. lol
Cool
i dont need that draft for now, so then i can just put it in function itself
even at this variant, i dont see any signs of EVENT_PLACED work
did you actually attach it to a building
It's emitted for the script owner draft
if source == building then
or
source = building?
???????????
in your json
"script"
you want to attach it to the building that you want to use that script
so source = json's building?
as with all things in this game
so why its dont work then?
oh nevermind
its working
only for building in json, so it supposed to
god, this is such a nice thing
...i need help.
yea
i want to get every coordinate spot between two places, but idk how to
(i dont want to use just a bunch of ifs)
starter coords wrote to an array by placing building
did this variant. Broken(
function script:event (x, y, level, event, source)
if event == Script.EVENT_PLACED then
local draft = Tile.getBuildingDraft (x, y)
local xCords = Array()
local yCords = Array()
if a[4] == nil then
a:add(x)
a:add(y)
else
a:removeAt(1)
a:removeAt(1)
a:add(x)
a:add(y)
end
if x>=a[1] then
for i = 1, math.abs(x-a[1]) do
x=x-1
xCords:add(x)
end
else
for i = 1, math.abs(a[1]-x) do
a[1]=a[1]-1
xCords:add(a[1])
end
end
if y>=a[2] then
for i = 1, math.abs(y-a[2]) do
y=y-1
yCords:add(y)
end
else
for i = 1, math.abs(a[2]-y) do
a[2]=a[2]-1
yCords:add(a[2])
end
end
if #xCords>#yCords then
for i = 1, #xCords - #yCords do
yCords:add(yCords[#yCords])
end
elseif #xCords<#yCords then
for i = 1, #yCords - #xCords do
xCords:add(xCords[#xCords])
end
end
for i = 1, #xCords do
Builder.buildBuilding(draft, xCords[i], yCords[i])
end
Debug.toast(tostring(a))
end
end```
is there any issues?
well first of all
what is the intended goal
mine would be to flip the if and return first
saves an indent
and i think you might be able to use this function
nah
this thing uses rectangle, so i need a line
what kind of line
you should be able to use for loops to simplify this
this looks more complex than it has to be
we have two points, I want to try to get a line with a right angle between them.
Basically, I can rewrite the code to first define a point perpendicular to both of the original points and work from that point
isnt for is a loop?
I need to save two positions at once, provided that x and y change after each new building
isnt array is a single possible way for it?
lets see
you can definitely use a local or something
so if i understand this correctly
like
what exactly is it doing
i mean
whats the end goal
other than building a building some distance away from the original
to earn array that contains all coordinate point between two first coords
and this #plugin-lua-and-fun message
I'll figure out what to do with the coordinates I get
oh and yes
in future i should add function that cleans an array on building destroy
a array*
uhm
oh crap, how i see, i cant test coords on this building, because function calls multiple times
whats the second coordinate
its already done i think
it could still be simpler
sounds scary
i mean, if you ever need to change it again and forgot how it worked
hm
why script dont work without LuaWrapper
uuuuh
its working, but not for script event
wait what
oh i found the problem
¯_(ツ)_/¯
How to prevent the standard tile information from appearing when using script:click?
simply return false
(its in the description)
thanks
but theres another problem
I need to use drawing after clicking on a building, however drawing requires script:update, which introduces the function into a loop. What can I do about this?
create a gui canvas that spans the screen
and use it's ondraw function
will Drawing.setTile work with it?
and
how to create full-size cansav
canvas
error by script:update
goody ah code for now, but i didnt even tried to make it normal
cords - array containing coordinates of all buildings of the given draft on the map
i should make it cloud-based in the future.
that wont work
script:update only works outside other functions
and it will be called every time
so
its works
but very strange
like bug-loop
uhm
in that way
what can I replace it with?
how about getBuildingDrawXY (x, y)
i still dont know what you want to achieve
lemme explain for a bit
I moved the function from event EVENT_PLACED to click, I want to when click on a building an image will appear above all buildings in the same draft to notify you of their location. The drawing is what is causing me problems.
make a bool that gets flipped when you tap the building
then check if its true in script:draw
Before I get started, I really need to know how I can display -1 level of building height with a script?
use Draft:getBuildHeight if that's what you mean
I mean camera
Like
Make player see tunnels
._.
it could be possible but youre going to have to do some digging
not like literally
you can use draftDrawers to enter tool drafts (this is undocumented)
if you can get the tool for showing tunnels and enter it it could work
but it requires research i havent done
uhm
It’s worth admitting that I still won’t be able to realize what I wanted due to some limitations
So
Out of curiosity, do I have the ability to change json-files using lua?
you can generate drafts on startup but you cannot change existing ones
Hm
Can i at least change their parameters?
Like price etc
no
depends
wdym
Why ping him for that?
I think he has an idea of that someone?
hm
for something like that it probably isnt really possible
if you do create a fullscreen canvas there would not really be a way to get the building's drawing locations
that would work
but it might not inside the canvas
youre probably better off using something like script:draw or script:drawCity
i dont know if getting the drawing pivot will work in that function
youd have to test
right so you can get the root gui object with GUI.GetRoot
then youll be able to get it's width and height
and create a canvas of that size in it
rip the homie
Im there
whats select()? i cant find normal answer
dunno, never used it
huh
why this thing returns error
but this works
wth
what wrong with this one
the only one who dont work
i found thing that returns screen's width and height
i think i can use it for create canvas
getDrawXY is probably just a shorthand of a few drawing functions
i geuss its not on the top level of the gui then
also
why not just use script:overlay
or script:drawcity
i dont need it over gui
then drawCity
oh hell
night
its over gui and i cant make it transparent
i cant click through it
yse the settouchthrough function in it
also yea
it will be over gui
thats what it do
if you want under gui you have to use drawcity
huh?
hoow
i absolutely cant understand how GUI scripting works
you can draw directly but it wont be gui
wdym draw directly?
sounds like you need to rewrite it
The problem is that I only need to call draw in a certain case, but it uses script:update
and i dont see any other way to draw it
for executes too fast
because drawing in script:update isnt allowed
you must do your drawing for each frame in draw or drawcity
these functions run once per frame
if you dont always need to draw in the function, just return early
return ends the function
nothing after it will be executed
so just put an if at the start
and return if you dont want to draw
How doesDrawing.setScale() work? Why it isnt increase scale at all?
5
but it still 0.25 by some reason
how do you use it?
i found a problem
setScale() dont work with setTile() for some reason
can i fix that?
maybe if you try setting it after settile
idk
this hasnt really been an issue for me
wait
i found
how i can manage layer of drawing
ok nvm I've simulated the effect of a layer
...or not
which event function are you using
either way the drawings will always appear in the ordere you drew them
so drawn last is on top
thanks
it used to work with LuaWrapper, but when i deleted it, script:drawCity() not executing. What the problem?
because thats not where its supposed to be
youre only allowed to do it like this
function script:event()
....
end
function script:drawCity()
....
end
how your code worked in the first place is a mystery to me
it actually working with wrapper
hm
is there ways i can replace this structure?
ok i did it
How can rotation awareness be created using the cityRotation feature with Fun? Could you share an example code?
What do you mean by creation of rotation awareness?
why on earth would you need lua for rotation aware stuff
I need a rotation aware decal. Actually, I'm not sure it will work. But I want to try.
decal? like ground?
sounds like pain
So it's not possible?
I don't really see the point
Ground drafts are very simple objects, they don't even support animations
One idea might be to set a different frame when city rotation gets changed
This is right?
function script:init()
jet = Draft.getDraft("$")
mis = Draft.getDraft("$")
sound = Draft.getDraft("$")
explosion = Draft.getDraft("$")
end
function script:event (x, y, level, event, source)
if event == Script.EVENT_PLACED then
local i = 0
local c = 0
end
function script:drawCity()
if i < 150 then
Drawing.setTile(x,y-75+i*2)
Drawing.drawImage(jet:getFrame(City.getRotation()+1), 0, -120)
Drawing.setTile(x,y-150+i)
Drawing.drawImage(mis:getFrame(City.getRotation()+1), 0, -77+i/2)
i=i+1
if c <= 70 then
Drawing.setTile(x, y, -23, -32, 5, 5)
Drawing.drawImage(explosion:getFrame(1))
Builder.remove(1,1)
Builder.remove(-1,-1)
City.playSound (sound, x, y, 10)
c=c+1
end
right for what
theotown server members trying to ask comprehensible questions moment
function script:init()
jet = Draft.getDraft("$jet00")
mis = Draft.getDraft("$missle_nuc00")
end
function script:event (x, y, level, event, source)
if event == Script.EVENT_PLACED then
local i = 0
function script:drawCity()
if i < 150 then
Drawing.setTile(x,y-75+i*2)
Drawing.drawImage(jet, 0, -120)
Drawing.setTile(x,y-150+i)
Drawing.drawImage(mis, 0, -75+i/2)
i=i+1
elseif i == 150 then
City.issueDisaster(City.DISASTER_NUKE, x, y, 15, false)
else
return
end
end
I mean for this
Recreate it please 🙏
@stoic vector bro you know, if i dont answer you in DMs, its not mean i wont give you answer at all

How can i hide/delete button when it pressed? i tried this thing, but it dont work
local button = root:addButton{
icon = Icon.CANCEL,
text = 'Test',
width = 100,
height = 100,
frameDefault = NinePatch.BLUE_BUTTON,
frameDown = NinePatch.BLUE_BUTTON_PRESSED,
onClick = function()
button:setVisible(false)
button:setTouchThrough(true)
end
}```
oh
i deleted local, and it worked
Is it possible to turn on/off shader by Lua?
you can modify the settings but you really shouldn't
alternatively you can set parameters the shader can read
Why the code is getting crazy
function script:init()
local jet = Draft.getDraft("$jet00")
local mis = Draft.getDraft("$missle_nuc00")
end
function script:draw(tilex, tiley)
local time = City.getTime()
Drawing.setTile(tilex, tiley, 0, -75)
Drawing.drawImage(jet:getFrame (1))
end
function script:draw(tilex, tiley)
local time = City.getTime()
Drawing.setTile(tilex, tiley, 0, -75)
Drawing.drawImage(mis:getFrame (1))
end
I want just to put a frame in the coordinate
you cant just create two script:draw
only one
😉
function script:init()
local jet = Draft.getDraft("$jet00")
local mis = Draft.getDraft("$missle_nuc00")
end
function script:draw(tilex, tiley)
local time = City.getTime()
Drawing.setTile(tilex, tiley, 0, -75)
Drawing.drawImage(jet:getFrame (1))
Drawing.setTile(tilex, tiley, 0, -75)
Drawing.drawImage(mis:getFrame (1))
end
Hahaha 😂
Every time gets more speed until my device explode 💥
Maybe this code makes that message get more speed 😂
Keep doing the same thing and even faster 😂
you have to declare local jet and mis outside of init
and assign the values inside it
jet and mis are not accessible in the other method right now
you can call the arguments however you want
and the 3rd argument will be discarded automatically
its a lua feature
oh i forgot
...and didnt noticed local inside a function
@stoic vector remove local from script:init
So I can keep the () empty?
In all the functions
if you keep () empty, tilex and tiley will be not defined
or you think its made only for joke
I mean the others attributes I will not use
you can
yea but you wont get the arguments
but yea
by all means
define script:draw()
if you only need the 3rd you can do function(_, _, var)
Better I keep it 😅
Still nothing 😢
function script:init()
jet = Draft.getDraft("$jet00")
mis = Draft.getDraft("$missle_nuc00")
end
function script:draw(x,y,level)
local time = City.getTime()
Drawing.setTile(tilex, tiley, 0, -75)
Drawing.drawImage(jet:getFrame (1))
Drawing.setTile(tilex, tiley, 0, -75)
Drawing.drawImage(mis:getFrame (1))
end
The code will get revenge against me
tilex -> x
tiley -> y
not required
you should still declare jet and mis with local
also
you renamed tilex and tiley, but not when you use them
Is there any way to add a delay before part of code execution?
yep, use runtime.postpone
saw that, but it dont work properly for forEach
maybe i should replace it
if you want time based animations
youll need to get the runtime every draw or updafe
then get the difference between the current time and the last updates time
No,no, i need a delay between forEach in Util.collectFullRectTiles
yep
not possible
in the direct way
youll need to work with delta time
blocking the foreach means the game will not update
so you cannot wait in the function
so what if i replace forEach with, for example, for?
nope
youll have to think differently
youll have to check the time every run of update
and if enough time has passed
handle the next tile
oh my god
maybe i can bind it to script:drawCity or script:update, to make them work like a timer?
ok i cant
i have small problem about drawing
when you leave the city, game does photo of the map, with current overlay
and it looks strange
I dont know if thats what i'm about to say but that problem sometimes happens to me on regions. One part of the region that i put on night stay in night and the rest is on day
I mean
If the game does this photo before closing the city, theres might be way to disable drawing at this moment
If no...
Then there's nothing to be done :/
there is not
😅👍
Even this 12 lines doesn’t work
function script:init()
local jet = Draft.getDraft("$jet")
local mis = Draft.getDraft("$mis")
end
function script:draw()
Drawing.setTile(x,y-75)
Drawing.drawImage(jet)
Drawing.setTile(x,y-150)
Drawing.drawImage(mis)
end
They keep spamming the text “error in line?”
Even more hard ☺️
Delete locals in init
Bro can you finally read lua basics
Third day learning lua 😉
The same thing
Give me code
function script:init()
jet = Draft.getDraft("$jet")
mis = Draft.getDraft("$mis")
end
function script:draw()
Drawing.setTile(x,y-75)
Drawing.drawImage(jet)
Drawing.setTile(x,y-150)
Drawing.drawImage(mis)
end
Why you use event instead of draw?
what.
where
function script:event (x, y, level, event, source)
if event == Script.EVENT_PLACED then
local i = 0
So you mechanism works like
You set a far tile when the plane appears and working with the clock reach the main tile?
what
Drawing.setTile(x,y-150+i)
im getting x and y of tile by script:event, then i start counter and drawing things, focusing on x and y
Then what means this x and y?
😂
function script:init()
jet = Draft.getDraft("$jet")
mis = Draft.getDraft("$mis")
end
function script:event(x,y,level,event,source)
if event == Script.EVENT_PLACED then
local i = 0
end
function script:drawCity(x,y,level)
if i <= 150 then
Drawing.setTile(x,y-75+i*2)
Drawing.drawImage(jet:getFrame(City.getRotation()+1),0,-120)
Drawing.setTile(x,y-150+i)
Drawing.drawImage(mis:getFrame(City.getRotation()+1),0,-77+i/2)
i=i+1
elseif i >= 150 then
City.issueDisaster(City.DISASTER_NUKE,x,y,15,false)
end
end
end
💀
Why I have to close functions if I write if then or else?
Link please 🙏
to be fair, the official lua documentation is hot garbage
Real
What’s this means
function script:init()
jet = Draft.getDraft("$jet")
mis = Draft.getDraft("$mis")
end
function script:event (x,y,level, event,source)
if event == Script.EVENT_PLACED then
i = 0
end
end
function script:drawCity(x,y,level)
if i < 150 then
i=i+1
Drawing.setTile(1,y-75+i*2)
Drawing.drawImage(jet:getFrame(City.getRotation()+1),0,-120)
Drawing.setTile(1,y-150+i)
Drawing.drawImage(mis:getFrame(City.getRotation()+1),0,-77+i/2)
end
end
elseif i >= 150 then
i=i+1
City.issueDisaster(City.DISASTER_NUKE,x,y,15,false)
end
end
h m m
sigh
jet = Draft.getDraft("$jet")
mis = Draft.getDraft("$mis")
end
function script:event (x,y,level, event,source)
if event == Script.EVENT_PLACED then
i = 0
end
end
function script:drawCity(x,y,level)
if i < 150 then
i=i+1
Drawing.setTile(1,y-75+i*2)
Drawing.drawImage(jet:getFrame(City.getRotation()+1),0,-120)
Drawing.setTile(1,y-150+i)
Drawing.drawImage(mis:getFrame(City.getRotation()+1),0,-77+i/2)
elseif i == 150 then
i=i+1
City.issueDisaster(City.DISASTER_NUKE,x,y,15,false)
end
end```
your syntax is completely wrong
try finding a proper ide that supports lua
also you should put a local jet, mis at the top of the file
even this
https://rextester.com/l/lua
What this link does?
._.
Brooooooooo
Click and see.
IA lua fixer
Yes
Ita a freaking compiler
You put your code and show the bugs and fix
Try it
🥹🥹
We are useless like always
IA always kick our ….
😂
The AI revenge against me
She nuke my city 💀
Now the code launch the nuke but the aircraft doesn’t appear
function script:init()
jet = Draft.getDraft("$jet")
mis = Draft.getDraft("$mis")
end
function script:event (x,y,level, event,source)
if event == Script.EVENT_PLACED then
i = 0
end
end
function script:drawCity(x,y,level)
if i < 150 then
i=i+1
Drawing.setTile(1,y-75+i*2)
Drawing.drawImage(jet:getFrame(City.getRotation()+1),0,-120)
Drawing.setTile(1,y-150+i)
Drawing.drawImage(mis:getFrame(City.getRotation()+1),0,-77+i/2)
elseif i == 150 then
i=i +1
City.issueDisaster(City.DISASTER_NUKE,x,y,15,false)
end
end
my brother in christ
youre issueing the nuke disaster every frame
do you even read the code
some people just shouldn't code lol
the aircraft appears, your math is just completely fwrong
What I could change?
probably not nuke the city hundreds of times per second
youre gonna have to start at the basics man
this cant just be fixed with 1 or 2 lines
the code is simply completely wrong
i asked him for learn basics for like 4 times
he just dont want or understand i cant get
can we remove this person from the channel lol
and indents....
it is
but people keep using this channel for your regular json mishups
because it is
only person who uses fun who i know is 『 Ƶ 』
and even him decided to learn Lua ._.
i tried to use fun once, but no one knew how to excecute it
fun sounds like scripting for lazy people
lazy in fact they dont want to learn programming
fun is apparently faster than lua
faster in which way?
we have
function script:update()
for i = 1, c do
c = c+1
end
end
i mean it could but not much
i think this thing will kill the game
lol what do you think that code snippet is supposed to do
calculate infinity)
yup that seems like exactly what it will do
what is i
please leave
😭
the server? 
You may leave the conversation to read this https://www.lua.org/pil/4.3.4.html
oh so basically the variable
variable that denotes the number of times the loop will be executed and at what increments
alright but peep ```lua
c = 2
function script:update()
for i = 1, c do
c = c+1
end
end
how?
```lua
oh
works with most languages and json
local wow
still cool
Guys did you have any idea where to start lua programming
That isnt lua, try asking in #town-square
Lua language is easy to understand
Real
hello
i created this moon frame using Drawing.setTile() and Drawing.drawImage()
Is there any way to make it obscured by the buildings in front of it?
I tried the functions in the lua api but it doesn't seem to work.
draw it on the northernmost tile
thank you, but sadly it doesn't work. the moon covers the building even when the building is at the southernmost tile
oh in the second picture i just tried to make the sun :v
nice for a sun yea
Size plugin block? ?×?
322 pixel
Is the plugin available now?
Name plugin
no, it is still under development
So i like your plugin (katori)
unfortunately i know of a way to get it behind the building
(without major limitations)
can you please suggest to me ?
thank you very much 😄
sorry i misspelled
i meant to say i dont
technically, you can put a building on the topmost corner of the city and use it's draw function
but it wont render if that square is out of view
and of course the tile will be occupied
yeah, i used this way at first too, but since it didn't render the frame when out of view, i changed the way
nothing asking lobby cant fix
maybe it could be justified as a way of drawing things on the background
Help me i have error
what is the error
lua is a programming language that can be used for plugins, fun is a logic system built into the draft system of the game
logic system, no one seems lo like logics then
ohh
lua is showing up everywhere these past few weeks
Lua is very simple and easy to use, it was also used on roblox studio and minetest
and it's compatiable with C!
or java!
is it possible to use I/O library in script? Im trying to work with it, but script keep giving me an error
theotown specifically removes the standard IO library
._.
then, i guess, i cant use it?
even if i require it
How can i work with files then?
You can't
why would you ever need to manipulate files
i just want to copy city's file
i cant fing this opportunity in API, so i guess its not possible with API
so i tried to I/O
so theres no way to do it i think??
Not one that is supported through the Lua API
Dont got you
So its possible or not?
Exporting images would be neat but I understand why it's forbidden
Delete System32.
imagine this
If they implemented it it would be reasonable to block directories outside of theotown
But still it'd be dangerous
We didn't feel like sandboxing dangerous IO library functions so we removed the entire library altogether
Hm, then can i ask for opportunity to create cities? (if it not possible)
Well, there's a https://doc.theotown.com/modules/TheoTown.html#loadCity
no i mean new city
or atleast ability to copy city's file
The Lua API does not provide a way to do so.
i hope theres any chance to get it added in future. Ill just ask in suggestions channel for it for now
thanks for help btw
The better question is why is that needed
advanced generator provided by plugin?
there was a BiomeMaker module in API, but it was empty
city copying ability can replace that
not at all, but can
advanced generator?
manual city's generation? Like that which provided on photo, but created manually
or for what BiomeMaker was created
...and then deleted...
BiomeMaker was a tool made by Hadestia that showed up as a Lua library
Showed? It was just an empty category
Okay thats not what i though
like the one by jeremiah?
So whats about city's copying? Idk, seems like really cool feature
Region creation? I have no idea how it works
not the answer
i didnt saw any thing thta allow you to create new region
city too
his works like that
like what
aaaaand
oh hmm
Again, I don't see a use case for copying maps when game already provides such functionality through the UI
manually. I just ask for ability to do it though script
Using that, i can, for example, create a city with flat grass land and then use it as template, which will be copied, loaded though City.load or TheoTown.loadCity, rebuilded with, for example, some ground and buildings
here you come with newly automatically generated city
for what i want use it to? Maybe even automatical procedural generation
which sounds very cool
some starbound stuff but in theotown
eh
@cedar panther please keep images here on topic
How to make a Very Large city
I guess its wrong place to ask it
Incorrect place to ask that,but you can use the in game console to make a larger city or region. But remember, don't make one that's too large for your device which may cause the game to crash.
:(
you hasnt got new free reddit feature?
:shocked_face_emoji:
Nuh uh
.
Why my code json cannot read fun atribute
So i want give a sound, nah but didnt works
whats your code look like
looks like ja has it under control
Ppunish 874001522520887326
wmatt was banned for the following reason: Sharing or spreading scams or phishing content.
slap a ppurge 874001522520887326
pidroid will delete their messages when you ban them
You see, pidroid sometimes deletes messages of users and sometimes doesnt, its like playing roulette
The first and only time I tired that I nuked half of #general
youre mistaken, it was #games
You see, in my advanced age, I simply forgot.
😰
How to remove please
remove the plugin
i think it was a plugin by kingtut?
i have 0 idea what the actual plugin is
I want to ask where is the age of sail file? I want to download it
friendly reminder this is not the channel to ask for plugins
It's not available for downloads anymore and it is not to be shared
I think it's called like invisible tress or something but it has really bad reviews
I remember I had it like 2 years most annoying them ever they would take up space and I couldn't delete them
lol
age of sail is currently not functional, it will not work
@trim remnant
sorry for ping then, i guess
I think evan typically goes to sleep 2 hours ago
its 1 pm here, its hard to count it for me correctly
Well just consider that evan is 12 hours away from you
It's actually less
guess which pluginS
yesss
Ok
🔥😎
Yeah
Ok
Can’t wait
Hey,just quick question. How can i make this work,as i just want user to open a YouTube video on how to use it.
function script:finishInformationDialog(x, y, _, dialog)
dialog.controls:getLastPart():addButton{
icon = Icon.TREE,
text = 'Select trees (X)',
width = 0, -- Adjust button size to content
onClick = function(self)
System.openUrl("https://example.com") -- Replace with the desired URL
end
}
end
First of all
System is not a library
Secondly, it's probably from Runtime library and requires privileged access
So use Runtime instead of System ?
Check API and find a function made for external links
How can i get a value from player's clipboard?
pretty sure you cannot
Then can i at least ask you to add a Runtime.setClipboard() to the LUA API's page? It's weird that you have to go into the code of DevTools to find this
What the fork is dis plugin, i didnt Loaded it Jist appeard randomly on my game
it really isnt helpful if we cant even see the building
Lmao 🤣🤣😎
I’m curious 🧐
my brother in christ there already is a picture
Lol I noticed now 😂😂
Pmodmenu 821968668777906228
alambri21 was banned for the following reason: Sharing or spreading scams or phishing content.
setup pidroid to auto ban anyone that messages here
WOW
@zinc isle
@zinc isle
Ppunish 1056613323031969923
edisonwu. was banned for the following reason: Sharing or spreading scams or phishing content.
nawwwh my steam gift
the 2 pings informed of its urgency lol
can we auto ban anyone who posts here
We do lmao
There's just an infinite number of ways that people can make those links
The vast majority of them get caught but you can't stop them all
Ahh I see
Using many tricks to fool the system
Ban the word steam lmao
Well see this game is sold on steam so that would hurt us xD
People looking to steal from people will always find ways to keep trying
Removing this cuz folks can see the link lol and i dont want anyone fall for them phishing links 🫠
Unless its an example but eh better to remove it to avoid risks
Can someone teach me lua
no

i can answer questions but i cant give you a live walkthrough
Is there any life on other planets
Yes
Reply hazy, try again
English or Spanish
Spanich
english or spanich?
Spanich
Ok
Pmodmenu 674720861940350983
davizck was banned for the following reason: You shouldn't have! (Phishing)
quick question about plugin making. For the diagonal asphalt plugin, could i take a png from the data within the game files? (i forget what it's called, but ive been here before, it has all the frames for plugins and such stored) and code it up into a json but give it winter frames? ik the original plugin doesnt have them, and it looks kinda funky, i wanna do this but i just wanna know if it would work lol
yep, you can do that. But they will be a seperate road from the game's road
you wont be able to change the road in the game directly but you can copy it
ohh kk, thx !
you actually can, using frame steal or smth
i cant remember, but that too much water guy did it
no wait ross did it
he replaced the default water with some ugly water
so you cannn
i forgot about that, you probably wont be able to add the winter frames with that though
might be able to
i found this template for making a road plugin, i just wanna know if it's the correct format to follow lol
you can also find the game's json for the road on the forum
Yo bro,how i can find the link to download Plugin Age of sail?
who is the bro here?
you cant download it
🙂
age of sail cant be downloaded right now
@zinc isle
Ppunish 663702178921185280
gameovers_ was banned for the following reason: Sharing or spreading scams or phishing content.
Thanks, for a moment I thought you posted the link and self reported and got so confused
;)
@potent jolt
whats up
Wsg
Hellow sir i want chat with you
@spring tree I'd really appreciate it if A) You stayed on topic. B) Didn't ping random members just to chat in this channel. C) Didn't back to ping someone lmao
I dont understand can to indonesian?
🤦♂️
Saya akan sangat menghargai jika A) Anda tetap pada topik. B) Tidak melakukan ping ke anggota acak hanya untuk mengobrol di saluran ini. C) Tidak kembali untuk melakukan ping ke seseorang lmao
how do I open a custom dialog when clicking a vanilla game building?
there's a script:finishInformationDialog, alternatively, there's script:click where you would setup everything on your own
and how would i actually use it? do I have to attach a separate lua script to said building using inherit?
that is called for the script owning draft
can I somehow use it if my script is defined as a json "script" type
my lua is crusty
you want it to work on any building?
on a building of specified id
ok I have actually 0 idea how to use this
could send you the script if you feel like it
The following code attaches current script to all roads so that every road receives the script:event call.
local wireDraft
local wireId = '$underground_wire00'
function script:lateInit()
wireDraft = Draft.getDraft(wireId)
local roadDrafts = Draft.getDrafts():filter(function(d) return d:getType() == 'road' end)
for i, draft in ipairs(roadDrafts) do
if draft:getId() ~= '$dsa_moon_road00' then
script:addScript('legrater', draft):initCopy()
end
end
end
-- initialize wireDraft for a specific road draft
function script:initCopy()
wireDraft = Draft.getDraft(wireId)
end
function script:event(x, y, level, event)
-- If road is removed, remove pipes too
if event == Script.EVENT_REMOVE then
if Tile and Tile.getWireDraft(x, y, -1) then
if Builder then
Builder.removeWire(x, y, -1)
end
end
return true
end
-- If road is placed, place pipes too
if Script.EVENT_FINISHED then
if Builder and wireDraft:isUnlocked() then
Builder.buildWire(wireDraft, x, y)
end
return true
end
end
interesting
i will try it out
seems to work so far, thanks
it appears that I can't directly add variables into gui dialog text using regular lua string concatenation
any way out?
ok I'm actually an idiot, I shouldn't be allowed to write lua in lines longer than 20 characters
wha
I missed a single . character, vsc didn't panic and I couldn't figure out what went wrong
the joys of theotown lua
will make sure the next entry in the series requires strongly typed cross compiled c code
theotown 2 confirmed
shouldve used my lua type annotations for theotown api
im trying to make a decoration with transparent ground around it and it turns into water? im trying to use the draw ground statement but im not sure where to put it in the code. any tips?
use PCA
imagine writing a whole code just to it don't work
"draw ground": true
where do i put it ?
[
{
"id": "$emberecho.decoration.2025-01-20-19:24",
"title": "Park Bench",
"author": "emberecho",
"meta": {
"pca": {
"version": "4.4.1"
}
},
"frames": [
{
"bmp": "Photo 2.png"
}
],
"width": 1,
"height": 1,
"type": "decoration"
"draw ground":true
}
]
remake the plugin, adding the code when it already done won't change nothing
oh ok. i see its under optional attributes
sweet that worked. permission to make fun of my bench now 🙂
What attributes
true, that building is super mini its a 1x1 but is obviously a full building but even by the trees scale. im working on another version now ty
wrong channeru
Oh i see😅
is it possible to set demand to specific value rather than adjusting offsets with fun variables?
for example I want to set commercial demand to 0 for some time and then unlock it
No
shrill
is there a lua script function that just fires whenever a building is placed?
there's a building listener to getting added
there might also be an script:event enum for that as well
there's addBuildingListener, but why can't I remove a listener?
Just add an if-else
...what
think he means
keep a table of buildings that should be tracked
then check if the building's listener needs to actually be ran
and ignore the ones that are "removed"
there is removeBuildingListener
can you please document functions????????????
eventually
I will eventually kick you in the solar plexus
lol
absolutely not
what does removeBuildingListener's call signature even look like
you can't make an animation only appear in the day? hmm
I'm pretty sure you can just have the daytime animation active at all time and a nighttime animation that would cover the daytime animation at night
which is a pretty roundabout solution, but well
(please use correct channels next time)
oh, sure
@trim remnant
Pmodmenu @carmine token
hunk_white was banned for the following reason: Sharing or spreading scams or phishing content.
Thank ya
always
riveting scripting content
at this point we can auto ban anyone typing in this channel
again you
😢
does Tile.setBuildingAnimationFrame work on roads too?
someone overdid a purge
this looks like its from other game 😭
