#plugin-lua-and-fun
1 messages · Page 10 of 1
How to attach multiple script into single draft?
Tnx
Is there any solution for this? Or none?
I had module A that requires module B and A is attached to multiple script,
Here's my code for module A
-- module A
local mdl = mdl or require ("mdl_b.lua")
remove "mdl or "
Won't work
luaj*
Should i use pcall?
How create category inside another category?
Also
How make transparent ground?
I tried it, but it didn't worked
“draw ground”:”true”
Hope you're not making category for these buildings
No, but i planning add another buildings. These buildings on the screenshot will be not in category.
(sorry for my grammar)
Okay
I'm just saying this because having a category for a few rci buildings isn't a good thing to do
The buildings are nice however
Thanks
you pfp............
Just ignore it
it's just a cat
A dancing cat..
is module B requires module A?
The fact I know what animation it's specifically from...
omg omg omg they have nitro
uh oh
No but A was applied in all scripts
That shouldn't be a problem
Each script would load the module seperately
Does the MDL module have dependencies as well
It will error if MDL has a dependency your script has as well
You probably have a circular require somewhere
circular reference*
Fix your handle
If i used "mute lua" Should my script debug info also hide?
Yes
Sounds like a good solution to forgetting to remove print statements
how similar is python to lua since i know python
Just Anyone might know about that
Lua should be pretty easy to learn though
This might help tho
schwarz#2450 was banned for the following reason: nitro scam
Is it possible to make energy and water go pass 100,000
I saw a bit of plugins with more than that
You can, but i remember Ja said it depends on building height and size
"animation":[
{"id":"$2lrtheadlights00.anim", "pos":[0,0,0,0,0,1,0,0], "frames":[2]},
{"id":"$2lrtheadlights01.anim", "pos":[0,0,0,0,0,0,0,1], "frames":[3]},
{"id":"$2lrtheadlights02.anim", "pos":[0,1,0,0,0,0,0,0], "frames":[0]},
{"id":"$2lrtheadlights03.anim", "pos":[0,0,0,1,0,0,0,0], "frames":[1]}
],
Help
Animation for diagonal car frames pls
What is the pos
Facing
Eyyy
Its possible to add
Pos ..... and
Frame [facing]
For diagonal anim?
I dont understand
{"id":"$lrtheadlights00.anim2", "pos":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "frames":[0]},
{"id":"$lrtheadlights01.anim2", "pos":[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0], "frames":[1]},
{"id":"$lrtheadlights02.anim2", "pos":[0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0], "frames":[2]},
{"id":"$lrtheadlights03.anim2", "pos":[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0], "frames":[3]},
//diagonal light
{"id":"$lrtheadlights00.anim2", "pos":[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0], "frames":[4]},
{"id":"$lrtheadlights01.anim2", "pos":[0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0], "frames":[5]},
{"id":"$lrtheadlights02.anim2", "pos":[0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0], "frames":[6]},
{"id":"$lrtheadlights03.anim2", "pos":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "frames":[7]}
],```
Pfire
There's a fire somewhere? Call @trim remnant to the rescue!
What
The pfire command is used to notify mr firetruck man aka elderwheelman to get rid of these types of scams and more
@potent jolt
that's not what it does
just ping an admin directly next time
doesnt take up as much of the chat space with the firetruck pic
that's a very cool pic tho
it do be
maybe the length of animation is <= 3, and diagonal frames (>= 4) are still not available. 
You mean diagonal light still not in function?😅
What do u mean
How can I do this
wdym
I mean both diagonal and sharp turn in 1 road
They are wondering how to implement two different corner frames: The angular turns seen on the left and bottom roads and the diagonal turn frame on the top road, because the original method for creating diagonal roads was just editing the corner frame to be diagonal.
He mean about both functions, the diagonal and non diagonal, road at the same time. I think you can't do it but having both roads is the only option i guess
I think you put the frames in the road as diagonal
Pfire
There's a fire somewhere? Call @trim remnant to the rescue!
hehe
Oh my god
My bad
I'm so sorry
Please forgive me
I just wanted to see the cool firetruck picture
Mate that won't ping firetruck man anymore
How do i get a plane building tenplate
Is it somewhere in the forums? Or do i make a plane myself
Here
Thanks
Plugin store plugins are encrypted
what makes you want to encrypt it?
What happened to the train station?
Hm
Is there a tutorial on how to use json genie?
Or just how to code a plug-in
You can use https://pca.theotown.com
An easier way to create plugins via friendly UI interface.
And where do i code the plugin?
Nvm i found where to code it
But its says error when i try to import it to the game
you might want to use #plugin-support or #plugin-discussion for that
also we can't do anything without the source
?
Car only
Its possible?
Only my car plugin came out of my industry plugin?
No other truck and cars
rci cars: 0
okay @merry shale and I were making grass decals(and diagonal versions)
is there a way for the edges that touch the water to use winter frames as well when winter is on?
i wonder
How would you rate because I don't know how to use pixly well
Can't really rate because unfinished but
The roof is wrong
Or maybe it's not if there is a line
What's this
Also the shape is flat
If you remove the roof it will be just a cube
The front structure is just painted on the wall
The scaling of the building front is too small compared to the rest of the building
Either make the front taller or the roof lower
I'm working on it, I'm going to color it
I will be adding extras above
Also your roof is inconsistent
The triangles all look slightly malformed
And the windows change in size
They should stay the same across the whole roof side
I know because I am a beginner I will make changes to it😑
Too big compared to the image with people
People in TheoTown are only 3 pixels tall
I will not put people
ikn
That's not what I'm suggesting
I'm saying it's too big in scale
Please use this channel for scripting related discussion only.
Guys, can anyone help me? I want to make my trash cans collect garbage like landfills. Can anyone send the code written in json or guides?
https://forum.theotown.com/viewtopic.php?f=41&t=1355 check the infuence and provide aspect tabs
Diagonal car light still not applicable?
'''"animation":[
{"id":"$teslaheadlights00.anim", "pos":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "frames":[0]},
{"id":"$teslaheadlights01.anim", "pos":[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0], "frames":[1]},
{"id":"$teslaheadlights02.anim", "pos":[0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0], "frames":[2]},
{"id":"$teslaheadlights03.anim", "pos":[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0], "frames":[3]},
//diagonal light
{"id":"$teslaheadlights00.animd", "pos":[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0], "frames":[4]},
{"id":"$teslaheadlights01.animd", "pos":[0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0], "frames":[5]},
{"id":"$teslaheadlights02.animd", "pos":[0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0], "frames":[6]},
{"id":"$teslaheadlights03.animd", "pos":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "frames":[7]}
],'''
guys I wanna make a car I have a friggin chromebook how to script a car btw?
or light animations instead of this
Can anyone jason text of night anim
that's not what light anims are all about, I recommend using ian's tool for that
especially if you want to save texture space and your time on creating png frames
yup I found a tutorial in youtube and he said DESOLAN Helped him
Oww
!?
@cerulean crypt please use correct channels
also probably works like a normal road (see pedestrian documentation)
Is there a way to make plug ins online or on iPhone
no
There's a fire somewhere? Call @trim remnant to the rescue!
Is it possible to have compositions without the parts ie just the compositions only
Also compositions but even bigger, how?
Yeh
How to deactivate the public needs in my industry
I mean the police and fire requirements
Not possible
Okay, here this six lanes, to script this, need enable pedestrian in six lanes (sidewalk only), i mean need more realistic
Just put pedestrian false on middle line of ur road?
@JustAnyone0001 is here
well plugin creator maker I call "creator"... And "developer" name for game creator
Boned
sir this is #plugin-lua-and-fun
Sowwy...
Btw..
How to got Theotown's animation id? I want fountain animation id for my plugins like arif's plugin
What fountain do you require?
I can get it for you
Oh the spray fountain
check the resources on the forum
its likely to be in content_animation.json
Ok i will try.. THANK YOU
Thats actually the fountain's id
Is it possible to make a composition but just the compositions only and not showing the parts it came from. Because I've seen some plugins where it's just the compositions but the things it came from is not visible if not absent.
Preview frames?
Is that what it was called?
Perhaps
Oh ok so "hidden":true?
Oh nice so I don't have to make a separate category
why would you have to make a separate category
Anyways thank you so much mate
I don't where to put them
you're welcome
How do I make q disaster plugin?
since you're in #plugin-lua-and-fun, lua
Lua is a bit difficult
no it isnt
ya it looks easy
but if you code a full game
like theotown
it will be 10 times difficult if you're the only one who is developing it
Of course
Parts from composition isn't visible if they are hidden, you must make a preview frame fro those
nah lua isnt that hard
struggling to code a full game with a language is just the limit of your coding skills regardless of languages
How to add extra action tool into a road plugin?
what do you mean?
this function is undocumented
but you can see in the tool that it makes a button in the top right
im not sure if this plugin is available outside tools
refer tohttps://github.com/LobbyDivinus/TreePlanterTool/blob/82257135963efef097a09645b61ef7ced27da9ef/script.lua#L195-L208
lol
Not work
i guess its not available outside tools

Is there any way to get the id of each icons from "Icon" Libraries? I tried to filter all animation but it doesn't show up
Seems like this would check for each tile if it's road :/
why not just iterate over the Icons table?
that can be simplified by using https://github.com/LobbyDivinus/TreePlanterTool/blob/82257135963efef097a09645b61ef7ced27da9ef/script.lua#L211-L218 which will make it only get called on specified tile types
makes script:draw get called for less tiles increasing performance
ofc
its undocumented™️
Ofc ofc
There's also city.createdraftdrawer
Which seems to be pretty powerful
But idk how it works
Not to mention
How to reduce or off pedestrian spawning in my RCI plugin
killall pedestrian don't build a road.
pedestrian only relate to the road/deco
did you give the proper width and height to the composition
local function wait_for_gui()
if GUI then
run()
else
Runtime.postpone(wait_for_gui)
end
end
local shouldRun = true
function script:enterStage(name)
if shouldRun then
shouldRun = false
wait_for_gui()
end
end
now this is scuffed
Is there a function to get if the ground is a slope?
Great thanks
dunno about checking what kind of slope though
ah great this doesnt even work
gui table can exist and gui.createdialog still wont work
mfw gui.createdialog exists but doesnt work
you'd think gui.createdialog would work in script:overlay after gui has been drawn
but youd be wrong
@light plinth i remember now i stopped working on it because i couldnt figure out a reliable way to show a dialog directly after startup
@stoic vector hello
ask lobby
Will do
Maybe there's a function to open a dialog like ".select()"
¯_(ツ)_/¯
ive tried everything i know
so far my best solution is simply to run it a second later
but
this isnt consistent on mobile so i need something better
Can anyone give me a link to a tutorial for animation on forum?
Someone help
Expected array, but object was provided instead
What that mean
You forgot to add [] in the beggining and in the end
Is anyone have school json?🗿
schools don't have scripts
theirs jason’s for schools?
use "influence education"
and "provide aspect education low"
if I remember correctly
refer to the forums
just look at the in game json published on the forum
or use the actual tutorials
forum moment
Link pls
find it its not hard
its somewher in the resources section
haha fancy button go brrr
Didnt know the game told u if u had op plugins
In here?🗿
Wrong section
Very old problem still not fix
yes
just use any text editor
Owh
Why everyone's name has "gaming" letter?
justanyfour gaming
erksmit gaming
Gamers
Fu. My school plugin error 🗿
Which one to make school plug in?🗿
Is there a spawner tutorial forum?
yes
can you send it?
no
Arent the circular panels from designer anthony? Lmao
I needed a plugin that the game would mark as op
An op signage
you could use my fill sandbox requirements plugin xd
this was the easiest to find 
Do you know what's wrong?
Did u put brackets around
Yes
validate it in the JSON checker
How do i code a custom category
Thanks erkburg
You can't
unless you change an the id to that
You do need a frame of helicopter so yes
you can't
in this point
How do i code in monthly income
Im making a landmark that gives me 200 Theons a month
Oh thanks
Line 21
Trailing comma
i know this sound like a stupid question
but how to change the height of the building?
not scripting related, that do you mean by 'height'?
as in where to put notifications?
well that no energy icon should be in top of the building, not in the middle like that
so i think that i could the height?
probably "building height" or something similar
you're welcome
got some problem guys
so i was using the same frame i used on a building
to use it for its lower version
but i cant found the lower version in the game after i coded it
for visualization purpose
Belgium and russia?
ye lol
nvm guys
i found out the reason
turn out i set the code file to .txt
not .json
a "h" moment i suppose
lmfao truly a h moment
yes
understand
darn, I am not good at java.
java is not used in plugins
Technically, it does
But that's a stretch
fun?
well
yeah
but thats like saying typing something into google is javascript programming
if you can do that, you found a vulnerability, so it is possible to some degree lol
are there any documentation about theotown plugins?
see pins in #plugin-discussion
especially Getting started:
https://forum.theotown.com/viewtopic.php?f=41&t=2965
a small plugin is always a good idea
Ye
Except of 64 animation frames for road deco
What is other way to make rotatetable road decoration?
Like this
U forgot comma (,)
Do i have to put a $
Yes
Back to messing with the code
Anyone can teach me how to use lua?... :(
can someone put the code of education population thing?
like the residential building
"provide aspect education low": 10
"provide aspect education high": 10
@elfin geyser hey you mate I need your code for the arty. Also lateral aim/view is going to be added
Here's the sample
For lateral aim view simply add a tile check for different directions and change the frame of the current tile based on what frames fits that direction
Do i have to put a square end bracket?
Yes, you havr
Is there a function to spawn lightning on certain pointss?
Hello
did you mean 'hey google'?
ok
I'd see if you can find out how the game spawns lightning
If that doesn't work you can always just find the IDs of the lightning animation and audio and use those
Why do you need to make your stair as bus depot
*bus stop
bus depot i swear
Usage: NAN%
Is it possible to register a command that will parse the inputted string from console with pattern?
The registered command will be: (for example)
TheoTown.registerCommand("state{%a+}",...}
Mostly through trial and error
i translated the tt luadocs into emmylua annotations recently
if youre interested
it will make tt lua programming easier in vscode
Usage: NANI?%
@potent jolt can you make a module that will set the view of user up to the targeted position smoothly, it's really like your cinematic camera but works like the ingame notification that has a "target button" That set the view to the building who owned that notif. I know it's easy for you to do thia since you've done your cinematic camera.
The scripts for the cinematic camera are available
You should be able to just grab those
How do i steal car frames
What where?
the whole waypoint mode is pretty scuffed
the camera might also teleport to a random spot in the city sometimes
especially when first using it
i dont know why
I can answer any questions you have about the code if you need
@potent jolt camera zoom out for cinematic camera
?
Wdym
I gave the cinematic camera dynamic zoom level support already
you can program waypoints to make the zoom change perhaps
and maybe also have a "smooth transition" kind of thing where the camera zoom changes while moving from waypoint a to b
Hm
speed could also be useful imo
I'd have to check if zoom can be that smooth
Can be changed in settings
Or between waypoints?
Ah
cinematic camera tool deluxe edition
costs 31 diamonds
Lol
I will have to check if I can set any zoom level or not
Should be able to
I'd have to make some like
Bezier curve function
Guys what would be a way to make the player select a rectangle area on map (like when building ground tiles or idk) and then get cords if it?
Using tools, in Lua
you will have to track whether the user has already tapped once or twice
just declare a table and get coordinates with script:click
local rect = {}
function script:click( x, y )
for i=0, 1 do
local keyX = 'x'..i
local keyY = 'y'..i
if not rect[ keyX ] and not rect[ keyY ] then
rect[ keyX ] = x
rect[ keyY ] = y
return
end
end
-- do something
Debug.toast( Runtime.toJson( rect ) )
rect = {}
end```
Why i can't do tonumber()? I tried to toast the values but toast an error, Now im still using force arithmetic convertion "4" + 0
Also what is the draft id of Icon.PLAY? i need it for preview frames
Have you spelled tonumber correctly? It shouldn't ever error
If tonumber gets an invalid number it should just return nil
Json related question detected in #plugin-lua-and-fun instead of #plugin-discussion
Release the kirovs
"rotation aware":true,
Make sure the order of the png buildings is correct
If they are separated, they are sorted correctly
If put together, they must be arranged in a neat order and use the h and w coordination (like making a car json)
dang
↘️↗️↖️↙️
Maybe you can see a reference example in the San Francisco bridge plugin
It uses a rotational modulable support system
i see
How can i hide recent use tool in recent category ?
There's a :setVisible() class on drafts
How does one place new categories into "$cat_service00"
In your new category draft set category to cat_service
Just like any other draft type
Okay awesome thanks, it was bit confusing for me.
What script function is useful for drawings that can be seen on screenshots
"needs land" and "needs water"
All set to true?
yes
Unplacable
lol
Except in the air
Building can be built if only one its tile is on the water
"needs land": true,
"needs water": true
Building can be built anywhere even it's all tiles are on water or land
"needs land": false,
"needs water": false
yes, you do
yes
if you do not specify the picture with bmp
the game will try to look into the world texture
since you didnt specify x it errors
what does it means?
"moveable":false,
"chargeable": false,
moveable is pretty obvious - it tells whether the building can be moved
and please refrain from using this channel for non scripting stuff (again)
Literally me
Me when people post json here 😡
😤
Up until now i haven't use this. What really the use of privileged code?
privilege code is used for plugin functionality that could be exploited
like monthly income
Oh
Question
Theoretically, if I made war plugin with Lua (trollface) (just theoretically I won't probably), it likely won't get approved to plugin store?
I doubt I have enough skill for that but the concept of some combat plugin is very interesting
I'd look into Age of Sail
It's the only plug-in I know that's added any sort of combat
The whole plug-in is very impressive
Hello, I tried custom ninepatch, only frame at bottoms and the first 6 frames are null but it didn't cast isn't really the game intention not to cast first null frame or a bug?
how do I write the night frames if I have 2 frames like this?
Add "rotation aware":true,
even if it's not a rotationable?
"animation":
[
{"Id":"H1a light","frame":0},
{"Id":"H1b light","frame":1}
]
If u have more rotation just add
frame 2 = 3rd rotation
Frame 3 = 4th rotation
frame:0 <- is this the night texture?
u need to make frames for that
#plugin-discussion this is not scripting
oops sorry
yes i know
Wrong vhannel bud, suggest plugin in #plugin-suggestions
Correct 👆
It's not
That is not a valid excuse
^
^
Does button text color are changeable?
button:getChild(1):setColor(r,g,b)
Nice
Hello, I'm having a problem with plugin settings i used Util.optStorage() and TheoTown storage for saving values , settings works fine ingame it, change values but didn't save when you exit the game and always set the values to default upon Initialize
I'd also try direct saving on TheoTown storage without used of optStorage but still wont work
can i see the code?
Nvm it's fixed, that isn't a proper way but i move the initializer(value loader) on the other script
You're probably assigning a variable by value where you intended it to be by reference
No i used
stg.value1 = stg.value1 or false
--2nd attemp was
stg.value1 = stg.value1 == nil and false or stg.value1
Which both not get saved value i want, n only works when i made transfer them to other script
stg = Util.optStorage(TheoTown.getStorage(), id, {})
And also (for 2nd attemp)
stg = Util.optStorage(TheoTown.getStorage(), id)
Actually what i conclude here in my script is
function script:init() with getting values and function script:settings() are not work accurately on same script
thats strange i do not have any issues with it
youre not accidentally making it global right?
i do it like this
where settings is a local i defined at the start of my script
I looked up about your cinematic script before that made me confused like "why it's work in his script than mine"
But it's fine now on the way i did, and i gues that's important thing for now
Is there a function for getting a player's game ID? I swear another plugin used this a few years ago, but I can't find the function in the API docs.
Wait
Why you want to get them?
Isn't TheoTown.getId()?
If only it can connect to data base
Well sounds fun
I suggest there was a global chat box ingame
Society if lua networking
no
That could be fun
But to be în only english not even language of the globe
What do you mean you won't open up a massive security hole
I'll try that. I figured itd be something like that. Too bad it isn't in the docs
I want to generate something unique to each player
Why not generate randomly on some rate
I figured I could just use the ID so it would be consistent
👍
May I know what is meta tags for DSA supply cars
Oh dang, you're an experienced lua expert
I would absolutely love to see this UI in the game
@unborn relic
yep Quin got it already
Draw the text inside the panels ondraw function
Then you have access to the x and y position of the canvas letting you calculate the relative position of the text
Didn't ian make a module for movable gui stuff?
I don't want to make the text movable inside the panel, i want the panel to be moveable
Yes but it's only button
id check with ian to see how he did it
probably taking in the position in ontap and using that
Hello is it possible to mark specific building by its id like this on script:draw() for tool?
none that i know of
but if youre using script:draw in a tool remember to set the tool filter to increase performance
-- Use filter for draw function for better performance since 1.9.33
if TheoTown.setToolFilter then
TheoTown.setToolFilter{
water = true, -- Call it for water
building = true, -- or for buildings
road = true, -- or for road
mouse = true -- or for mouse location (desktop only)
}
end
as always, its not documented
lol
Does TheoTown.getUserName() will still return the name even i logged lately and i turn off my connection and call this function, cuz im still logged in even i restart the game without connection, so i think my username is still on the cache
Yes
hi how do i start making plugin is there any spreadsheet or reference or guide on how to code stuff (im using note++)
would you like to make a normal plugin or are you looking for lua scripting
in any case
https://forum.theotown.com/viewtopic.php?f=41&t=2965 is a good place to start
This is #plugin-lua-and-fun or a place to discuss about fun attributes and lua
What wrong?
not scripting. please
Also, you missed a comma after the author line
Ok, 😅 I'm forget
Please please, ah, yes.
Yes
Although I doubt it'll be a good experience compared to desktops
You'll need an app for drawing images and one for writing json
With that you can make plugins on mobile
Oh and a file manager
An easier way to create plugins via friendly UI interface.
Try this maybe
No json knowledge required
why do people forget that #plugin-lua-and-fun is for plugin fun and lua scripting
First time?
Check fun tutorials on forum
hello! how can I group my plugins?
you should create a category first
Check the category tutorial on the forum
how do I create a category?
.
paste this in json and change its name.
[ { "id":"$cat_sample00", "title":"Category", "category": --this is where you can put your category "type":"category", "ordinal":1, --what is the ordinal of your category? if it is first, second, or third. "hide id":true, --this function hide your category id when users are in debug mode "frames":[ { "bmp":"sample bmp.png" } ] } ]
yes
all u need is in forum
i can't understand ["category": --this is where you can put your category] this.
where do you gonna put ur category??
in terrain
But if you're plugin is type terrain it will automatically there
yes
but he need to group his plugins
How do i know the ids of the categories?
turn on ur debug mode
go to ur tools and u will see an ids in top of it.
when ur inside of evry categories.
np
Ill do it for you
I have 1 more question
??
How can I rotate my plugin/add a variants in my plugin
check forum → https://forum.theotown.com/viewtopic.php?t=13423
I can't teach u anymore
Check pinned messages in #plugin-discussion
im busy
cant understand 😦
check forum
cant understand too
If you're on mobile, go to #plugin-discussion and swipe left, it'll show a screen showing the people on the server, on the top of the screen it says pins, click on that and there would be a lot of helpful stuff for making plugins
I know that
but I cant understand this explanation
hey I dm u json scripts.
ok thanks! 🥲
if you want to continue, move to #plugin-discussion, json is not scripting
Scripting is lua
or fun
And fun attributing
idk what that means so srry
continue the discussion in #plugin-discussion, as it is not scripting related
Just I said I didnt understand the explanations.I want to watch Theotown tutorials in yt but nothing helped me there.
so... do u want to watch a video so that u can understand??
yes
If you want to have rotation aware buildings you should make the frames in order of counter clockwise first, and that's legit it from that comment
im not showing u any vids, im only teaching ppls using explanations.
srry
gtg
what?
again, i told you to move to #plugin-discussion
ok
ok
human-san#6090 was banned for the following reason: nitro scam
60 90
69
grow up
0042
the case name would be a great nickname
@merry shale was banned for the following
reason: nitro scam
i thought you're pidroid
Bip bop, bip bop
Haha
The numbers mason, what do they mean?
sauce code?
This is for lua and not for hetai code
im sorry my brain couldn't stop it
No secks in thoetow sever
Hmm Marco
Bro why are you obsessed with this guy lol
😳
Does anyone know how to get the plugin to appear in the fire department category?
This channel is for lua scripting
Just do "category": $cat_firebrigade00,
How to change frameDefault and down of button objects? Not to create a button with custom frameDefault and down
you want to change it after the object was created?
presumably it should be setFrameDefault
Yes exactly like that
Isn't this function was there?
no clue
I guess ill debugtoast keys in that object or maybe will got nothing
might be worth a try

Ill script that rocket to crash back to earth
I'm russian, I'm bad understand English
This is for Lua and Fun Scripting good lad
If you wish to communicate in your native language you shall enter #language-bar
I'm coding on python 🦛
that's a hippo, not a python
😱
Hahaha
Unfunny
sir this is #plugin-lua-and-fun
Who is that?
lobby
You already saw that guy while sleeping
No, it's funny
Wot you find amogus funny even though that joke originated 2 years ago🗿
Where is amongus?
I drunk
Ok)
Hello. I was looking at edited photos of TheoTown made with photoshop or something like that. And asked a question… Is it even possible to do something like this? It is clear that these wont be shaders like in minecraft, it’s impossible. But remembering the graphics settings (gray classic, etc.), I wondered if it was possible to make my own filter. in theory, find the file responsible for color saturation, and make something that will resemble a picture.
(I’m not sure if this is the right channel to ask that)
I doubt a shader could emulate the shadows though
It's a really nice screenshot though
Hello,
Is this how "Util.collectRectTiles" Collects tiles? Or this is a bug for this hollow?
Read the docs, looks like this is the intended function
Ahh i thought tiles inside are included
Yes, but i thought it will make my work easy with this function
I bet it's hollow for performance concerns though
Dunno if performance would hold up if you called draw for every square
I made a test if tiles inside are included like that red toolmark it turns red when it matches certain building inside
Ah yes at least i could make dead range with this
Omg:0
not really, although you can just draw a overlay ontop
Maybe raise amount of blue in darker colors?
If someone edited that, then it's possible to do with simple shaders
Just not with the tools theotown has for now
Some of the shadows in that picture don't exist in the original textures. They were probably hand-drawn. I'm not sure there's an easy way to do that automatically
the lua api has no functions for reading the contents of a frame
if you were skilled enough you could probably make a flowing river plugin or something
Мaybe there are built-in filters?
Or we can add filters in the game
But shadows are trouble
As far as I'm aware we just cannot
There are already some filters in the game, so we can try to do something like this
but it requires cooperation with developers
It would require their help yes
But they'd probably say that it's too heavy on performance to leave up to lua
Of course. It’s impossible to make the filter with shadows, so we just change the colours
You can use a overlay via lua drawing or overwrite world texture
Overwriting world texture is simply a bad idea
But drawing a overlay wouldn't really have much effect
What do you mean? Just change the color to emulate the shading?
Or are you talking about something else in the photo?
I mean this
Colors setting
I want to make my own
Oh, I see
we cant really
The best thing you have are overlays
yeah but i doubt a static color overlay can give the desired effect
Man I hate that errors in GUI event functions get supressed
I frogor the link to the lua docs
What line am i supposed to put first in a lua
There's no required lines
Basically a simple code
It helps if I knew what you were trying to do
I want it to set every tree on one map on fire
That's pretty easy
Also make a light pollution influence
Simply issue the fire disaster in every tile
Then wait for 10 minutes as the game processes what you've just done
Writing that down in me old notebook
Thats the funniest thing you've said to me
mfw you cant make dialogs in settings stage
anyone know a resource for the in game sound drafts
more like, heartbeat
ye i forgot about scale not being linear in the first place
when lua doesnt have a clamp function
local randomPos = math.random(cityHeight - MIN_DISTANCE * 2)
if randomPos >= current - MIN_DISTANCE then
randomPos = randomPos + MIN_DISTANCE * 2
end
now thats an improvement
from ```lua
local function belowCurrent()
return math.random(current - MIN_DISTANCE)
end
local function aboveCurrent()
return math.random(current + MIN_DISTANCE, cityHeight)
end
-- check if point isnt too close to city border
if current + MIN_DISTANCE > cityHeight then
return belowCurrent()
elseif current - MIN_DISTANCE < 0 then
return aboveCurrent()
-- decide whether to go above or below current point
elseif math.random() > 0.5 then
return aboveCurrent()
else
return belowCurrent()
end
why not?
wut

let me have another try
well that didnt work
i want to show a dialog when a setting is clicked
{
name = 'show first start dialog again',
value = settings.firstStart,
onChange = function ()
Runtime.postpone(showFirstStartDialog())
--settings.firstStart = not settings.firstStart
end
}
end:333 bad argument: function expected, got nil
hmm
try with a blank dialog. if there are no errors, there is something wrong with your plugin settings value.
ah right im an idiot
nah i ran the function
instead of passing as an argument
well
now it simply doesnt do anything
nah looks like doing it in the settings onChange event function is a no no
dang it worked
didnt expect that
ah
looks like it does not work when runtime.postpone does not have a delay
running it with a delay of 10ms also does not work
while 100ms does
wack
sure hope that behaviour is consistent on mobile
lua back at it with the excellent error reporting
society if i knew how city.createdraftdrawer worked
Me used module just to pass values from one to other drafts
Two script uses one module
that shares variables though?
i assumed both scripts would create their own copy of the module
Yes
I used to do it like this
local mdl = require("../modules/aos_trainstation_data_transfer.lua")
local function getValue()
storageKey, ownerX, ownerY = mdl.getValues()
storage = Tile.getBuildingStorage(ownerX, ownerY)[storageKey]
end
i guess it works if storage doesnt want to
It saves value while scripts are running
my mind is melting
Nice script
??
Yo i didn't know that
now the question is
is it a terrible idea to use sinus in script:update
or i just 3x^2 - 2x^3
I preferred the second way
Can someone send the link to the lua docs
Its like finding a grain of sand in a haystack
Thank you woman
Oh thank you reimu
youre welcome
Lua seems to be a more simple json
