#plugin-lua-and-fun
1 messages ยท Page 8 of 1
hmmm
I downloaded some lua coding thing and learned if conditions and stuff
hard to not be memory safe when you keep all your variables
What you want to start with is C++
Scratch is garbage
imagine not knowing c#
It introduces to programming concepts, yes
I mean it's for children
io.write("hello, world!")
so were where we
I started with Java
excellent code

full of bugs im afraid
sounds about right
although c# is my first real programming language
the chad programming languages
when i did arduino i didnt properly know what i was doing
anyways, i think knowing how to write a hello world message in lua is enough knowledge to get me through this whole theotown lua thing
plugin fun?
plugin and fun are not words that go together
thanks, lobby, for that very useful comment
hm
Proprietary?
Fun isn't even fun
it doesnt exist outside of plugins right
Just like the Draft objects
DSA still uses them
it oozes legacy feel
i noticed
with pidroid
for as far as im concerned
fun is not understandable to mortals
Pidroid is what you call technology from the 1970's
yeah like 5 lines
its your code
I have no recollection
No idea what you're talking about
It's 11kB too big for my liking
thanks
and you call my code broken
Is this an OpenTTD industry set
feel free to remake my plugin
inspired by openttd
sike you need another lua file for that
Cinematic camera and text placing tool
And a water tower I guess
Scripts available on the forum 
These sound pretty interesting
Especially cinematic camera, I wanted to check it out
Why does ๐ฉ๐ด call them bad tho
You mean the report
flag of Dominican Republic
I prefer ๐ถ
I prefer ๐ฆ๐ถ
dutch bird incompatible
I'll just wear a coat
how about
print("hello world!")
Because his stuff bad too
Is it?
Invalid syntax
Well
seems all fine to me
The most easy thing to do is counting buildings turning them to spends or income @misty python
Wait
it is
The prints go somewhere?
ASS console
Ok so nowhere
Helps find lua bugs in DSA production
That's like
ASS = Android Studio
Use Debug.toast()
print(string.upper('hello world!'))
``` then this will work, ripped straight out of lobby's code
When TheoTown 2
Idk
Is this tables?
Well it never goes anywhere but yes
No tables here
Oh okay
That refers to base lua libraries
You can run that code outside of theotown
I am not gonna lie, I read those veriables and other things for like some seconds then kulche really helped me a lot about those
I mentioned him smh
ironic
cool

thank you lobby
Cool code from lobby
Kulche should rewrite whole api ๐ณ no that would be soo hard I guess
Hold my beer
let's bully lobby even more, shall we?
use theotown interpreter
TheoTown 2 when
if we ever do add dependencies
I will make sure you have to deal with a mess like gradle
The logistical nightmare isn't my problem

:bear_c#:
Already dealt with npm dependencies
Just steal factorios system smh
I don't know how they do it
ignoring high severity issues isn't a fix

imma borrow your steam library
Oh no the 2 high severity issues in my cypress
I think you gotta login and stuff
that's how pipelines get hacked
With a forum account
imma need those too
Well if I update my cypress it don't work
So 1.4.4.0 it will stay
Or whatever it was
kindly send them to api.justanyone@gmail.com
Bold of you to assume I still remember those
I haven't logged in in years
Alright
Could be connected to Steam now
Just send your RDP creds
They don't have a standalone anymore
to your PC
Just use my server smh
Factorio is in c
You could run it on a Samsung smart fridge
Your server is in nt
Can hook it up real quick
Just plug in arch linux installation medium
and enable ssh
More than a floppy disk
And it's more optimized that tt will ever be
Well yeah
They didn't spend 10 years making it for nothing
They actually have a lighting engine tho
Better than TT already
๐ฟ
Look
I couldn't code until 2 years ago
Although that implies that I can competently code
you can't
No, locking a thread which is an instance of Db isn't a good idea
I will try to make the code more fancy
it wasnt fancy before but
wow I killed the english grammar again, ops
dude I am too lazy to paint for this
how do I put veriables into tables
Table.spot = variable
Or table['spot'] = variable
Or table.insert(table, position, variable)
But thats only for number keys
I just wanted to add some veriable number into notification
after 2 or more hours I have set the balance of the plugin and now the codes look more meaningful
is there anything that I can turn the calculations I made into an app using lua
hmm yes now I have 8 notifications for false combinations and factory stops with the right informations and also for one new thing
or
local tableName = {
firstKey = int,
secondKey = "string",
thirdKey = false
}```
City.showNotification{
-- Image for the notification, can be extracted from a draft using :getFrame
icon = frameDraft:getFrame(1),
-- Text of the notification
text = 'count:'..variable..'lol'
}```
won't this work?
depends on what do you want to achieve
how do I put an optional argument in a function? I tried TheoTown.playSound(chosenSound, loop=true) and it didn't work for some reason
what's the right syntax?
nvm, let me try one thing
TheoTown.playSound(chosenSound[[loop=true]])
this looks weird
but doesn't error at least
nah doesn't work even after i changed it
@potent joltsorry for dumb question but how do I apply parameter?
and skip volume
you put TheoTown.playSound(chosenSound, true)
I mean
there is a volume parameter
won't this apply to it instead of 3rd parameter?
optional parameters are nil by default
this didn't work for me
that way if for example you have a function and you only need the last parameter
you do it like
TheoTown.playSound(chosenSound, nil, true)
okay, thanks
the plugin works on phone... but the sound is weird for some reason:(
mabe It cut off the sound when I exported it to .plugin
nah it doesn't on pc
wtf is with phones
yeah on mobile sound starts playing and then restarts
like half of it is cut out
@potent jolt hmm strange, the notifications I put in my script:nextMonth are poping up every day even tho I dont have a script:nextDay. Is this how this is intended to be?
have you reloaded it
what happens is, it does start showing notification once new month starts and then continues to send same notification ever day in this month if the problem isnt fixed
although come to think of it, i barely understand lua, so i'm just gonna take my time and read through those tutorials and then probably make some simple lua plugin, maybe a new disaster or sth
Some comments on forum about some of my coding problems
https://forum.theotown.com/viewtopic.php?p=176394#p176394
although I am not gonna work on codes for a time, my mind is heated up and eyes are bleeding. Might work on textures when I am feeling okay
as long as you understand general object oriented coding concepts you should be fine
I dont even know what you are talking about, I shouldnt be fine then
you guys should be making fun of me in a hidden channel
ooc? never heard of it
trying to understand a yt vid
you bet
well ok maybe not object oriented
but in general
how lua works
and how it interacts with theotown
I see, soo you meant that I have to know how functions, veriables and tables work and also making them a lot more compact?
I just want the annoying notifications popup once a month and not once a day in a month
OOP 
sighs
OOPs
reminds me of oops role
how do I put those to tables?
Today I couldnt stand and tried to fix notifications, now again I am fed up with theotown plugin making.....
I wanted to make a notification for all stuff. Like if there are two stuff have to be fixed there will be one notification with the right sentences
what's your code?
And can you remind why does it need to be sent every month?
It is city. notification and I want it to only send once a month and not every day of a month otherwise it is annoying
It is in scrip next month, it does start poping up once it is next month but looks like we cant really control notifications without estra codes to stop it
Is it in some condition or something?
you shouldnt do popups anyways
unless theres an actual problem
or it requires the player attention
not for monthly income
Is your notification for reporting a problem?
It is for attention otherwise spends increase, factory stops or calculated income is negative at year's end
DSA: am I a joke to you
wdym how does it work?
Do your spends increase at usual?
and you need to do something about it every month?
Spends increase if there are too many chimneys per factory soo a notification comes and warns you about it
so this should popup only if there is too many chimneys?
And also if players has too many bfg silos for blast furnace because they increase income but for balance I wanted to limit them
Might have to do it to release this plugin earlier
I have a small urge to draw but it's not big enough for me to actually start drawing
Or I can make a gui ๐ค that has a factory theme. It shows problems and estimated income yearly income
gui?
it's harder but it's cool
make it viewable from that skyscraper
so it's like hq or something
Wont it be easier? I could just use drawing with enable disable function once player presses on skyscraper (or accountants office) it shows it
I can even make my own gui and it wont occupy space on screen
I just assumed, I was going to learn gui soon but don't know much for now
Kulche taught me how to make coordinates on screen also with the tutorial at forum and enable disable scripts it shouldnt be hard I guess
I would probably show a notification like yours once a year
One month passes by quite fast in TheoTown
I tried doing a similar thing with the prison expansion
But income also comes at the end of year, If I make it yearly than people wont realise their factory wasnt working
You can display a warning sign if it's not working
Similar to the warnings that appear on buildings with problems
No you'll have to draw that yourself
Oh I see
how do I fix this stupid fence overriding my pretty diagonal roof
to make it more understandable
hmm yes pounkiller's decals json
if it works it's good
no
is just a decal json, probably pounkiller wasnt using an app for the json
how to prevent people from copying your code.
it really did lmao
shift alt f
well I had another decal json in australian bush fire pack
also gotta say that pounkiller's code kinda has unnecessary stuff too
he probably knows that
I think it wasn't a question
please read the whole conversation before replying (again)
Ah so a world texture viewer
yeah
but I am wondering if it is taking x and y coordinates of them?, there is a thing at the bottom but
that will not get approved if it shows any iap purchase textures
?
how did you set up your dialog
why not overwrite the games 9patches with dark ones
also there insnt really a way to have readable text on dark backgrounds
at least the way the game draws it
i once tried to replace game ui with dark ones and most of them were unreadable
I can't edit color of the text so easily sadly
Yeah there's no way to make the game draw text differently
make it just dark grey
oh ok so the plugin creators will have to implement the dark mode
that could easily lead to inconsistent ui if you dont provide premade frames
Tool for layered road decorations ?
The real question is what that incognito tab was for
He was most likely making charity donations to help starving childrens.
I use incognito so chrome doesn't open my links with the apps
That's irritates the hell out of me when I use YouTube desktop on my phone
I use incognito for discord web for phone, otherwise it is spam of suggested discord links at search bar
?
?
Those are not default Lua libraries
the table with it's first letter d in lowercase seems seems to be a default library
debug not Debug
Also, some standard libraries may be disabled for security reasons.
Debug are functions provided by theotown
they are documented
opened 8 april no comments 
opened September, 2020
no comments
https://github.com/luaj/luaj/pull/76
the same way I cloned discord.ext.menus into Pidroid
glorious open source
dear god
yes
usually, it's all ternary operators in tt code
i find those to be a little hard to read sometimes
but im cool with them
i only really use them on return statements
wanna see new android file api?
it's crap
yeah
just a sandbox feature for those apps
if user disables it
then app can access files no problem
yeah
that wouldve been fine
would put 0 extra effort on the devs
well mostly
and be backwards compatible
backwards compatability
i say as i change the way my bot config is setup almost every update
my bot config is the only backwards compatible feature
What does Vector do in the game?
a Vector can represent a lot of things
a vector is an object holding an x y and z value
you can use them for example to calculate the distance between 2 points
in my camera tool i use them for the cameras location, its target location etc
and also the distance it moves per frame
they have a z axis but if you dont need it you can just not use it
for example
local vector1 = Vector(0, 1) -- makes a vector with x 0 and y 1
local vector2 = Vector(2, 1)
local vector3 = vector1 + vector2 -- will create a vector with values x 2 and y 2
vector3.x -- is 2
you can also easily get the lenght of these vectors
Well Vector in programming is most often used as coordinates
yeah that
you can do some funky maths with it
much cleaner than doing lua local x1, y1 = 0, 1 etc..
see my script using vectors
**subject to change
also probably not the best code
-- current camera location
camera.location = nil
-- the distance between the camera's current position and the target position
camera.targetDelta = nil
-- the distance moved per frame
camera.frameDelta = nil
-- the target position for the camera
camera.target = nil
``` are all vectors here
theyre given values later
Vectors are some math sticks which are used too often in coding
Example: "huh so vector is just a math stick/smartass line? This is useless"
Tries to code something
"I was wrong"
By the way, there are scripts to move camera? @potent jolt
vectors make the game 3d
Imagine using the 3rd dimension
You can use City.setView I'm pretty sure
valid scales are 4, 2, 1, .5 and .25
with a higher number meaning more zoom
3rd dimension in theotown is like 4th dimension in reallife
you could use it for like
2 level ground decos
i guess
or ground level
but im pretty sure there isnt really any lua api functions around height
local denKC = [[
[
{
"id":"denKC",
"type":"animation",
"frames":[
{
"bmp":"denKC.png"
}
]
}
]
]]
Draft.append(denKC)
local topFrame = Draft.getDraft('denKC'):getFrame()
is this correct ?
i want to get the frame of denKC.png
uh
well first off a disclaimer
using draft.append is a bad idea and should only be done if theres no alternatives
but yes
that will get the 1st frame of that
this is a json error
unless
where are you calling that script?
in script:init?
you can declare denKC at the start
but you cannot call draft.append before script:init
as that will not have been set up yet
[
{
"id":"$circleKanight",
"type":"animation",
"frames":[
{
"bmp":"circlenight.png","w":320
}
],"light":true,"light switching":true
},
{
"id":"$lop2KC",
"type":"animation",
"frames":[
{
"bmp":"lop2.png"
}
],"light":true,"light switching":true
},
{
"author": "DucAnh",
"frames": [
{
"bmp": "circle.png"
}
],
"height": 10,
"level":3,
"id": "KatoriCircleTower",
"monthly price": 10,
"needs road": false,
"price": 65000,
"text": " Katori Circle Tower ",
"width": 10,
"type":"award",
"animation":[
{
"id":"$lop2KC",
"x":0,
"y":-323
},
],
"habitants":5000,
"people":4500,
"draw ground": true
},
{
"id":"$circleTrans",
"type":"data",
"script":"circleKat.lua"
}
]
this is my json code
how the code looks like ?
please help me
local animDraft = Draft.getDraft('$denKC')
local topFrame = animDraft:getFrame(1)
function script:draw(tileX, tileY)
local daytime = TheoTown.daytime or 0
if Tile.isBuildingInConstruction(tileX, tileY) then return end
if 0.1 < daytime and daytime < 0.8 then return end
local time = City.getTime() + tileX + 2811 * tileY
local freq = 0.1
local phase31 = 0.5 + 0.5 * math.sin(freq * 0.001 * time * 2 * math.pi)
local phase32 = 0.5 + 0.5 * math.sin((freq * 0.001 * time + 0.33333) * 2 * math.pi)
local phase33 = 0.5 + 0.5 * math.sin((freq * 0.001 * time + 0.66667) * 2 * math.pi)
Drawing.setAdditive(1)
Drawing.setAlpha(1)
Drawing.setColor(255 * phase31, 255 * phase32, 255 * phase33)
Drawing.setTile(tileX, tileY, 12, -365)
Drawing.drawImage(topFrame)
Drawing.reset()
end
local counter = 0 -- A counter variable
function script:update()
local daytime = TheoTown.daytime or 0
local time = City.getTime()
local freq = 0.1
local phase31 = 0.5 + 0.5 * math.sin(freq * 0.001 * time * 2 * math.pi)
local phase32 = 0.5 + 0.5 * math.sin((freq * 0.001 * time + 0.33333) * 2 * math.pi)
local phase33 = 0.5 + 0.5 * math.sin((freq * 0.001 * time + 0.66667) * 2 * math.pi)
Drawing.setColor(255 * phase31, 255 * phase32, 255 * phase33)
Drawing.drawImage(topFrame, 30,26)
Drawing.drawText('This is frame '..counter, 30, 26)
counter = counter + 1 -- Increase counter
end
the function update() works, but the function draw don't work :((
Does this script even load
You should assign values to animadraft and topframe in script:init instead of immediately
Well anyways 1 issue is that you cannot call Drawing in script:update
Like at all
thank you ๐
Are you sure?
if I remember correctly I always used Drawing in script:update
hm
i remember having to move my drawing functions elsewhere
ah right
that was because of the build menu
while in building mode the black line grid will overlap with any drawings
if you draw in update instead of drawcity
So do I
yeah i couldnt because of building mode
just keep it mind that your drawing will not be drawn correctly then
video of the problem
still reccomend doing it in drawcity so the drawing order will always be correct
this problem might be diffrent now with the new way water is drawn
Help
Hm?
Learning to program is hard because programming feels different than other skills. But programming isn't about the languages - it is about the way one should think.
SPEAKER:
Andy Harris
Interested in the stock market? Love trading? I developed my own Market Model which provides BUY and SELL signals on S&P500. Check it out here: https://...
what
How to allow bus stop in lvl 3 bridge
im not sure scripts can help you there
i have a question
if i have a GUI bound to a building, how can i make it show before the info panel of buidling
I want to make it so only my own GUI will be shown, without the information about the building
and also, how can I get rid of the black background
I thought it automatically doesnt shows buikding info
Hey guys I want to build cricket stadium in 12x12, I know stadium in TT is 8x8, but those stadiums are football stadium, but cricket stadiums are bigger u know, anybody knows something abt that
How to contact developer , or who approves plugins.
vscode is a good ide for lua scripting
is it possible to change max value of the slidebar in gui after initializing?
Yes
Return false to disable building info
how?
Use math.floor()
local value = 0
local slider = dialog.content:getCenterPart():addSlider{
x=50,
y=-34,
width=170,
height = 30,
minValue = 0,
maxValue = 0.30,
getValue = function() return value end,
setValue = function(v) value = v qty = math.floor(100 * value+ 0.5)end,
getText = function(value)
return ''..math.floor(100 * value + 0.5)..''
end
}
it's not really what i needed but thank you
it seems that this code is for showing value which is not percentage
but i needed so if i'll move one slider, the other slider's max value will change
...
setValue = function(v)
value = math.floor(v+0.5)
fVar = value
sVar = mainValue + fVar
tVar = mainValue + value
end
...
Have you tried making maxvalue a function?
bruh my siren plugin doesn't ignore illness disaster
why not filter that out then
just check for DISASTER_ILLNESS and dont do anything if its that
yeah I am doing that
I have several other disaster filtered out
I just realised I forgot to add illness just before I was going to release
I am releasing the fixed version, I hope it'll work for everyone
It's pending
Like game version
Ah
See minesweeper
I think you should look at when sound code added because it is newer
Bruh
I should probably get it off plugin store and upload sooner again
Any way to do that without just removing it from store?
I don't want to get low ratings now
But I guess not much people on store play with old versions
Still need to update it
But I will need to wait for approval again
If you edit it, it is soo easier
Well I don't thing it will get approved/disapproved in less than 3 hours
So I can change the file and update
Yes
Before it gets approved anyway
But I need to know what version to put
I may just specify the version a few numbers lower than current
To be sure
Yep
Asking just in case, what format should I use? For version
@weak mural when are you going to add "show all anims" button, because I want to finish my building and use it for it. I am not forcing but wondering if it is near or far future
Guys can someone send me a sample of a night frame code?
I am not on computer but I can leave a tip
It's just like a normal animation, but with "light":true and "light switching":true tags
(hope I am not wrong)
And everything else is just like any other animation
@random hamlet wait wait wait how about that "y" coordinate?
Ah
Well it's a bit tricky
Kulche sent a picture
All anims have y thing, though
@random hamlet can u pls sent that pic?
1 second
K
Tks
So, 0 height is at leftest point
And the taller it is the lower negative number goes
K i wish i could understand this
It's not that hard
I am not good at explaining
Basically 0 is at left. And the higher your picture goes, the lower number gets
I guess -10 y makes your anim hover 10 pixels above the center of "plate"
Have you made building floors using animations? @elder glacier
@random hamlet no
This is another useful thing
It saves plugin space a lot
Basically, you need to draw only one floor of your building
And then just stack it with code
It's good if you have repetitive texture
You need to have building base as frame, a lot of floors code as anim and top of building as anim
I'll write a tutorial once I figure out cords
Also it makes the texture easier to manage IMO, by the way
Oh ok
(this is not what you need right now probably, but I am just saying)
@random hamlet can i send u the code in dm?
Okay
K
Oh I have a guess but I can't really see it cus it's not easy to read from there
Send it in dms
How to change plugin sound , plz help
Guys I need several explainations for the new diagonal road code. Can someone help?
The heck is that?
any chance dialog this big won't fit on mobile?
or it's automatically scaled?
@potent jolt sorry for ping again but I remember you posting about using dialog for GUI stuff
how do you add stuff on it?
cant you just test it yourself
I hacked into tree planter code
analysed it
and figured out adding stuff on dialog
I guess
fart
yes I am funy
laugh
bruh so I added button somehow
it doesn't have any additional stuff but it just closes the window
fart
fart
fart
le pet ๐ซ๐ท๐ฅ
does anyone else have experience with GUI here?
Ok, so the biggest question I have, how would I move this into Theotown via my folder on Android
So that i can test
In this tutorial for TheoTown, I'm going to show you how to install forum plugins for game versions 1.9.95 and above (or Android 10 and above and 1.9.82 and above)
Also go download my fill sandbox requirements plugin ;)
https://forum.theotown.com/viewtopic.php?f=73&t=7591
Time stamps:
0:00 Intro and Explanation
0:31 The "Classic" Way
2:18 Usin...
Thanks!
What file manager do you have, like what app?
Cause mine is completely different.
The one that comes with Huawei/Honor hpones
Ok, what is wrong now?
It says so right there
also you don't put booleans in apostrophes
Same for numbers
Alright, I fixed it
@weak mural I'm making a GUI plug-in and I was wondering how I could make a window similar to yours. I noticed that yours is always anchored to the side of the screen and doesn't pause the game. Would you mind giving me a few pointers?
If draw just the 9patch it shouldn't pause the game
here you go.
how do I properly put stuff on dialogs?
I want to make something like this example (put different functional widgets)
Maybe I'll figure out the placement
but buttons just close it, even though they aren't assigned to anything
(I checked, they close it)
Create 1 vertical layout for the lines
Then for each line make a horizontal layout
And add your labels and text fields to that
What do you mean button problem
Then put autoclose on false
okay
on button or a dialog?
I guess button, based on docs
...or maybe dialog because button disappeared
nah that's a bad idea
found it
I forgot that I switched placement and that's why is there no button
finally
Osjidjdsiokl
it said "amog us" but I thought it was cringe and quickly replaced
mogus sus
I made a button which opens menu somewhere
and throws text field somewhere off the dialog (pretty cool but not planned)
interesting
maybe draw the date and time ontop of it again so its actually readable
What do you mean here jeremiah?
how do i get started on plugins using lua
and what is the use for it anyway besides ui
lua can do most things like placing buildings, move the camera, playing sounds etc
ah ok
there isnt much you cant do with it
well it should be a simple switch from python to lua right
alr then
also game of life by lobbu
probably slower, though
Make sure its good
:)
good texture or good idea, select one
good texture
I'm too stupid to make something that's not a residential
So
just a house
maybe a little cozy house

you have some good textured plugins why are you talking like that
U talk with me or with erksmit?
lol
I am both retarded coder and not that good artist
I've witnessed it with my eyes, not that impressive compared to real life
where are your textures
i mean i got 3 plugins
ah right the water tower
i do wanna improve that at some point
but i lost the pdn file
just overpaint
bruh lol
just copy paste from google maps
that's not how math works
yeah I should have said that my math is bad ๐
good
Looks absolutely beautiful
diamonds to the left please
at least shadings are right
But I will give this a 9/11
can you upload it to the forum for free pls ๐ข ๐ข
did i mention its 35 diamonds because i put so much effort into it?
also it costs 10 theons and makes 1m water
you gotta earn it yknow
now that sounds like a job for OP plugin detector
speaking of which
when is the plugin coming
what about 5* mayor dlc?
that does exist
but its far from finished
i gotta work on that again
i could clap that op plugin thingie out in like 2 days probably
inb4 you cant
should be easyโข๏ธ
Looks very realistic and well shaded, also i like the decision to put a "watertower" sign to recognize that is a water tower
had to make it clear for those in the back
Not a bad idea lol ๐
Lmao
really should try to fit the windows into the textures again
i failed last time
so i left them out
I see that category = false
That is not a valid value
And the JSON should have [] on the outsides of it
is there a function i can use to leave the currently active draft
like draftdrawer.enter but for leaving
to force a user out of a tool
os.exit()
excellent idea
basically i want it to be like a building
in the menu
and make a dialog via lua when you enter it
ima try some things
and fail miserably
@elfin geyser hello, can you explain if it is hard to make a supply-demand system like in your old-timer plugin? are you using tables and functions get to interact with each other?
Did you mean the old time on my project?
๐
no I mean how you buy stuff and use
a storage system
What plugin are you talking about?
It's nothing to do with the ingame demand system, Just a variable to store that unit then store it ingame and reload it when launched
Is there any open-source code about this?
soo you dont use tables? I am sorry kinda newbie
Yes
As of now there's not but you may refer to the theotown api
hmm
I think the best example is the tree planter tool open sourced by lobby
I am struggling to understand it but I guess it needs time
Does it have a storage system? I mean something similar to that
The tree planter also stores data ingame and reload it again you may get the idea if you figure it out
oh okay thank you soo much
It has by getting theotown storage
but it uses a slider to feed it right? Soo I want to make it have a speed to increase the numbers
like a producing building
you dont use the storage table?
oh nvm just read the rest
city and theotown storage tables persist between sessions
I didn't have the link of tree planter tool but im pretty sure there's a comment that will guide you to understand the structure
my other question is have you ever used city spawn car and target reached codes?
Clueless about that
yeah i havent used that either
I am thinking to just use car spawning and target reached function bypassing a storage system
also find it more interactive
Is this for your steel mill?
it would ensure that road connections are required
yes
but you still need the storage table to make sure the values are stored
for the next time the user starts
was going to use conveyors, rails, and trucks for it. Gotta be fun but couldn't make it work
ah can't I just make target reached signal a timer and spawn another truck, cycle goes on
Well good luck you can ask me for some instances you can't understand but you can ask ian for better understanding
you can
but you still have to keep track of the timers in the storage table
unless you reset them
Well i guess he wanted to make a stone dealership
lol
stone dealership what
excellent idea
flintstones plugin when?
Nvm just like a mine industry that you can trade stones from what steel mill mines
ah
yeah i thought hed have rescource storage
and trucks would be sent out when they reach a certain level
just a modulable port and factory components. I dont want to make mining things now. Cant even make notifications works properly
storage? why
I kinda forgor how to write lua but there was a code like " for 0,1000"
so that the user can quit and load without it resetting the timers or other values
does someone have a script to where I can cause terrible traffic along the highways?
I wish there's an easy way to do this
๐ต very confusing ๐ต
Not really
That would be near impossible
So this is lua? Not looking like what I have seen so far tho
its a declaration of a very large table
personally
id put this in the drafts meta table
It has the issue of not being expandable when trying to translate it
You expect to rewrite code to support it?
Be in the case where you want
Any suggestion about my code?
-- AIM/SHOOT FUNCTION
local function aim(x,y,f) -- f = frame
local x1 = 0, y1 = 0
for tile = 1, 30 do
if CannonAccuracy() then
if (f == 1) then
x1 = x + tile * -1
y1 = y + tile * -1
if (checkEnemyShip(x1,y1) or checkEnemyRaiders(x1,y1)) then
isEnemy(x1,y1)
x1 = 0
y1 = 0
end
elseif (f == 2) then
x1 = x + tile
y1 = y + tile * -1
if (checkEnemyShip(x1,y1) or checkEnemyRaiders(x1,y1)) then
isEnemy(x1,y1)
x1 = 0
y1 = 0
end
elseif (f == 3) then
x1 = x + tile
y1 = y + tile
if (checkEnemyShip(x1,y1) or checkEnemyRaiders(x1,y1)) then
isEnemy(x1,y1)
x1 = 0
y1 = 0
end
elseif (f == 4) then
x1 = x + tile * -1
y1 = y + tile
if (checkEnemyShip(x1,y1) or checkEnemyRaiders(x1,y1)) then
isEnemy(x1,y1)
x1 = 0
y1 = 0
end
end
end
end
end

either text or buttons
I accidentally downloaded second visual studio
great progress
it's on the wrong side but still great
how tf do i get them to display on the left side
drop your script here, so we can know
some stuff like get first part were different because I was randomly changing stuff
erksmit said to create vertical layout and then horizontal but I could've misunderstood
but probably I am doing it wrong
so annoyed
can someone help?
how do I even place stuff on dialog
properly
the problem is the height of the "vertical" layout. delete it or make it bigger.
can you share all of your scripts?
you can use getFirst/Center/LastPart() if needed and not using x/y. idk what your problems if i can't see your script.
I tried changing them but it didn't work
(from first part to center or last)
@weak mural what are you using to show window?
I mean what your window actually is?
You did not specify a width for your text frame
a
that's an only panel, addCanvas.
I thought of using it but erksmit said I can use dialog
well I think making closing function and blur n pause n stuff is a bit tricky
or they're there
idk
dialog is easier to use than you build new one
for this, you need to add getFirstPart() after the parent.
on your script is vertical
there's no size limits, but they are follow the parent size and padding as default.
I have get first part in buttons code
and in text
when I changed layouts to this just to check
it did this
not really
how do I figure out placing stuff properly
and how to set up layouts for this
Can you show the result you want?

