#plugin-lua-and-fun
1 messages ยท Page 7 of 1
I was wondering if there is an event listener that returns the city ID that was removed or reset.
Ppunish 718473535089279077
How can I detect an approaching train, everyone? For example, if I place a device tile at X and want to know if there is a train within 4 tiles around X, which function should I use? Any help would be appreciated since I couldn't find any suitable function @@
Hmm...
Am I doing the right thing?
privilege codes are not needed anymore
instead use "require privileges": true
if you have a privileged forum account and youre logged it the privilege is applied
and itll work when you publish it
Ok noted thanks.
It is possible to make animation get played when you click on building and then building get changed after animation end
Like that as example
Low quality because I wouldn't make that as plugin, just for practicing animation
Yes
I can help
Anybody knows how to fix this error?
looks like the file youre importing already exists with the same name
Want me to download shady stuff?
I not recommended
But it still suspicious
Especially when he send this on #town-memes
One in #plugin-suggestions
Hes going at it i see
You may discuss about plugin fun and Lua scripting here.
((epic))
keep it clean guys, dont pollute the name of coding (or something like?)
how do I get user name?
and so I crashed vsc without saving the lua
wanna see my scripts
my all works gone
shouldve hit save after every button press smh
it is working but cant get it on windowed
I use Visual Studio for Json....
maybe I'll make cool plugins with lua code someday
thx
Im interested in the GUI part of the TT Lua documentation
I am soo sad, my pc is that bad once I open gif search in discord web it crashes something
and vsc closed itself
Wait, you cant edit TT GUI, right?
oh well , new channel
vsc?
yes
how do I make something like f"text{var}more text" but in lua?
I mean
some text and variable in it
found it
string.format('text %s more text', var)
oh
and this too
is making disasters possible with lua?
so I can code my own
what where
forgot a comma
maybe an error with calculations
@torpid spearmaybe you know... does it count the total playtime from account?
does what count
it's session playtime probably
I also had wrong number btw
does it count time spent in menu or somewhere else but not in city?
I learnt how to do math in lua now
I am soo happi
I am like archimedes when he found water's ability of lifting things
what math did you learn to do?
btw do you have any experience in coding except lua?
I mean how complex is that math
like <= , == stuff and some other things
it is easy, I am just bad at math
gotta try the 8th lua script that, isnt gonna work
what are you trying to do now?
I was trying city spawncar and car reached event but couldnt do it soo I am gonna try something easier. Which counts buildings and gives income with some calculations
@open archwhat do you think, is this worth uploading as a small plugin?
with changed caption probably
๐
finally something I made without someone changing my codes, it worked
soo many thanks to kulche and erksmit
this is a start
This is kinda low effort and if gets disapproved, I'll get two disapprovals in a row because of this :(
hope I won't get annihilated because of that
I am going to make a stupid youtube video for this first step
ugh there is only one simple issue, and thats it gives income even tho you dont have export
is there a way to check if is road near building connected to the edge of the map?
and once you remove the older factory it still gives the income of it.. atleast it shows a life sempthom
it is sure my lua code is going to be longer and more complicated
what the fu
um....
is there any way to make cords relative to screen dimensions?
like, If i make the window smaller, text stays in the same place and I can't see it
youd have to get the screen size occasionally
id just get them in script:init
as 90% of poeple play on mobile anyways
have you tried getting the root gui element?
thatll most likely be a canvas of the entire screen
I didn't but I will
The problem with grabbing the resolution once is that the plug-in will not display correctly if the window is resized on PC (or if the player puts the game in dual-screen mode on mobile)
I would do something like
width, height = Drawing.getSize()
I think that works
Then you can use width and height to make custom UI stuff stay relative with the edges of the screen
Well yeah, that's what I was thinking
I just didn't know how to grab width and height
Actually, I think grabbing resolution once will be enough
There is not much players on pc, and I don't think most of them will start swinging their window and check if a plugin by some random Simon works with that
thats why you should first check if youre on pc
and if on pc, get it per frame
pc has enough performance that its not aproblem
Just curious, is taking width and height that performance heavy for phone?
And I think recording these parameters once is enough
Like I said though, it is possible for mobile users to change resolution through the split screen feature many phones have nowadays, so that's something to consider
I need a little bit help guys
I had two problems and now I fixed the one of them. Easiest one
Other problem is something I didnt get, here is the concept: lua counts the factories and gives the amount of income with a calculation. It was all great and working but and then I removed one of the factories and it started to overlap the new and the old income at the same time
I guess it has to reset city.count but it just overlaps it. How do I fix this?
I can give the code example from DMs if you are interested to help me
Okay, I guess I somehow fixed it with changing the city.count things from script:daily to script:update
GUI.getRoot():getWidth() and GUI.getRoot():getHeight() are the same as Drawing.getSize() but according to gui scaling settings
If you don't believe me, try this code:
local width, height
GUI:getRoot():addCanvas {
onInit = function(self)
local paddingLeft, paddingTop, paddingRight, paddingBottom = GUI.getRoot():getPadding() --in case of notches
width = self:getWidth() + paddingLeft + paddingRight
height = self:getHeight() + paddingTop + paddingBottom
self:delete()
end
}```
How can I detect when the city is in winter mode? I know there is a fun value for the winter mode setting (auto, on, off), but I don't know what to do if its set to auto
@potent jolt I cant send DMs, discord is broken soo
((amount_cokebatterychimney / amount_cokebattery) * 200) Imagine this number turning into income, what would happen if cokebatterychimney is 3 and cokebattery is 2
oh my
my math is soo bad
sorry
but what would happen if the numbers are like this? 457,5754..
maybe like chimney is 5 and battery is 3 soo 5/3*200 is 10000/3
Big number
wdym
soo it turns those strange numbers to nearest ones
yea
They become something like 1.333333333
Accurate enough
When theons can only be rounded as full numbers
oh soo that is a legit income number in theotown?
Debug.toast(TheoTown.SETTINGS.winter)
0 = auto
1 = on
2 = off
It'd probably round it to 1
You gotta use the date but idk which ones
That's annoying, and expected
I do wish there was an easier way to bind an event to a variable change
Instead of just checking if it's changed every frame
Maybe I could make a library for that
Shouldn't be too hard to make a function for it
That observes a variable and calls a callback when it changes
do you guys think if I use overlay for income once every in game year, or would it be annoying?
It wouldn't inform the user that the income came from your buildings though
Instead probably would be better to use a dialog of a yearly report
oh oh oh right there is city notifications, I might use it!
That would be best
and I might make a factory manager man saying that
Doesn't get in the way
The poeple all have their own draft IDs
Pretty sure they're available in the JSON article
There is a way to add a custom income category to the Financials screen
yep I did it
and I might also make a notification once someone puts more factories than chimneys soo the factory has stoped due technical issues
[
{
"id":"$budgetitemid00",
"type":"data",
"title":"My item...",
"meta":{
"tags":{
"budget item":{}
}
}
}
]```
this is the one I used
I should think about balancing
since it gives income
I am gonna use math for spendmoney, soo it is going to be strange to play with
amount_export > 0 and amount_blastfurnace > 0 and amount_blastfurnacechimney > 0 and (amount_blastfurnace <= amount_blastfurnacechimney) and amount_cokebattery > 0 and amount_cokebatterychimney > 0 and (amount_cokebattery <= amount_cokebatterychimney) and (amount_blastfurnace <= amount_cokebattery) then
this is looking soo dumb
I made this soo confusing that I dont even know the best combination
if you have the minumum requirements you just earn 330 monthly
1 blastfurnace and a blastfurnace chimney for it, 1 cokebattery and 1 chimney for it
there is also gas silo for blastfurnace that can add some income to it but gotta do it hard to achieve
I am done with this, it was hard to balance. I hope I did it good. It is too complicated to get the best combinations. I might make a gui that does calculations and shows "estimated income" of the current factory
I might even add explosions if there is a false combination without fixing it in a year
city.countBuildings(), it works when I decrase the amount of buildings (like 2 to 1) but once I remove all buildings it doesnt change the number to 0
I can't see it inside the code but when in game it looks like it holds the latest numbers
I thought city.count would do that
try some debug stuff
hmm
yeah there should be something
you are right, count is working but somehow, spends is still going on
one last test and I will buy seeds for the chickens
does it return 0 but still spends?
found it, it was about a bool. Probably using it in wrong way
bool works like how it supposed to but doesnt run and close the functions
thank you dude for the help
figured out screen width and height stuff
okay this is not what I should've used
need subtraction i guess
it sucks
I made the x a static number and the y relative to screen size
got the cords
PERFECT
time to test on phone
I have no idea what basic thing should I make with lua to learn it
This is as a starting project as any
I started with the text placing tool
Maybe went in a bit too hard
cinematic camera tool is cool though
That took a while to get working
Had to take the 1st version of it down cuz it literally didn't work on mobile
And touch screen UI
@potent joltdo you know why playtime counter doesn't work on mobile?
idk
sad momento
idk what should I make next
right now I am not in a mood to do sworldgen or normal plugins
world gen is complex
Actually my sworldgen is almost finished, I just need to make that customization thing
The point is
That I'll need to switch every number in formulas by a number
And some more stuff
It's easy but needs some time
Also I'll need to use a lot of global keywords which is not good
where do you guys put your notifications in? script:daily or monthly
do I need tables for notifications?
putting it daily is a terrible idea
oh sorry I meant script:nextDay
hmm okay I guess I will do monthly
Wdym tables for notifications
I though they were strange things to use but they are kinda like json, I got it
I don't understand what is that
Also arrays
I understand about arrays in python
Or something
But how can they be used in TT
Especially if they get erased after game is closed I guess
Ask I understand, arrays in TT are just arrays to
And you can add/remove stuff
I am not sure if I wrote this true but icon and text are contents of table probably
inside {}
yep
By the way
I like the idea of your plugin and it just looks epic already
I hope I'll be able to create something like this if I learn lua
Very nice
thanks, I have soo many ideas in my mind. This is just going to be start
I actually had a better idea other than counting buildings but for now this will stay
I have some ideas of stuff I can make with lua but actually I know almost nothing
I have 10 building textures and 5 truck textures left, possibly the thing that is going to take soo much time. Considering making industrial buildings harder
this is the manager for now
kingtut may have some, not sure tho
Like so you can activate it with a button and select cords and all
LMAO
sick textures
I think disasters is just destroying buildings on certain cords near activation cords, with some fancy animations
But I have no idea how to activate it using fancy button and how to make cords selection
Hm I got some nice idea, wonder if will it work
That feeling when you're randomly checking api, and see some function which feels very epic and useful even though you don't have an idea of how can you use it
lol
yes
wdym
I mean
One second
Destroy a building so it disappears but leaves this terrain on it's territory
So you can use this for disasters
you can use build
and use that dirt's draft
but you know what, you can make disasters with fun codes too
I dont know which one is harder tho
Okay
oh his old site link isnt working anymore, try this https://sites.google.com/view/retrocitycenter/theotown/plug-ins/other?authuser=0#h.p_ojHRM7bM6Ub_
you can open it and check the json
Thanks
I havent made any tutorials about custom disasters because there isn't a clear-cut way to create them
You need to have underlying knowledge of either lua or fun to make them work
Fun is okay for simple disasters, like the slime, but lua is recommended
K, thanks
I'll make some less complicated stuff before anyways
Just don't know what ones
Maybe I'll get an idea soon
You are right about most disasters being fancy animations though
Tornado, meteor, flood, nuke, etc all fit this description
If you think about it, most of these disasters just replace nearby tiles with rubble
You just have to find a cool way to do that
Maybe a black hole that expands outwards and shrinks back down would be neat
I break the code I made, it acts strange now
lots of potential with those for sure
I have a pretty cool idea for a plugin I might make with lua, may start tomorrow
But I may be overrating my knowledge
Let's see how it goes
this is smallest steel factory income
I forgot to add building monthly spends soo with that, monthly income changes from 820 to 300 theons for it
I hope this is balanced
the buildings and factories prices are near millions and you wont get refund if you remove them
dw wbyk iid
is this true
might be
management office is 1, good to go is true and total_steelfactory is 1470
notification isnt poping up, that how it is intended but it is not spending the money now
those warnings
I think I am using not good_to_go wrong
Drawing.drawImage(1, 0, 0)```
English pls
What you're doing Here is essentially passing a table to city.shownotification
{} means a table
And in lua putting {} after a function is the same as doing function ({})
It's a convenience thing
thank you, looks like I am going to look into tables
๐
my guy
it works, it does reduce the monthly spendings to quarter and removes the income and also show the dude if there is a combination fail
appearently there is a blast furnace that needs atleast 1 chimney
in future might make the dude say the exact problem about the factory
This reminds me of when I first started working on the prison expansion
That res
this is be similar to prison expansion but way simplier in coding
I mean I dont know much about coding yet
Can I have requirements for upgrades? or do we still need fun codes or lua for that
I might end up creating a ski resort pack after all
With lua to get ski resort income and stuff
like music in game?
use Theotown.playsound
which one has x and y?
yes
how do I create a sound draft?
back then you were saying me it has too complicated codes
well it has some old legacy code in there thats not understandable
and also the code to make the rgb window
how do I make a sound draft aa
gimme 1 sec
hmm soo party house is older than city.playsound
{
"id":"bluepickle.plugin.meme.song",
"type":"sound",
"file":"file.mp3",
"volume":1.0
},
thanks
correct
niceee
--[[
Update 1.9.06 should implement City.playSound function which would allow for location based sound.
In addition, it would solve the issues with leaveCity() and leaveStage() events.
]]
as stated at the start of its lua
I can now put the same sound of the factory 500m near me. I just have to record it at the roof (also at night cus otherwise there are annoying birds)
jk birds are way better than factory sounds
id just steal borrow some sounds from online
*without copyright infringement
theres probably plenty of factory sound effects out there
I remember that you can play sounds from several buildings but it's pain to make
the first sound thing I made is impos tower, it doesnt use lua but really bad
you can spam click it and sound will overlap
what is this
color
I thought we cant use color for buildings but animations
(it doesn't work so it's more than a maybe)
You do not want to do that
it's for testing
That will start playing the sound every frame
a
Then you get a table back where with which you can control it's position and stop/play it
how do I wait until disaster happens or something
there should be script event
There is
Not sure if that works for custom disasters
I mean any disaster
I think he is trying to use it for in game disasters
vanilla at least
there was a plugin tornado siren by mg but it is kinda broken, another siren would be nice
mg probably used fun**
where pickle
soo I guess it was overlapping once there was multiple disasters
lua should be better
plot twist: a pickle is just green slime in disguise
now I should learn to use events
Pickle is a DSA thing
i tried them to make a sand spider, I failed a lot but it was my first tries in lua
Blame ja for having a bad api
how do I make an event lmao((
ยฏ\_(ใ)_/ยฏ
blame it all on JA
what
I guess he meant how he uses it
nope
init works since the start of the game and update works 60fps once you are in a city
Well
oh
Technically they're event functions
there isnt events for disasters?
They just don't fall under script:event
oh okay
There is not
how do I make an event function
But you could check for a disaster daily
so it does something when disaster fire happens as example
Check for it daily
how
Then raise the function you want
City getdisaster
Then compare it with DISASTER_FIRE
To check if it's going on
I don't really understand.. every day it checks for a disasters and if it's fire it calls function which does something?
Yes
okay
wow
Using daily cuz every frame is way too often
I will try
@random hamlet I want to suggest this, make the sound come from the siren pole. It would be nicer. But I guess you are just testing things now
yes
I may try making sound play only if at least 1 siren is in city
I also had an idea of making different sounds for different disasters like in cities:skylines but It may be too hard
idk I'll see
also different siren poles / sources for different disasters also different sounds. Like nuclear disaster is https://www.youtube.com/watch?v=K_vZk1f353I
70-plus emergency sirens around the Artificial Island nuclear generating complex were tested on Tuesday. The sirens -- 34 in New Jersey and 37 in Delaware -- located within the 10-mile radius of the three reactors operated by PSEG Nuclear will sound for three minutes.
They are part of the alert system that would inform those living near the Arti...
yeah and this too ofc
yoo you write that already while I was trying to find yt link
ah you mean different poles to react to different disasters
yeah
I'll think
also you can do this, make a code that checks if any nuclear power plant is on fire and then if it is yes some sound like this plays
https://www.youtube.com/watch?v=xhWUUblpDZA I thought something like this by default
Copyright owner: [Merlin] Symphonic Distribution, Unbound Beasts
Use of content: The Northeast Russian Blues (ะจัะฐะผั ัะดะตัะฝะพะน ะฒะพะนะฝั) Venator
โSubscribe
โLike
โComent
Source : www.youtube.com
If you noticed in any of the material that infringes copyright, please report it
sounds epic tho
this is exact same sound like ra2 nuclear silo lol
actually I have a fart sound effect for testing now lol
#RedAlert2 #CommandAndConquer
this is clean, try asking in the comments sometimes they give permission
btw what does getDisaster() return when there is fire?
DISASTER_FIRE ?
it returns yea
that
probably
Returns the name of the curretly active disaster or nil if no disaster is is active right now.
I guess you need something like this
if DISASTER_FIRE == true then ...
If DISASTER_FIRE == disaster
oh
Where disaster is the disaster city getdisaster returned
that kinda strange
oh oh oh yeah , I see now
will something like this work?
yeah probably
no quotes?
' this?
Use City.DISASTER_FIRE
oo
confused ungaa bunga
I got it wrong when trying to explain what did i get wrong
City getdisaster doesn't return a string
It returns a number
If it's a fire disaster it will match the number of City.DISASTER_FIRE
o thats good
okay
now where should I put it\
because if it's nextday
it will still call repeatedly
Nextday is spare enough that it's acceptable
But you have to make sure it only gets run once
Or it will be called every day the disaster is ongoing
it would overlap if there are two nukes
just have a bool to keep track of if youre running the sound
if yes, dont do it again
then when getdisaster is nil, stop playing the sound and set it to false
will this work or no?
yes
this is too true
for the function siren right?
unless siren needs the variable it should be local
I cant hear images
and also city.disaster_fire to check if they match
maybe that's because it's debug and not Debug?
constant fard.mp3 plays
lmao
I should record this
btw what happened to your modular buildings pack and light fences
a very quick break for lua
bc I was not in a mood to draw
I'll continue very soon
I can relate
cursed
lmao
sound matching of fire and fard
https://www.youtube.com/watch?v=FbemVRN03OI I should make this for tornado
lo
https://www.youtube.com/watch?v=JoAznrsESGI turns out it's not broken
May 15th, 2014. Went to St. Paul, Nebraska to record their Thunderbolt 1003. My dad works with a guy from the fire department there and said they test the fire signal on the 15th of the month, so I had to go see.
NOTE: It is NOT mounted solely on a tall standpipe nor does it even have a standpipe. The air from the blower passes through the pole...
I think use normal tornado siren and at april fools change it with siren head one
o yeah
keep it like this. it's perfect.
this should be for pickle disaster or slime
I hope I won't get disapproved for that lol
i dont even know what this means
does the code wait until sound stops?
or it starts playing sound and continues?
@open archdo you know?
it starts playing and continues to run
otherwise the game would freeze
how do I make it run until the sound ends so it can switch the variable to false
i want to indicate if sound plays or not
you can set a sound as looping
I want to know if sound plays or no
he doesnt needs to tho
start it once and also add something to stop it
how do I stop noise though
sound?
k
something like this
yeah
should I use .stop() like sound draft.stop() ?
and from what erksmit teach me use if not is_disaster_active then
what?
I dont know how .stop works
I'll try something now
I gtg now have to water the plants
k
I messed something up with bools
nvm, fixed
time to try with actual siren
I should have a siren sound effect somewhere on my pc
can't find it tho
wait wheres the sound
yup found it
exactly what I need
just perfect
(don't mind me having random air raid siren files on my computer)
bit of a struggle but we got it
glad I made a scripting channel
so they wont ask you?
yes
ofc
hmm
siren works
I hope this is not too much bools
oh it makes sound when you leave the city, I'll fix that
it lags a bit
maybe it does too much for every day
maybe because all of your variables arent local
also it can be simplified
yandev code with bugs
I think this should work for all disasters, but I can simplify it even more
it worked with tornado
doesn't stop the sound though
I think I can put condition for siren() into the condition that defines is_disaster_active bool
and remove the variable
can you paste the bit here so i can change it
one second I'll try this myself
@potent joltcan you tell me how do I stop sound? what should I put in .stop()?
variable with sound draft?
okay, thanks
@potent jolt can you give me an example of how should it look if my sound draft var is called s?
i tried it
didn't work
just do s.stop() to stop the sound
didn't work
maybe I am doing something wrong
?
the condition calls once but doesn't stop sound
I even tried putting this into a separate function, didn't work
had to sacrifice the ladder for a test :(
it stopped randomly before 5-10 secs the tornado disaster ended though
doesn't stop with meteorite too
@potent joltthis thing doesn't work for me
I messed something up again
the function doesn't activate probably even though it's nil
put a debug toast there to make sure it gets run
It was there and I think it actually did, lemme do it again
it gets called
but sometimes randomly, because of the condition I think
@potent joltit gets called but doesn't work
I can't understand why doesn't it work
also this function is supposed to be called if these is no disasters but siren is on
but it doesn't
aaaand the function still isn't called as I can see
you're passing the draft there, not the playSound function object
how do I pass playsound
sound = TheoTown.playSound(...)
okay, let me try
it worked
thanks
works just perfectly
NO NO NO UFO WHAT ARE YOU DOING
I made a separate "outro" sound
so when siren ends it plays a fade out sounds
it stutters a bit now
Its doing the right thing
but I recorded a video
u hate amogus??????????????????????
kinda sus ngl ๐ซ
and as I already said don't mind the stuttering
@potent joltso how do I optimise it?
I remember you saying about local variable
but will it work if it's used in 2 functions?
I mean he could atleast just say "I dont want to help" then we can understand it
it's defined to false on startup (not sure it's necessary), used to check in some daily conditions and it's important in stop siren function
you can define the variable outside the function
and stilll have it local
just put local varName
at the top of your file
so I can make it local without changing code?
yes
I have this
will it work or It should be outside all functions?
yup I changed it to local there and it works I guess
ngl that siren over disasters is kind of epic
it works with pickle disaster omg
imma record
it's epic but man that stuttering
you dont need a plugin to change disaster music though
I don't need a plugin to what...
make it fard because it is literally the weakest
I dunno, the air raid siren over a huge pickle is hilarious
go ahead, take a ride
wait I can't do that in lua
why is "in" thing not an actual code
That's a python only thing, as far as I'm aware
sad
it would be an easy way to blacklist some disasters
I shot a meteorite and the game suddenly played openTTD soundtrack
I forgot that i added it, thought it doesn't work
It means I just openTTD'ed myself
youd have to make a table, iterate through the table and compare each of its elements
it would take a lot of space
and be slow
lua is very barebones
idk I just blacklisted fire by condition
(because who would start air raid siren across the entire town when a building starts burning)
hm yes an achievement
Why not just use the City.playSound then?
That's what I use lmao
until you start iterating through things
also
is it really faster than python if youre running it on java
do I look like we have a hidden python API for TheoTown?
well
i doubt that python will be faster if its also running on java
also
perhaps
Factor in the overhead and you got extreme speed
never
tru
theres really no need
i dont have a very good device but i have no noticable impact with my scripts
android api changes every year and keeps privacy and IO changes which you need to spend time to patch to support newer versions
Android development is a huge pain

Not even full Java 8 experience
i see only 1 solution here
drop 90% of the playerbase and go pc only

nintendo switch release when
or drop the 2% of the playerbase and go Java
ah yes
Lol I showed video of my siren to my friend
and then remembered he lives in Israel
._.
lua is fast until you do this
If I link my script to a building, sounds will overlap when there is a lot of them, right?
How tall could you make a building?
nah limit is not what I want to make
in 1 frame
as tall as texture size
with animations
as tall as youd like
although it will stop rendering when it goes offscreen
theoretically
hmm.........
you could use lua drawing to make sure it always gets drawn
If I wasn't on a chromebook, I think I would start breaking the game at this point in time
or at least try to
you can change building height as I remember
and add a ton of floors with animations
yes but that will stop drawing the building when the base goes out of frame
using lua you could bruteforce it
so it always gets drawn
maybe sprinkle in some optimization to only draw the visible part
if you scroll up, building height prevents that?
you can change building height
I did
I mean you should know it
but you can put it in json
I fixed my animated skyscrapers disappearing like that
you can use animations to make the tallest possible thing too but there might be texture glitches
idea: space elevator
there is a limit
fun fact
I actually wanted to do that for cyberpunk plugin
ok then you need lua anyways
nice
@potent jolthey can you give tips with optimising the script, if you're not busy or something?
I can send code to dms if needed
I made some variables local as possible
I think it lags the most because of this but idk what should I do with it
can you paste it here so i dont have to type it over
idk maybe dms? I don't really want to paste my code in public channel tbh
lua random?
I can do this
and it works
but it's not TT
also, I used math. thing in another code and It may be the cause it didn't work on mobile
(I suspect)
the amount of method calls
๐คทโโ๏ธ yeah not mine code
probably should avoid it
but... so there is no a good way to get random number?
this should be an important thing
yes
And then, the random becomes the same value every time
idk
without it, the random returned the same thing
now it returns different numbers, at least every launch
I would like to make an easter egg which would be activated with certain probability
but I'll need random
this will work on mobile?
why wouldnt it
man, lua looks complicated and people say it's simple
I mean
Depends on what are you going to make
And on who wrote the code you're seeing
Do you have experience with programming in general?
ye
i've wrote some vbs and batch programs
(html and json as well but i mean, you just assign tags and stuff)
It's actually not that complicated for real
Well, mostly
Except if it's some super complicated code
Or it's spaghetti (by me)
https://www.lua.org/manual/5.2/manual.html currently reading this
man
@misty python lol I just started with doing some print() and If conditions
And testing if will stuff from python work
I made a siren thing after 2-3 days of doing first ever thing in lua
i want to make something like this. pretty complicated for a first lua project, but i mean, where's the fun in starting small, haha
all your variables get garbage collected eventually
like they deserve
I know doing small things may not be fun
But dude
You said you don't have much experience in coding and lua
if only
once you figure out how to do 1 chain the rest is easy
watch me make these circle references
although you're not entirely wrong
System crashing IS garbage collection on its own
i'm just gonna do stuff bit by bit i guess, see what works and what doesn't, has never failed me even once ;)
you can't collect garbage from garbage
isnt the point of garbage to collect it
I thought you meant literally first project
I am saying your plugins are garbage
ok
If didn't catch my meaning
exactly
Also, if you don't know basics in lua, I recommend you making something standalone as I did
anyways
