#plugin-lua-and-fun
1 messages ยท Page 1 of 1 (latest)
Using pcall like that is bad practice
A divided time as fps sounds fancy
Deleting messages is bad practice
Hey im making my first plugin, still have to create the transparent background, but how do i code it so its all the the same building
Make the background transparent. If it is a decoration u put on the city [ "draw ground":true, ] . Remove the brackets if u want to use the code but if it is a flying plane u don't need to put that code
Add the rotation aware tag as true and put all 4 frames into the draft
#plugin-lua-and-fun message
^ #plugin-discussion or #plugin-support
also json isn't scripting
Read this channel's description and go to #plugin-discussion or #plugin-support
@stoic vector If you don't mind me ask, what plugin have you made, you seem to know alot about scripting for a new user
Sorry my bad
I am still learning
Somehow I love this plane...
its only a visual indicator
Why do smart cars despawned after re-entering city once they reached they target even there's another event will happen after it reaches the target (car:driveTo())
Send code
on JustAnyone's DM
I just used the spawner usage from the docs
I could not reproduce what you were referring to
Could you provide the full code to reproduce the problem
-- This script will wait for the player to tap on two buildings A and B.
-- After that, it will spawn a police car from A that will drive to B and
-- then back to A where it despawns.
-- This will repeat indefinitely.
local carDraft = Draft.getDraft('$carpolice00')
local startBuilding, endBuilding
function script:enterCity()
startBuilding, endBuilding = nil, nil
end
function script:earlyTap(x, y)
local b = Tile.getBuilding(x, y)
if b and not startBuilding then
Debug.toast('Selected start building')
startBuilding = b
return false
elseif b and not endBuilding then
Debug.toast('Selected end building')
endBuilding = b
return false
end
end
function script:onCarReached(car)
local stg = car:getStorage()
-- Drive back if first ending, otherwise do nothing -> car will despawn
if stg.ctr == 0 then
car:driveTo(stg.x, stg.y)
stg.ctr = stg.ctr + 1
end
end
function script:nextDay()
if #Car.getCars() == 0 and startBuilding and endBuilding then
-- Let's spawn a car
Car.spawn(
carDraft,
startBuilding:getX(),
startBuilding:getY(),
endBuilding:getX(),
endBuilding:getY(),
nil,
{
x = startBuilding:getX(),
y = startBuilding:getY(),
ctr = 0
}
)
end
end
That's based from the docs
Let's see
i cant replicate either
it's clearly said: -- Drive back if first ending, otherwise do nothing -> car will despawn
Nvm i fix it now, i just put some nil value that breaks the script
But which one
oh my god scripting is that easy?
my lua knowledge will come in SO HANDY here
Are you Com Sci major?
It is
How should i know whether the screen orientation was landscape or portrait
Not from the game settings, but like an event listener
screen height > screen width
I would check whenever the settings stage is exited, but that doesn't account for auto screen rotation
Doesn't account for Samsung z fold smh my head
height > width is to check the portrait orientation. if width >= height it must be landscape.
i think that's the only thing to do since game can't change orientation even you put values on the settings
It's not a good idea to be changing a user's settings
Is there any ways to set up scale and cast properly frames inside listbox items, ive tried showing it with onDraw of canvas and used drawing functions but it goes always outside the canvas
i dont know what you want to do
This
havent you already done that in complex industry
It aligns properly caused I'd use addIcon{} but with drawingRect it messed up
That's icon
what args are you passing to drawrect
All parameters returned by onDraw() of addCanvas{}
maybe use getpadding and getclient width/height so that you only use the inner available area
i think rn you ignore padding
addCanvas{
w = 30, h = 30,
onDraw = function (self, x, y, w, h)
Drawing.setScale(1, 1)
Drawing.drawRect( frame, x, y, w ,h)
...
end
}
This what i did but the frame wont align properly
how exactly wont it
setclipping will cut off your drawing if it goes outside the area
Ok it doesn't work
ok i want your help what is this error ???
when I go in the plugins folder i have named Cyper tower image as Cyper tower it should work right but it but it doesn't
Btw if you guys are wondering this plugin is not mine i changed the name thinking it would work but it hasn't
this was the original name and it didn't work it showed the same error
I*went into json editor and changed the id and name also
I can code it for you if you want
note that I don't know how to fly planes, and anyway it's too big to fly properly in theotown
I hate how you named your file, and i think the computer think that was a virus
I would recommend to avoid coding using other char. set
You need to change the part where it says "bmp": "some image.png"
ok
You should do your research next time, then you would've known that
bu i dont see bmp here
Read a tutorial on the forum
It's explained there
ok can you link it please
Check #plugin-discussion pins
ok minimod
Anger issue
Out of context
โ
thank you it works now
So we can't make the shadows of buildings past their frame or whatever, but is it possible with lua?
No
Ah
Probably not possible without the ability to read texture data
Ppunish @stoic vector
yewongrr#6544 was banned for the following reason: Sharing scams or phishing content.
is it possible to execute console commands via lua scripts
right
@light plinth
Is it really doing require for modules make it as global module?
I really don't know if that matters but i had the same file call transit.lua both from different plugin, i tried doing require on pluginB for module transit.lua on its folder(pluginB folder) but instead i fetched the module from pluginA, i noticed that because i tried to execute some function inside transit module(from pluginB) but it toast an error that it does not exist so i tried to toast all the keys from fetched module on PluginB and it toast all the keys existing from PluginA module
Now i tried to disable PluginA and my PluginB works fine Again without errors
im sorry?
I mean i had pluginA and pluginB, they both has their own modules with same file name and owned main script controller to fetch their modules, File tree was PluginA next is B, I tried to fetch modules for PluginB but it fetches the module from PluginA even the path was at the pluginB folder
So it's getting the module from the wrong folder because both plugins use the a copy of the module?
Ye
perhaps Lua caches modules by name?
are we gonna have to name our modules with unique prefixes
I didn't design Lua, don't ask me
actually, every modules have a name. but, if the name is exists, the first loaded module is a winner.
Ok that's what i needed to hear. Also nice i haven't try listing all items from loader before
Yeah a unique one
@weak mural
Do you have the same thing with draw Rect like this one?, Like I did not covers all the screen on phones nowadays
yes, that space is reserved for the camera notch
Just flip your phone in other way (180ยฐ) and it fixed. ๐
Nahhh its fine
Aight as i thought it should start with negative x
I dont think it has anything to do in this channel, post that in #plugin-suggestions
Ok
how do you put the plugin manifest?
I found this post, it should help
https://forum.theotown.com/viewtopic.php?t=10950
thank you
me trying to read lua error when it disappears
ask @potent jolt for his experience
how to get random value in script that isn't fixed?
should I put time in City.hash() or something like that?
math.random
ah good
everybody gangster until org.luaj.vm2.LuaError: ?:-1 bad argument: table expected, got nil
also
society if error levels actually worked
new versions of the game will provide a out.txt file containing all of game's stdout and stderr
how's that any diffrent from just reading the log
It contains everything
that is to be expected
when someone tries to iterate a nil value. lol
happens to the best of us
but the issue is that theres no stacktrace
so who knows where it happened
Does the random character before .plugin file names was the key to decrypt the plugin?
i doubt its that simple
I couldn't figure out why does my code work wrong only to realize I misspelled math.random as math.rand
And also forgot to add 1- in front of my percentage calculator which turned 20% into 80%
or at least show something is wrong
brakets
VSC but I was too lazy to install Lua thingie
Yup I will
its like 3 clicks
Anyways my global warming code is done
More pollution - more disasters (each has different probability that depends on pollution)
Now I just need to make it so you can decrease the probability/view it and that's the hardest part (UI ๐คข)
not necessarily
you can use the settings function
No I meant so you can build stuff to fight global warming
or build dictatorinator to lower riot probability
Is iterating over the entire map and adding up pollution influence a normal idea? ๐ณ
In script:nextMonth
there are serious performance concerns if you do that
Yeah that's bad
How else can I do something similar though
Can I get building influence?
i dont see functions for it
Wait wtf I just checked and there isn't
Yeah but then non industrial stuff won't affect it
And also non polluting factory plugins won't work
Which is not cool
But maybe I should make it a setting or smth so users can change it
getting pollution of every tile is probably not feasible
I should make it also depend on amount of cars/population
thats for retrieving all the cars that your script spawned
Ah ok
(this is actually very cool and extremely helpful, thanks, I will use it)
also to preserve my sanity i use https://forum.theotown.com/viewtopic.php?f=115&t=14299
now i go figure out how to make warehouses that can switch resource types for complex industry
That's a lot of work
How about we can put all the resource types at the beginning and lets just use a case after building it, like what type should it take
i can make it switchable on the go
I can't figure it out how does it work when you already occupied spaces on that warehouse
Anyway gui on the way again?
?
Generic warehouse gui
On what
About switchable
does anyone here know how to make building ui? (override the default one so I can draw my own stuff when it's opened)
I'd like to leave the upgrade button, though... so it's probably not possible
thanks
if you use script:click and return false it wont make any dialog, if you want to make it completely custom
@potent jolt I think complex industry has multiple files, how are you dealing with that?
i am not using the wrapper script
instead i use the strict lua tag, so that the game crashes when an error occurs
this does mean i do not get script reloading
lol
pretty
you probably shouldnt need require anytime soon
if you want to share data between scripts i reccomend using city storage for niw
or you can use the draft call function
okay
by the way, is there a way to make update unlocked only when the previous update is enabled?
so you need to buy update 1 before being able to buy update 2 (in a building)
oh
you mean upgrade
so just upgrades
probably
how, though, getting started links to this
because that's the tutorial
hm I guess I can try with this
the original post got deleted along with the member though
sad
(If I can add requirements to an upgrade)
ofc
just a bit scroll down this page, and you can find it.
i think you can put the requirement type as upgrade
i have some reference material somewhere
figured it out, I think it works now
for some reason a button doesnt work if I click it on the same Y as the upgrade button
if I click on the top of the check info button it works
if I click on the bottom it doesnt
huh
how did you add that check info button
that bottom row is the action button row for the dialog
my geuss is the click event goes to that layout instead of your button
just like this... (very lazy and I guess its wrong?)
you should add it to dialog.actions
alr
(im not sure if that naming is correct)
thing is whenever i add action buttons i do it when creating the dialog
i havent tried doing it after creation
dialog.controls, not content.
this worked, thanks
๐ (yeah im testing another thing again)
but if I remove the getId it works fine
ah
cropped accidentally but the line below is Builder.remove(x,y)
please try remembering it later because I have no idea tf is happening 
well
its indicative that it errored inside the tt api
which is also why there is no error line
so, you mustve passed a incorrect argument to it
and it didnt catch it
I replaced it by getBuildingDraft... lol
building has not isValid function, and use colon ":" for get/set functions of the object.
ive had this happen yesterday, the error occurs inside the tt api
that's the point, I am not using any isValid function
so I changed it to bld:getId()
and it worked
It's just me forgetting the syntax again
brug
ah
yea
that makes sense
if you use . it doesnt pass the building to getId
using : is equivalent to bld.getid(bld)
also
this implies building object has a undocumented isvalid function
yeah
hm, i need to figure out a way to retrieve all complex industry drafts
actually
callAll should suffice
where removeZone
good question
I was wondering what'll happen if I do Builder.buildZone(nil,x,y)
interesting
oh wait it actually removes the zone but I guess it reappears under the buildings?
yep it does
@potent jolt you can remove zones with builder
awesome
ah right
Builds the specified zone draft or removes it if draft is nil.
its documented as well
Can I erase garbage from roads with lua?
I assumed it was a road deco
but removeRoadDeco doesnt work with it
smth like
if Tile.getRoadDraft(x,y)~=nil and Tile.countRoadDecos(x, y)==0 then
local dr = Tile.getRoadDraft(x,y)
Builder.remove(x,y)
Builder.buildRoad(dr, x,y,x,y)
end
technically kinda works but fucks up bridges
It's a road occupation
ah okay
now for some reason bld:isEmpty() (instead of not bld:isWorking()) causes the same error, weird
Check if Tile.isEmpty works
basically, building functions are all a wrapper to tile functions
can i change a gui object's onclick after its been created
only one way to find out
didnt have all day so i patched in support for adding it on creation
just re-build it with the new onClick function.
i cant, its created by a helper function
helper?
a gui function i didnt write
sounds like hadestia
in general, you have to: get the gui object data (parent, w, h, so on) -> delete the object -> build the new object with the last data.
well you see
the function callsign looks a little like
---@param arg table contain object value
--arg.h = height [optional]
--arg.color = table of rgb values [optional]
--arg.frame = NinePatch [optional]
--arg.padding = table of values [optional]
--arg.content = table of arguments [optional]
--arg.background = whether to toggle default background [optional]
----content.icon.icon = icon or frame [optional]
----content.icon.align = table of x & y float value
----content.label.text = text
----content.label.align = table of x & y float value
----content.label.color = table of rgb values [optional]
----content.value.text = text
----content.value.align = table of x & y float value
----content.value.colorize = boolean (set color same as label of has) [optional]
----content.value.color = table of rgb values [optional]
---@return GUI[] canvas/layout
function GuiUtils.addListboxItem(arg)
besides
i simply added support for onclick to the function itself
What does this mean
What do you want to do
wait are you coding on mobile?
so I had some problems with it
so I decided to just not save these bools
only radius + blacklist
imma test if everything else works, then I'll test in mobile
and then i'll upload it
Im sure mods will find a bug and/or I'll have to rewrite half of my code
already solved using other method
had problems saving the bools?
are you saving them directly to storage
Yes as always
I forgot
You're a madlad
Respect
Hey, maybe I could try too, it'd be an awesome way of spending time when I can't get to my laptop
damn
r/madlads?
Do this object has an id? (Tool icon area)
Also the tool title before the exit button, or I'll just need to get the parent of the exit button to retrieve those
What are the lines of school-level code, everyone?
Like primary and high-school ???
"provide aspect education [low/high]": int
Please next time ask questions like this in #plugin-discussion or #plugin-support
@weak mural do you have the same problem with smart cars? Like it stays stationary when it reaches the target after city reload
Thanks in advance
I do intended to reset the route cycle when the city gets reload hoping it will fix my problem but it won't
no. smart cars are still in the last position after city reload. 
Yes it still there but after reaching its target it start remain stationary for a minutes
Deployment
event Listener
function script:onCarReached(car)
pcall(function ()
local data = car:getStorage()
local transit = Transit.all[data.terminal_id][data.id]
if transit:isTargetSpawner(data.target_id) then
transit:reset(true)
else
transit:updateStation(data.target_id, 1)
local target = transit:findNextTarget()
car:driveTo(target.x, target.y)
data.target_id = target.id
end
end)
end
How did you
are you calculating this gradient on a per pixel basis
yes.
lol
(its a test of something)
show performance impact
That's aghhh massive
well the fps is low (On my laptop) but everything's usable and I can close the dialog normally
ah
its not updated with overlay but for a split second cyan takes up a bit less than 2/3 of the pie chart
not on this screenshot though
lol
closer to 1/2 actually
if the game doesnt crash & you can close the overlay then everything is fine
already uses more resources than complex industry in its entirety
with ~30 buildings
it just makes a heightmap of the city
hills+build height
then I can do this
and thats all
but its fun
I had this genius idea for a long time
I cant use this tool on online regions :(
@potent joltis there any way to export an actual image with lua plugin?
not really
okay
I think having Tile:getMapColor(x,y) would be kinda based
this will be theotown graphics in 2015
nice
well In this image it shows all tiles on the map
but it can have lower resolution
and skip through 3 tiles
vs highest
Yeah but i mean the size of that square from the visual
Ah
Wdym, the 3D plane? Not sure
#information what does extending theotown Lua API mean?
you used to be able to add entries to the lua api tables
What could this be used for?
extending functionality, which is rather harmless
but more importantly
overwriting existing functions
Still don't really understand what could you overwrite them with
eh, wouldnt be hard to return incorrect data and cause other plugins to crash
Hello?
Lol that's thing i don't need
why is label with cords 270,40 in a different place from slider with cords 270,40
Maybe the city was rotated
I mean on a dialog
I can't figure out
(imagine if rotating the city would affect gui dialogs ๐ )
The starting cords does
As far as i know cords start at left always even rotating the city
Oh i guess im wrong
@elfin geyser do you know how to add custom icons?
I wonder if can you create a tool with selections like this with lua
and is it possible to share values between files?
I want to have a marker tool which allows to set the source rectangle the heightmap will be rendered for
but I'd need a separate lua for tool code
I like the sidebar button tho
yes
how
you will need to manage the selection state yourself
but you can use script:draw on a tool
it will be called for every tile
if you want some reference
look at the tree tool
okay
now what about this?
easiest way would be to use city storage
actually
i havent investigated usign globals for that purpose
but technically, that would be possible
interesting
(but how do I draw selection overlay with this)
local currentHoverX, currentHoverY
function script:draw(tileX, tileY, hoverX, hoverY)
if toPlaceFramesFinished then
-- draw preview if on desktop (besides the performance hit on desktop isnt a problem)
if platform == 'desktop' then
currentHoverX = hoverX
currentHoverY = hoverY
end
if validTile(tileX, tileY) then
else
-- mark unsuitable tile red
Drawing.setTile(tileX, tileY)
Drawing.drawTileFrame(Icon.TOOLMARK + 16 + 2)--what the funk is this even pointing to
end
end
end
i have this in my private version of text placer tool
it marks unsuitable tiles red
script:draw is called for every visible tile while in the tool
and you can use the undocumented Theotown.setToolfilter function to filter which tiles will be called or not
theres also TheoTown.setToolmarker but taht is undocumented as well
and i dont know how it works
this block contains a set of undocumented tool functions
registertoolaction is for placing those buttons in the top right of the screen
settoolfilter can be used to prevent excess script:draw calls
probably just smooth zooming artifacts
also maybe consider only drawing the border tiles
to save performance
theres a dedicated function for collecting those tiles
def not smoothing artefact
Just make the border tiles only visible
why cant I get this to work right
โข main child
โขโข layout
โขโขโข left canvas (w = -(layout_client_w * 0.3))
โขโขโข right layout (vertical = true)(x = -(layout_client_w * 0.3))
โขโขโขโข slider 1
โขโขโขโข slider 2
โขโขโขโข ...
Menus would take the 30% of the layout from.the right
Well then set a width for the black canvas
I'm making so you can make a heightmap of the specific part of the map
But it doesn't work for now
Oh i thought you had problem with gui hierarchy
i don't use layouts btw
Increasement of height for specific tile won't work if there's a building , water pipes or wires on it
changing game window size really messes up the dialog
makes sense
but is there any chance it'll mess up on different screen resolutions?
it should scale just fine when the dialog is made
there is no way to get fps?
I think it'd be cool to automatically close the popup if someone tried to render max resolution heightmap on a calculator and has like 2 fps for more than 5 seconds
but I'm probably overengineering this
calculate the diffrence in Runtime.getms
between 2 script;update
also
lua execution is synchronous with the rest of the game
if its calculating, the game is frozen
๐
@potent jolt how to fix
should I make the whole thing smaller because it's big even on pc?
probably
Lol
now when my lua plugins were appro... wait I wanted to finish climate change plugin
Ppunish @stoic vector
Echnon#9525 was banned for the following reason: Sharing scams or phishing content.
Why do they target us scripters :(
Probably related to scripting like,fake antivirus,bitcoin scam,NFT scam,etc...
I'm confused
๐
This is for lua or function scripting,not json.
Is there a lua function to tell music name?
not in this channel, but maybe in #plugin-support
Help me also with jason
why does that result in this if i'm not messing with alpha
but this doesn't
(multiplying by 1.0 didnt help)
*light/light works...
nvm doesnt really work
wait
im a dumbass
I used mix wrong
or maybe I didn't
lol
I multiplied mix fac by col.a and it works now
hows your shader ventures going
fine
(I created funy deepfry shader, flashbanged shader, red shader and blue shader)
(all by accident)
I want to add a bit of contrast + add atmosphere shading (dark colors become bluer)
fair
will be the most popular plugin ever
should be support for that
@halcyon jay wrong channel, please use #city-showcase next time
the fog
funky
@potent jolt check this out
I have no idea if do shaders need plugin.manifest but imma put it just in case
๋ฏธ๋์ ๋น๊ทน์ด๋ผ...
last warning. Use proper channels, this if off-topic. And use #language-bar for non english messages
Ppunish 970923962735407124
Mate , do you understand what he said to you?
์นญ์นญ์ด#8615 has been warned: Repeat use of wrong channels
It's fine, but use #language-bar to chat in korean and please use proper channels
Could you send me the src code?,just looking for references.
it was a mistake in code which I already fixed, also check #information for example
My eyes are burning
@light plinth i want to know, what the "extend" mean in this information? #information message
because i still can add a new values into default libraries, but, cannot iterate environments anymore. (1.10.78)
Ah, the extending change has been reverted. Instead, you can't overwrite library functions now.
Nice we don't need to put unique module names for each plugins
Not bad right?
why use that when you can already show notifications
actually, package.loaded can be useful for using module inside luawrapper scripts. it's cleaner than make it as global.
It breaks the package loading sandbox that has been introduced, henceforth it was removed.
is this Add table identity preservation for storage tables for more compact and reliable serialization?
It's :star2: Isolate Lua module importing between plugins
the former is because hadestia had some recursion action going on
and lobby decided to add support for it
this is to support storing 2 way table references in storage
and other cases that would otherwise result in duplicate tables
Just for fancy stuff, since all other stuff was spammed by notif that stays for a long time if you don't click the close button
Gezz i thought Script.EVENT_REPLACED was already there, why it was at .79
Because 78 was already released at the time of your request
๐ long wait again
jebaited
No no no
Textframe{}s inside listbox object are unable to scroll why
probably nested scrollable items doesnt work
Is there feature to make listbox slidable than scrollable
that's why ive suggested nested clipping twice. lol
Thx
influence is the range it covers and aspect is how many patients the hospital can have
So where can I learn the others?
Oh thanks
How do i make a decal
check https://forum.theotown.com/viewtopic.php?f=41&t=12176&p or https://forum.theotown.com/viewtopic.php?f=41&t=13353&p
this is not the channel for non-lua/fun plugin coding support, use #plugin-discussion/#plugin-support
How to make botton frames
Just like this
what do you mean
you just want to add a custom frame to a button?
simply use icon = draft in your button definition
where that button is? plugin building description?
This was my plugin
I think the mod are too strict on that
I'm not good in lua
icon = draft:getFrame(),
Were can I write the frame name
it's still unclear what are you even trying to achieve
lol
he wants a ninepatch
@cerulean crypt a ninepatch is a series of 9 frames in this order
theyre stretched to make the full button
you just want to resize the golden button or what?
also I love self promo in plugins
and then you can set the framedefault and framedown of the button to that ninepatch
self promo ๐คข
it's quite easy to draw the subs button.
Wow thanks I will try that later
I thought drawing a button was easier
I just hope it wont be always stuck on the main screen
you could use a button and use its ondraw for the sub text and logo
or just dont self promote
no 
Ahh sheesh
||I need support to grow up ||
Isn't that too complicated than doing as gui object?
it is a gui object. lol
Oh lol I thought it was done just using drawings
don't forget the onDraw field is exist
I don't understand why it needs 'do' loop
to scope local x, y, h that's will not change those from function argument if any drawing objects after that.
Ahh i see thanks for the knowledge
Yeah i got it
well, i remember what a variable is
it's electron
well then, why complain about vsc being electron when we're already using an electron application
but the electron itself is just a browser running discord react client
You see
VSC devs at least are competent
*mostly
Discord aren't
It's slow as heck
me, on the other hand
look at who decided to wake up
perfectly balanced
tf is a path
Is the26 becoming a coder now
Which lets shell know where binaries are located
shell restart is what, like explorer.exe restart or wha
cmd
or windows shell
lets you use the commands in cmd
i mean, i did sign up for a c++ extracurricular activity in school
I learned it myself ๐
Have to restart windows for java path updates to be noticed
My code is garbage tho
theres other implications but thats not your problem
But it's not like It wouldnt be if I went to c++ classes
when i install 3 java versions and always end up with the wrong one
i can make it so an object disappears when you click on it in roblox
classic
is that enough
ill never forgive minecraft 1.12
it's code anyways
chief
download lua langauge server
why would i want my pc to become a server
and mayhaps, obtain erksmit documentation
vscodium fans, where you at
of course i'd do that for a fellow chicken thoughtsโข๏ธ fanatic
code theme
(i never changed it)
lobby uses light mode ๐คฎ๐คข
lobby doesn't code under the bed like us
rtobby uses discord light what do you expect
lobby is a upstanding daytime programmer
friendship ended
Someone changes vsc theme?
why does this have one piece's logo wtff
Vue
used*
my man
reactive JavaScript framework
Close enough
its another js framework whatd you expect
i like it
thats the one thats like angular but lite isnt it
I use it with php
i should learn php
not fired on day one?
not yet
erk which one
good
first one
All of them of course
the more lua it is the better
pain
tell me more about it
lovely
rico delgado
it's good
it comes with the title
i use rem theme to assert dominance when in public
I don't code in public and I don't change themes
then I change it back
dude
because I can't see my 3000th line of code in the code preview
@light plinth HELP HOW DO I OPEN GET STARTED AGAIN
no idea
brute force
might as well wipe windows and reinstall endeavour os
you forfeited your chance to install the cute kitty ide
because kulche457 was already taken
sure, include your problem in the issues github section
YES!!!!!!!!
damn that's a lot of kulches
noobs i didn't need your help ๐
too many Polish for my liking
don't eat pierogi z serem from bar janosik
pierogi z serem ๐คข
pierogi ruskie ๐ช
now to figure out how to get the piss to spread
shut the heck up
imagine using web interface for git
cat moment
notepad for when you need to open those 3 gig csv files
anyways, @potent jolt, what is that funny erksmit documentation you want me to install
here we can see a wild erksmit searching for prey in the game Genshin Impact
now hold on just a second buster
im a programmer not a documenter
or like
actually
@light plinth exclusion of . prefixed folder when exporting a plugin when
it's just 130 kilobytes 
yea but that doesnt stop me from including the 7mb .git folder in complex industry
shut it, its machine generated
sounds like an excuse
of course it is
now shut up and let me become the most famous and talented lua programmer the world has ever seen
alright
no get writing 
how do i even start
look for the scripting tutorial ofc
getting started has a dedicated lua section
after you do the basic tutorial do real time script editing, its convenient in your case
eh i don't need gui for now ยฏ_(ใ)_/ยฏ
Yellow pad best IDE
Only professionals use online gdb for programming
Or you know, that's the impression my professors give me
Two years in and most students don't know what a compiler is
simply interpret it
Let me generate binary by hand real quick
Can't be that hard, there's only two numbers
question
if i want a function to be triggered on a daily basis, what do i need to do with script:nextDay
function script:nexDay()
some stuff here
end```
whyyy
at least the math.random works
what, i can't do this
@potent jolt you are my savior, please tell me what the heck am i supposed to do
wheres your declaration of xcoord
bro
what now
you just assigned the function building.getx to xcoord
instead of running the function
you tried to add 1 to building.getx
:clueless:
also
first off
you can only call getX on a building object, not on the Building table itself
alright
so what do you want to do
spread piss?
should i just specify the index as 1 or what
if you use index 1, you get the first building
whichever that is
cant say i know which one that will be
okay then how do i figure out what index should it be
read the doc
Gets the position of a specific building of a specific draft by it's index. The index starts with 1 and ranges up to City.countBuildings(draft).
to quote ian, anything works if you read the documentation carefully.
you can just use a for loop and range up to the building count
@potent jolt i'm dumb
how am i supposed to get the stuff that something a City.countBuildings(draft) would return?
ye
for 0, buildingcount, 1 do
get yer building
do stuff with it
end
local draft = script:getDraft()
local buildingcount = City.countBuildings(draft)
thank
you can call getdraft in script:init instead
if you do it daily ja will break your kneecaps
i would like to save my precious kneecaps
okay, but then if i get the coordinates with getbuilding, how can i make it so it spreads to a nearby tile
like, how can i modify one of the coords or smth
@potent jolt expect a lot of pings lol
lol
i got time
you can use the builder module
to build your draft on the other tile
...buildBuilding, right?
so
Builder.buildBuilding(draft, location)
how am i supposed to add to the location
let's say i have this right now @potent jolt
still not using a for loop but whatever
eh
why do you just
instead of calling the same thing 4 times
consider changing slimelocation and calling it once
documentation states a x and a y parameter for the function
but my question is, how am i supposed to edit the coords returned by slimelocation
oh hang on, do i need to like, ```lua
Builder.buildBuilding(slimeDraft, slimeLocation, slimeLocation)
okay so i am starting to make some progress
it is spreading, but not in the way i like
ah
you see
i thought youd have gotten this from roblox already
but functions in lua can return multiple values
i might've, but i probably forgor
city.getbuilding returns a x and a y paremter
you can recieve them like
slimex, slimey = getbuilding
right now slimelocation will just be the x coordinate
and youll discard the Y
does it return as a table
no
how is it returned in my case
oh now i get it
okay this is weird
gotta point out that this is exclusively a lua thing
my result happens to be weird
typically it doesn't spread
but it only spreads in the 5 locations i originally put and that stayed while the script is updated
even if demolished it just reappears
lol
Also why calling City module outside functions
well where do you get the slimecount and locations
Check your logs
oh god
i did
