#plugin-lua-and-fun

1 messages · Page 10 of 1

stoic vector
#

He barely has the height of the pickle

elfin geyser
#

How to attach multiple script into single draft?

light plinth
#

"script":[array of script name strings]

#

if that doesn't work, try plural

elfin geyser
#

Tnx

elfin geyser
#

Is there any solution for this? Or none?

I had module A that requires module B and A is attached to multiple script,

Here's my code for module A

-- module A
local mdl = mdl or require ("mdl_b.lua")
weak mural
#

remove "mdl or "

elfin geyser
#

Won't work

potent jolt
#

Maybe it causes an issue with luajit

#

Could be worth a shot

light plinth
#

luaj*

elfin geyser
#

Should i use pcall?

potent jolt
#

you could

#

but if the pcall fails you still wont have your module

obsidian light
#

How create category inside another category?

#

Also

#

How make transparent ground?

#

I tried it, but it didn't worked

slate oxide
obsidian light
#

Thanks!

#

It works! Nice

random hamlet
obsidian light
#

(sorry for my grammar)

random hamlet
#

Okay

#

I'm just saying this because having a category for a few rci buildings isn't a good thing to do

#

The buildings are nice however

obsidian light
#

Thanks

ionic zinc
stoic vector
merry shale
winter vapor
#

A dancing cat..

weak mural
tardy elm
ionic zinc
#

but enough talk here

elfin geyser
potent jolt
#

That shouldn't be a problem

#

Each script would load the module seperately

#

Does the MDL module have dependencies as well

#

It will error if MDL has a dependency your script has as well

#

You probably have a circular require somewhere

light plinth
#

circular reference*

idle musk
#

Fix Please

cerulean crypt
# idle musk

Just adjust the frame or a code for frames to right

potent jolt
#

Fix your handle

elfin geyser
#

If i used "mute lua" Should my script debug info also hide?

light plinth
#

Yes

potent jolt
#

Sounds like a good solution to forgetting to remove print statements

sour sable
#

how similar is python to lua since i know python

uncut field
#

Just Anyone might know about that

#

Lua should be pretty easy to learn though

#

This might help tho

rare grottoBOT
#
Case #E67ohX

schwarz#2450 was banned for the following reason: nitro scam

frigid sparrow
#

Knew it

#

Thanks erk

stoic vector
#

Is it possible to make energy and water go pass 100,000

#

I saw a bit of plugins with more than that

elfin geyser
#

You can, but i remember Ja said it depends on building height and size

stoic vector
#

I see

#

If its 8x8 it can be what limit

elfin geyser
#

Oh wait you're the one that ja talking to that time

cerulean crypt
#

"animation":[
{"id":"$2lrtheadlights00.anim", "pos":[0,0,0,0,0,1,0,0], "frames":[2]},
{"id":"$2lrtheadlights01.anim", "pos":[0,0,0,0,0,0,0,1], "frames":[3]},
{"id":"$2lrtheadlights02.anim", "pos":[0,1,0,0,0,0,0,0], "frames":[0]},
{"id":"$2lrtheadlights03.anim", "pos":[0,0,0,1,0,0,0,0], "frames":[1]}
],

#

Help

#

Animation for diagonal car frames pls

#

What is the pos

cerulean crypt
#

Facing

cerulean crypt
#

Eyyy

Its possible to add
Pos ..... and
Frame [facing]

For diagonal anim?

cerulean crypt
#

I dont understand

#
	{"id":"$lrtheadlights00.anim2", "pos":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "frames":[0]},
	{"id":"$lrtheadlights01.anim2", "pos":[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0], "frames":[1]},
	{"id":"$lrtheadlights02.anim2", "pos":[0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0], "frames":[2]},
	{"id":"$lrtheadlights03.anim2", "pos":[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0], "frames":[3]},
	//diagonal light
	{"id":"$lrtheadlights00.anim2", "pos":[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0], "frames":[4]},
	{"id":"$lrtheadlights01.anim2", "pos":[0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0], "frames":[5]},
	{"id":"$lrtheadlights02.anim2", "pos":[0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0], "frames":[6]},
	{"id":"$lrtheadlights03.anim2", "pos":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "frames":[7]}
	],```
stoic vector
#

Pfire

rare grottoBOT
thorn stag
#

What

stoic vector
#

The pfire command is used to notify mr firetruck man aka elderwheelman to get rid of these types of scams and more

thorn stag
#

Oh ok

#

Don't know what they gain from this trouble

stoic vector
#

Mr firetruck will take of it

#

Its fine, its common

random hamlet
#

@potent jolt

stoic vector
#

I see

#

I thought that would ping mr firetruck man to run over them

potent jolt
#

just ping an admin directly next time

#

doesnt take up as much of the chat space with the firetruck pic

random hamlet
#

that's a very cool pic tho

potent jolt
#

it do be

weak mural
# cerulean crypt

maybe the length of animation is <= 3, and diagonal frames (>= 4) are still not available. bear_shrug

cerulean crypt
cerulean crypt
#

What do u mean

cerulean crypt
#

How can I do this

winter vapor
#

wdym

full topaz
#

You mean automatic DIAGONAL?

#

Just add "allow diagonal":true,

cerulean crypt
#

I mean both diagonal and sharp turn in 1 road

full topaz
#

Wait what... I dont understand

#

(´-﹏-`;)

tardy elm
# full topaz Wait what... I dont understand

They are wondering how to implement two different corner frames: The angular turns seen on the left and bottom roads and the diagonal turn frame on the top road, because the original method for creating diagonal roads was just editing the corner frame to be diagonal.

tired escarp
#

He mean about both functions, the diagonal and non diagonal, road at the same time. I think you can't do it but having both roads is the only option i guess

winter vapor
#

I think you put the frames in the road as diagonal

last mirage
#

Pfire

rare grottoBOT
last mirage
#

hehe

#

Oh my god

#

My bad

#

I'm so sorry

#

Please forgive me

#

I just wanted to see the cool firetruck picture

stoic vector
last mirage
#

Oh

#

Phew

solid sail
#

How do i get a plane building tenplate

#

Is it somewhere in the forums? Or do i make a plane myself

stoic vector
solid sail
#

Thanks

cerulean crypt
#

Its possible to incript plugin in store?

light plinth
#

Plugin store plugins are encrypted

full topaz
# cerulean crypt

what makes you want to encrypt it?
What happened to the train station?

stoic vector
#

Hm

solid sail
#

Is there a tutorial on how to use json genie?

solid sail
#

Or just how to code a plug-in

stoic vector
solid sail
#

Nvm i found where to code it

#

But its says error when i try to import it to the game

torpid spear
#

also we can't do anything without the source

cerulean crypt
#

?

#

Car only

#

Its possible?
Only my car plugin came out of my industry plugin?

#

No other truck and cars

light plinth
#

rci cars: 0

frigid sparrow
#

okay @merry shale and I were making grass decals(and diagonal versions)

#

is there a way for the edges that touch the water to use winter frames as well when winter is on?

merry shale
#

i wonder

sweet spade
#

How would you rate because I don't know how to use pixly well

random hamlet
#

Can't really rate because unfinished but

#

The roof is wrong

#

Or maybe it's not if there is a line

#

What's this

#

Also the shape is flat

#

If you remove the roof it will be just a cube

#

The front structure is just painted on the wall

potent jolt
#

The scaling of the building front is too small compared to the rest of the building

#

Either make the front taller or the roof lower

sweet spade
sweet spade
potent jolt
#

Also your roof is inconsistent

#

The triangles all look slightly malformed

#

And the windows change in size

#

They should stay the same across the whole roof side

sweet spade
#

I know because I am a beginner I will make changes to it😑

tardy elm
#

People in TheoTown are only 3 pixels tall

sweet spade
sweet spade
tardy elm
#

I'm saying it's too big in scale

torpid spear
#

Please use this channel for scripting related discussion only.

stoic vector
#

Guys, can anyone help me? I want to make my trash cans collect garbage like landfills. Can anyone send the code written in json or guides?

cerulean crypt
#

Diagonal car light still not applicable?

#

'''"animation":[
{"id":"$teslaheadlights00.anim", "pos":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "frames":[0]},
{"id":"$teslaheadlights01.anim", "pos":[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0], "frames":[1]},
{"id":"$teslaheadlights02.anim", "pos":[0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0], "frames":[2]},
{"id":"$teslaheadlights03.anim", "pos":[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0], "frames":[3]},
//diagonal light
{"id":"$teslaheadlights00.animd", "pos":[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0], "frames":[4]},
{"id":"$teslaheadlights01.animd", "pos":[0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0], "frames":[5]},
{"id":"$teslaheadlights02.animd", "pos":[0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0], "frames":[6]},
{"id":"$teslaheadlights03.animd", "pos":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "frames":[7]}
],'''

hallow raft
#

guys I wanna make a car I have a friggin chromebook how to script a car btw?

#

or light animations instead of this

unborn dawn
#

Can anyone jason text of night anim

stoic vector
#

"light":true/false

#

"light switching":true/false

torpid spear
#

that's not what light anims are all about, I recommend using ian's tool for that

#

especially if you want to save texture space and your time on creating png frames

hallow raft
#

yup I found a tutorial in youtube and he said DESOLAN Helped him

cerulean crypt
#

Oww

elfin geyser
#

!?

torpid spear
#

@cerulean crypt please use correct channels

#

also probably works like a normal road (see pedestrian documentation)

thorn sigil
#

Is there a way to make plug ins online or on iPhone

potent jolt
#

Yes

#

Also this is not the correct channel

winter vapor
#

no

smoky glacier
#

Scam

#

Pfire

rare grottoBOT
tired escarp
#

Is it possible to have compositions without the parts ie just the compositions only

#

Also compositions but even bigger, how?

cerulean crypt
#

Yeh

cerulean crypt
#

How to deactivate the public needs in my industry

#

I mean the police and fire requirements

light plinth
#

Not possible

brave fractal
#

Okay, here this six lanes, to script this, need enable pedestrian in six lanes (sidewalk only), i mean need more realistic

stoic vector
#

I dont think the dev is in this discord

#

Or even he doesn't have one

cerulean crypt
full topaz
stoic vector
#

Fool

#

The dev of the plugin

full topaz
#

well plugin creator maker I call "creator"... And "developer" name for game creator

stoic vector
potent jolt
full topaz
#

Sowwy...

#

Btw..
How to got Theotown's animation id? I want fountain animation id for my plugins like arif's plugin

stoic vector
#

I can get it for you

full topaz
#

The water can jump up and down

#

Like the one in landmark 72 . plugin

stoic vector
#

Oh the spray fountain

potent jolt
#

its likely to be in content_animation.json

stoic vector
#

$waterfountain00

#

I cant find the animation id

full topaz
#

Ok i will try.. THANK YOU

stoic vector
#

Thats actually the fountain's id

tired escarp
#

Is it possible to make a composition but just the compositions only and not showing the parts it came from. Because I've seen some plugins where it's just the compositions but the things it came from is not visible if not absent.

idle musk
#

How can I add a night view to the car?

tired escarp
#

Is that what it was called?

light plinth
#

Perhaps

torpid spear
#

you can disable the parts by using "hidden"

#

and preferably "pickable" too

tired escarp
#

Oh ok so "hidden":true?

torpid spear
#

yes

#

append it to the components you want to hide

tired escarp
#

Oh nice so I don't have to make a separate category

torpid spear
#

why would you have to make a separate category

tired escarp
#

Anyways thank you so much mate

tired escarp
torpid spear
#

you're welcome

stoic vector
#

How do I make q disaster plugin?

torpid spear
stoic vector
#

Lua is a bit difficult

hallow raft
#

yup

#

I think it's hard as python

winter vapor
#

no it isnt

hallow raft
#

ya it looks easy

#

but if you code a full game

#

like theotown

#

it will be 10 times difficult if you're the only one who is developing it

winter vapor
#

Of course

elfin geyser
potent jolt
#

nah lua isnt that hard

#

struggling to code a full game with a language is just the limit of your coding skills regardless of languages

elfin geyser
#

How to add extra action tool into a road plugin?

potent jolt
#

what do you mean?

elfin geyser
#

The tool when building the road like "auto join"

#

Right sidebar tools,

potent jolt
#

this function is undocumented

#

but you can see in the tool that it makes a button in the top right

#

im not sure if this plugin is available outside tools

#

refer tohttps://github.com/LobbyDivinus/TreePlanterTool/blob/82257135963efef097a09645b61ef7ced27da9ef/script.lua#L195-L208

GitHub

A TheoTown tool to plant tree. It's in the game since version 1.9.30 and serves as an example of how to use UI in a plugin. - TreePlanterTool/script.lua at 82257135963efef097a09645b61ef7ced...

uncut field
elfin geyser
#

Not work

potent jolt
#

i guess its not available outside tools

stoic vector
potent jolt
elfin geyser
#

Is there any way to get the id of each icons from "Icon" Libraries? I tried to filter all animation but it doesn't show up

elfin geyser
potent jolt
#

why not just iterate over the Icons table?

potent jolt
#

makes script:draw get called for less tiles increasing performance

#

ofc

#

its undocumented™️

uncut field
#

Ofc ofc

potent jolt
#

There's also city.createdraftdrawer

#

Which seems to be pretty powerful

#

But idk how it works

#

Not to mention

cerulean crypt
#

How to reduce or off pedestrian spawning in my RCI plugin

weak mural
#

killall pedestrian don't build a road. bear_shrug pedestrian only relate to the road/deco

stoic vector
#

id is errors how to fix it

#

"location is out of composition"

potent jolt
#

did you give the proper width and height to the composition

#

local function wait_for_gui()
    if GUI then
        run()
    else
        Runtime.postpone(wait_for_gui)
    end
end

local shouldRun = true

function script:enterStage(name)
    if shouldRun then
        shouldRun = false
        wait_for_gui()
    end
end
#

now this is scuffed

light plinth
#

recursive function

#

+10 social credit score

elfin geyser
#

Is there a function to get if the ground is a slope?

potent jolt
elfin geyser
#

Great thanks

potent jolt
#

dunno about checking what kind of slope though

potent jolt
#

gui table can exist and gui.createdialog still wont work

#

mfw gui.createdialog exists but doesnt work

#

you'd think gui.createdialog would work in script:overlay after gui has been drawn

#

but youd be wrong

#

@light plinth i remember now i stopped working on it because i couldnt figure out a reliable way to show a dialog directly after startup

stoic vector
#

@stoic vector hello

potent jolt
#

Will do

elfin geyser
#

Maybe there's a function to open a dialog like ".select()"

potent jolt
#

¯_(ツ)_/¯

#

ive tried everything i know

#

so far my best solution is simply to run it a second later

#

but

#

this isnt consistent on mobile so i need something better

light moon
#

Can anyone give me a link to a tutorial for animation on forum?

thorn sigil
#

Someone help

light plinth
#

Expected array, but object was provided instead

thorn sigil
#

What that mean

south garnet
#

You forgot to add [] in the beggining and in the end

thorn sigil
#

Oh

#

@stoic vector Srry for ping

stoic vector
#

Is anyone have school json?🗿

torpid spear
#

schools don't have scripts

hybrid knot
#

theirs jason’s for schools?

torpid spear
#

use "influence education"

#

and "provide aspect education low"

#

if I remember correctly

#

refer to the forums

potent jolt
#

just look at the in game json published on the forum

torpid spear
#

or use the actual tutorials

potent jolt
#

or that

#

im not gonna do the work for you

merry shale
#

forum moment

stoic vector
potent jolt
#

find it its not hard

#

its somewher in the resources section

crystal igloo
#

Didnt know the game told u if u had op plugins

potent jolt
#

it checks for them

#

no ui for it exists yet

stoic vector
stoic vector
#

Boned

potent jolt
elfin geyser
stoic vector
potent jolt
#

yes

stoic vector
#

Oh

#

Then how i donwload / copy the json?

potent jolt
#

just use any text editor

stoic vector
#

Owh

full topaz
#

Why everyone's name has "gaming" letter?

stoic vector
#

marco gaming

#

pickle gaming

#

woman gaming

merry shale
#

justanyfour gaming

potent jolt
#

erksmit gaming

south garnet
#

Justanyone gaiming

potent jolt
#

Finally

#

Ja gaming

stoic vector
#

Fu. My school plugin error 🗿

#

Which one to make school plug in?🗿

merry shale
stoic vector
#

Is there a spawner tutorial forum?

potent jolt
#

yes

stoic vector
#

can you send it?

potent jolt
#

no

merry shale
misty python
potent jolt
elfin geyser
#

An op signage

south garnet
potent jolt
#

this was the easiest to find sunglas

visual scroll
#

Do you know what's wrong?

thorn sigil
visual scroll
#

Yes

potent jolt
#

Error says you didn't

#

Ensure your entire JSON is enclosed by brackets

hallow raft
potent jolt
#

the json is valid

#

but tt expects an array first then the object

stoic vector
#

How do i code a custom category

potent jolt
stoic vector
#

Thanks erkburg

snow arrow
#

hi

#

Does anyone know the code that spawns many helicopters from 1 helipad ? :v

potent jolt
#

You can't

hallow raft
hallow raft
#

you can't

#

in this point

stoic vector
#

How do i code in monthly income

#

Im making a landmark that gives me 200 Theons a month

torpid spear
#

"monthly price":-200

#

probably

#

you need to be privileged though

stoic vector
#

Oh thanks

stoic vector
#

I think i typed the influence wrong

#

Wait i think i forgot to put a ,

stoic vector
cerulean crypt
#

Line 21

potent jolt
elder glacier
#

i know this sound like a stupid question

#

but how to change the height of the building?

torpid spear
#

not scripting related, that do you mean by 'height'?

#

as in where to put notifications?

elder glacier
#

well that no energy icon should be in top of the building, not in the middle like that

#

so i think that i could the height?

torpid spear
#

probably "building height" or something similar

elder glacier
#

i see

#

thanks for help

torpid spear
#

you're welcome

elder glacier
#

got some problem guys

#

so i was using the same frame i used on a building

#

to use it for its lower version

#

but i cant found the lower version in the game after i coded it

#

for visualization purpose

velvet sigil
#

Belgium and russia?

elder glacier
#

ye lol

elder glacier
#

nvm guys

#

i found out the reason

#

turn out i set the code file to .txt

#

not .json

#

a "h" moment i suppose

merry shale
#

lmfao truly a h moment

stoic vector
old moat
#

sometimes it happens to me

stray trail
#

what programming language does theotown plugins use

#

it looks like java

elder glacier
#

i dont know much about the coding stuff but

#

i heard that it's json

potent jolt
#

json is not a programming language

#

most plugins are in json

#

some also use lua

elder glacier
#

i see

#

so the game's programming language is java, right?

potent jolt
#

yes

elder glacier
#

understand

stray trail
#

darn, I am not good at java.

potent jolt
#

java is not used in plugins

stoic vector
#

Only json

#

I think

uncut field
#

No

#

JSON doesn't use java language

potent jolt
#

JSON is not related to java whatsoever

#

its simply a way to store objects

light plinth
#

But that's a stretch

potent jolt
#

fun?

light plinth
#

If no java code

#

the used json is worthless

potent jolt
#

well

#

yeah

#

but thats like saying typing something into google is javascript programming

light plinth
#

if you can do that, you found a vulnerability, so it is possible to some degree lol

stray trail
#

are there any documentation about theotown plugins?

potent jolt
stray trail
#

Aight gocha

#

At first ill try to create the simpliest plugin

potent jolt
#

a small plugin is always a good idea

elder glacier
#

Ye

cerulean crypt
#

Except of 64 animation frames for road deco

What is other way to make rotatetable road decoration?

#

Like this

stoic vector
cerulean crypt
stoic vector
#

Do i have to put a $

potent jolt
#

Yes

stoic vector
#

Back to messing with the code

tender knoll
#

Anyone can teach me how to use lua?... :(

potent jolt
#

not really

#

thats something you need to learn for yourself

hallow raft
#

can someone put the code of education population thing?

#

like the residential building

elfin geyser
#
"provide aspect education low": 10
"provide aspect education high": 10
tired escarp
#

@elfin geyser hey you mate I need your code for the arty. Also lateral aim/view is going to be added

elfin geyser
#

For lateral aim view simply add a tile check for different directions and change the frame of the current tile based on what frames fits that direction

stoic vector
#

Do i have to put a square end bracket?

south garnet
elfin geyser
#

Is there a function to spawn lightning on certain pointss?

pine swallow
#

Hello

elfin geyser
#

did you mean 'hey google'?

stoic vector
#

ok

potent jolt
#

I'd see if you can find out how the game spawns lightning

#

If that doesn't work you can always just find the IDs of the lightning animation and audio and use those

potent jolt
#

And just manually remove the body

elfin geyser
#

Why do you need to make your stair as bus depot

stoic vector
#

*bus stop

elfin geyser
#

bus depot i swear

hallow raft
#

Usage: NAN%

elfin geyser
#

Is it possible to register a command that will parse the inputted string from console with pattern?

The registered command will be: (for example)

TheoTown.registerCommand("state{%a+}",...}
light plinth
#

No

#

The parsing must be done manually with the callback function

hallow raft
#

can you give me a script of x

#

handle y thing

potent jolt
#

no

#

thats something you have to set manually

misty python
#

Mostly through trial and error

potent jolt
#

i translated the tt luadocs into emmylua annotations recently

#

if youre interested

#

it will make tt lua programming easier in vscode

stray crater
elfin geyser
#

@potent jolt can you make a module that will set the view of user up to the targeted position smoothly, it's really like your cinematic camera but works like the ingame notification that has a "target button" That set the view to the building who owned that notif. I know it's easy for you to do thia since you've done your cinematic camera.

potent jolt
#

The scripts for the cinematic camera are available

#

You should be able to just grab those

stoic vector
#

How do i steal car frames

elfin geyser
potent jolt
elfin geyser
#

Love it

#

Ahm btw why your cinematic camera always start reversely

#

Waypoint 2 - 1

potent jolt
#

the whole waypoint mode is pretty scuffed

#

the camera might also teleport to a random spot in the city sometimes

#

especially when first using it

#

i dont know why

potent jolt
#

I can answer any questions you have about the code if you need

misty python
#

@potent jolt camera zoom out for cinematic camera

potent jolt
#

Wdym

#

I gave the cinematic camera dynamic zoom level support already

misty python
#

you can program waypoints to make the zoom change perhaps

potent jolt
#

Hn

#

I could

#

I gotta redo the whole waypoint tool anyways

misty python
#

and maybe also have a "smooth transition" kind of thing where the camera zoom changes while moving from waypoint a to b

potent jolt
#

Hm

misty python
#

speed could also be useful imo

potent jolt
#

I'd have to check if zoom can be that smooth

potent jolt
#

Or between waypoints?

misty python
#

ah

#

between waypoints yes

potent jolt
#

Ah

misty python
#

cinematic camera tool deluxe edition

potent jolt
#

Yeah that's not supported right now

#

But it can be

#

Premium version

misty python
#

costs 31 diamonds

potent jolt
#

Lol

#

I will have to check if I can set any zoom level or not

#

Should be able to

#

I'd have to make some like

#

Bezier curve function

random hamlet
#

Guys what would be a way to make the player select a rectangle area on map (like when building ground tiles or idk) and then get cords if it?

#

Using tools, in Lua

potent jolt
#

you will have to track whether the user has already tapped once or twice

weak mural
#

just declare a table and get coordinates with script:click

local rect = {}

function script:click( x, y )
  for i=0, 1 do
    local keyX = 'x'..i
    local keyY = 'y'..i

    if not rect[ keyX ] and not rect[ keyY ] then
      rect[ keyX ] = x
      rect[ keyY ] = y
      return
    end
  end

  -- do something
  Debug.toast( Runtime.toJson( rect ) )
  rect = {}
end```
elfin geyser
#

Why i can't do tonumber()? I tried to toast the values but toast an error, Now im still using force arithmetic convertion "4" + 0

#

Also what is the draft id of Icon.PLAY? i need it for preview frames

potent jolt
#

Have you spelled tonumber correctly? It shouldn't ever error

#

If tonumber gets an invalid number it should just return nil

elder glacier
#

so

#

guys

#

how do i

#

rotation aware🙀 😳

random hamlet
#

Release the kirovs

full topaz
#

Make sure the order of the png buildings is correct

elder glacier
#

wait but

#

do i put the building into one pic

#

or seperate it

full topaz
#

If they are separated, they are sorted correctly

#

If put together, they must be arranged in a neat order and use the h and w coordination (like making a car json)

elder glacier
#

dang

full topaz
#

↘️↗️↖️↙️

elder glacier
#

ok u i have seperated it

#

so what to do next

full topaz
#

Maybe you can see a reference example in the San Francisco bridge plugin

#

It uses a rotational modulable support system

elder glacier
#

i see

cerulean crypt
#

How can i hide recent use tool in recent category ?

elfin geyser
#

There's a :setVisible() class on drafts

lucid lagoon
#

How does one place new categories into "$cat_service00"

potent jolt
#

In your new category draft set category to cat_service

#

Just like any other draft type

lucid lagoon
#

Okay awesome thanks, it was bit confusing for me.

elfin geyser
#

What script function is useful for drawings that can be seen on screenshots

stoic vector
#

How can i make something placeable on both land and water

#

Whats the code

torpid spear
#

"needs land" and "needs water"

stoic vector
#

All set to true?

torpid spear
#

yes

stoic vector
potent jolt
#

what if you put both false lol

#

placeable nowhere

stoic vector
#

Unplacable

torpid spear
#

lol

stoic vector
#

Except in the air

elfin geyser
#

Building can be built if only one its tile is on the water

"needs land": true,
"needs water": true

Building can be built anywhere even it's all tiles are on water or land

"needs land": false,
"needs water": false
stoic vector
#

What x value?

stoic vector
#

Do i have to remove the extra

},
{

torpid spear
#

yes, you do

potent jolt
#

yes

#

if you do not specify the picture with bmp

#

the game will try to look into the world texture

#

since you didnt specify x it errors

cerulean crypt
#

what does it means?
"moveable":false,
"chargeable": false,

torpid spear
#

moveable is pretty obvious - it tells whether the building can be moved

#

and please refrain from using this channel for non scripting stuff (again)

random hamlet
#

Me when people post json here 😡

torpid spear
#

😤

tired escarp
#

Up until now i haven't use this. What really the use of privileged code?

potent jolt
#

privilege code is used for plugin functionality that could be exploited

#

like monthly income

tired escarp
#

Oh

random hamlet
#

Question

#

Theoretically, if I made war plugin with Lua (trollface) (just theoretically I won't probably), it likely won't get approved to plugin store?

light plinth
#

depends

#

whose trolling who

#

the plugin creators

#

or the moderators

random hamlet
#

I doubt I have enough skill for that but the concept of some combat plugin is very interesting

uncut field
#

I'd look into Age of Sail

#

It's the only plug-in I know that's added any sort of combat

#

The whole plug-in is very impressive

stark smelt
#

Okay

#

Whats value for fire department

elfin geyser
elfin geyser
#

Hello, I tried custom ninepatch, only frame at bottoms and the first 6 frames are null but it didn't cast isn't really the game intention not to cast first null frame or a bug?

hollow radish
#

how do I write the night frames if I have 2 frames like this?

cerulean crypt
#

Add "rotation aware":true,

hollow radish
#

even if it's not a rotationable?

cerulean crypt
#

"animation":
[
{"Id":"H1a light","frame":0},
{"Id":"H1b light","frame":1}
]

#

If u have more rotation just add
frame 2 = 3rd rotation
Frame 3 = 4th rotation

hollow radish
cerulean crypt
#

Animation

#

For night

cerulean crypt
potent jolt
hollow radish
#

oops sorry

full topaz
#

BRUH THIS IS SCRIPTING!!!

#

Sorry for caps

sweet spade
#

yes i know

south garnet
full topaz
#

Correct 👆

sweet spade
#

I just want people to see it

#

what xd

#

I'm afraid please don't do that to me

#

🙂

random hamlet
potent jolt
wary pewter
#

^

random hamlet
#

^

elfin geyser
#

Does button text color are changeable?

weak mural
#
button:getChild(1):setColor(r,g,b)
elfin geyser
#

Nice

elfin geyser
#

Hello, I'm having a problem with plugin settings i used Util.optStorage() and TheoTown storage for saving values , settings works fine ingame it, change values but didn't save when you exit the game and always set the values to default upon Initialize

#

I'd also try direct saving on TheoTown storage without used of optStorage but still wont work

weak mural
#

can i see the code?

elfin geyser
#

Nvm it's fixed, that isn't a proper way but i move the initializer(value loader) on the other script

potent jolt
#

You're probably assigning a variable by value where you intended it to be by reference

elfin geyser
#

No i used

stg.value1 = stg.value1 or false

--2nd attemp was
stg.value1 = stg.value1 == nil and false or stg.value1

Which both not get saved value i want, n only works when i made transfer them to other script

potent jolt
#

that should be fine

#

how do you obtain stg

elfin geyser
#
stg = Util.optStorage(TheoTown.getStorage(), id, {})

And also (for 2nd attemp)

stg = Util.optStorage(TheoTown.getStorage(), id)
#

Actually what i conclude here in my script is

function script:init() with getting values and function script:settings() are not work accurately on same script

potent jolt
#

thats strange i do not have any issues with it

elfin geyser
#

Well mysterious logic

#

"If it's work, don't touch it"

potent jolt
#

youre not accidentally making it global right?

#

i do it like this

#

where settings is a local i defined at the start of my script

elfin geyser
#

I looked up about your cinematic script before that made me confused like "why it's work in his script than mine"

potent jolt
#

no clue

#

i dont think i do anything diffrently

elfin geyser
#

But it's fine now on the way i did, and i gues that's important thing for now

uncut field
#

Is there a function for getting a player's game ID? I swear another plugin used this a few years ago, but I can't find the function in the API docs.

elfin geyser
#

Wait

#

Why you want to get them?

#

Isn't TheoTown.getId()?

#

If only it can connect to data base

#

Well sounds fun

#

I suggest there was a global chat box ingame

potent jolt
#

Society if lua networking

light plinth
#

no

smoky glacier
#

But to be în only english not even language of the globe

potent jolt
uncut field
uncut field
potent jolt
elfin geyser
#

Why not generate randomly on some rate

uncut field
#

I figured I could just use the ID so it would be consistent

elfin geyser
#

👍

stoic vector
potent jolt
#

Nice ui

elfin geyser
#

Scripting?

#

Theo Town are now in html

cerulean crypt
#

May I know what is meta tags for DSA supply cars

stoic vector
#

I would absolutely love to see this UI in the game

elfin geyser
#

Can someone help me how can i mske this moveable

#

The script

wary pewter
#

@unborn relic

unborn relic
#

yep Quin got it already

potent jolt
#

Then you have access to the x and y position of the canvas letting you calculate the relative position of the text

uncut field
#

Didn't ian make a module for movable gui stuff?

potent jolt
#

movable button yes

#

im not sure why you would want a movable button and nothing else

elfin geyser
elfin geyser
potent jolt
#

id check with ian to see how he did it

#

probably taking in the position in ontap and using that

elfin geyser
#

Hello is it possible to mark specific building by its id like this on script:draw() for tool?

potent jolt
#

none that i know of

#

but if youre using script:draw in a tool remember to set the tool filter to increase performance

#
    -- Use filter for draw function for better performance since 1.9.33
    if TheoTown.setToolFilter then
      TheoTown.setToolFilter{
        water = true,    -- Call it for water
        building = true, -- or for buildings
        road = true,     -- or for road
        mouse = true     -- or for mouse location (desktop only)
      }
    end
#

as always, its not documented

uncut field
#

lol

elfin geyser
#

Does TheoTown.getUserName() will still return the name even i logged lately and i turn off my connection and call this function, cuz im still logged in even i restart the game without connection, so i think my username is still on the cache

light plinth
#

Yes

stoic vector
#

hi how do i start making plugin is there any spreadsheet or reference or guide on how to code stuff (im using note++)

potent jolt
#

would you like to make a normal plugin or are you looking for lua scripting

#

in any case

stoic vector
visual scroll
#

What wrong?

torpid spear
#

not scripting. please

potent jolt
#

Also, you missed a comma after the author line

visual scroll
#

Ok, 😅 I'm forget

wary pewter
potent jolt
#

Yes

#

Although I doubt it'll be a good experience compared to desktops

#

You'll need an app for drawing images and one for writing json

#

With that you can make plugins on mobile

#

Oh and a file manager

#

Try this maybe

#

No json knowledge required

misty python
stoic vector
#

How do i apply fun attributes into my plugin

#

Im curious how it works

elfin geyser
#

First time?

elfin geyser
crude gale
#

hello! how can I group my plugins?

gleaming egret
#

you should create a category first

potent jolt
#

Check the category tutorial on the forum

crude gale
potent jolt
gleaming egret
# crude gale how do I create a category?

paste this in json and change its name.
[ { "id":"$cat_sample00", "title":"Category", "category": --this is where you can put your category "type":"category", "ordinal":1, --what is the ordinal of your category? if it is first, second, or third. "hide id":true, --this function hide your category id when users are in debug mode "frames":[ { "bmp":"sample bmp.png" } ] } ]

crude gale
#

or check forum

#

ok

#

gotta check forum first

gleaming egret
#

yes

gleaming egret
crude gale
#

i can't understand ["category": --this is where you can put your category] this.

gleaming egret
crude gale
#

in terrain

gleaming egret
#

then put in category "$cat_terrain"

#

bc thats its id

elfin geyser
#

But if you're plugin is type terrain it will automatically there

gleaming egret
#

yes

gleaming egret
crude gale
#

How do i know the ids of the categories?

gleaming egret
#

turn on ur debug mode

#

go to ur tools and u will see an ids in top of it.

#

when ur inside of evry categories.

crude gale
#

ok!!

#

thanks 🙂

gleaming egret
#

np

stoic vector
crude gale
#

ok

#

@gleaming egret I cant see any ids in top of it

gleaming egret
#

then ill tell u here

#

@crude gale check dm

crude gale
#

I have 1 more question

gleaming egret
#

??

crude gale
#

How can I rotate my plugin/add a variants in my plugin

gleaming egret
#

I can't teach u anymore

tardy elm
gleaming egret
#

im busy

crude gale
gleaming egret
#

check forum

crude gale
gleaming egret
#

@crude gale check dm for json script

tardy elm
# crude gale cant understand 😦

If you're on mobile, go to #plugin-discussion and swipe left, it'll show a screen showing the people on the server, on the top of the screen it says pins, click on that and there would be a lot of helpful stuff for making plugins

crude gale
gleaming egret
crude gale
potent jolt
stoic vector
#

Scripting is lua

potent jolt
#

or fun

stoic vector
#

And fun attributing

gleaming egret
#

idk what that means so srry

potent jolt
crude gale
#

Just I said I didnt understand the explanations.I want to watch Theotown tutorials in yt but nothing helped me there.

gleaming egret
crude gale
#

yes

tardy elm
gleaming egret
# crude gale yes

im not showing u any vids, im only teaching ppls using explanations.

#

srry

#

gtg

crude gale
stoic vector
#

You really don't understand everything do you?

#

No offense

potent jolt
crude gale
#

ok

nimble charm
#

how do i add

#

upgrades again

potent jolt
nimble charm
#

ok

rare grottoBOT
#
Case #dwtwsI

human-san#6090 was banned for the following reason: nitro scam

brazen sluice
#

60 90
69

potent jolt
#

grow up

brazen sluice
#

0042

merry shale
#

the case name would be a great nickname

brazen sluice
#

@merry shale was banned for the following
reason: nitro scam

merry shale
#

i thought you're pidroid

brazen sluice
#

Bip bop, bip bop

topaz bloom
elfin geyser
#

Haha

tired escarp
#

The numbers mason, what do they mean?

stoic vector
#

sauce code?

stoic vector
#

im sorry my brain couldn't stop it

#

No secks in thoetow sever

merry shale
#

rule 11

#

‼️

smoky glacier
wild oar
stoic vector
stoic vector
strong cedar
#

Does anyone know how to get the plugin to appear in the fire department category?

stoic vector
elfin geyser
#

How to change frameDefault and down of button objects? Not to create a button with custom frameDefault and down

potent jolt
#

you want to change it after the object was created?

#

presumably it should be setFrameDefault

elfin geyser
#

Yes exactly like that

elfin geyser
potent jolt
#

no clue

elfin geyser
#

I guess ill debugtoast keys in that object or maybe will got nothing

potent jolt
#

might be worth a try

safe depot
stoic vector
safe depot
#

I'm russian, I'm bad understand English

stoic vector
#

This is for Lua and Fun Scripting good lad

#

If you wish to communicate in your native language you shall enter #language-bar

safe depot
#

I'm coding on python 🦛

misty python
#

that's a hippo, not a python

safe depot
mellow depot
#

Hahaha

stoic vector
potent jolt
thorn sigil
brazen sluice
#

lobby

winter vapor
#

You already saw that guy while sleeping

mellow depot
stoic vector
#

Wot you find amogus funny even though that joke originated 2 years ago🗿

mellow depot
#

Where is amongus?

stoic vector
#

I drunk

mellow depot
#

Ok)

stoic vector
#

Hello. I was looking at edited photos of TheoTown made with photoshop or something like that. And asked a question… Is it even possible to do something like this? It is clear that these wont be shaders like in minecraft, it’s impossible. But remembering the graphics settings (gray classic, etc.), I wondered if it was possible to make my own filter. in theory, find the file responsible for color saturation, and make something that will resemble a picture.

#

(I’m not sure if this is the right channel to ask that)

uncut field
#

It's a really nice screenshot though

elfin geyser
#

Hello,

Is this how "Util.collectRectTiles" Collects tiles? Or this is a bug for this hollow?

potent jolt
#

Read the docs, looks like this is the intended function

elfin geyser
#

Ahh i thought tiles inside are included

potent jolt
#

Doesn't look like it

#

Shouldn't be hard to write yourself though

elfin geyser
#

Yes, but i thought it will make my work easy with this function

potent jolt
#

I bet it's hollow for performance concerns though

#

Dunno if performance would hold up if you called draw for every square

elfin geyser
#

I made a test if tiles inside are included like that red toolmark it turns red when it matches certain building inside

potent jolt
#

ah

#

yeah ive done that too

#

lots of possibility with that

elfin geyser
#

Ah yes at least i could make dead range with this

potent jolt
random hamlet
#

If someone edited that, then it's possible to do with simple shaders

#

Just not with the tools theotown has for now

uncut field
potent jolt
#

the lua api has no functions for reading the contents of a frame

#

if you were skilled enough you could probably make a flowing river plugin or something

mellow depot
#

Мaybe there are built-in filters?

#

Or we can add filters in the game

#

But shadows are trouble

potent jolt
#

As far as I'm aware we just cannot

mellow depot
#

There are already some filters in the game, so we can try to do something like this

#

but it requires cooperation with developers

potent jolt
#

It would require their help yes

#

But they'd probably say that it's too heavy on performance to leave up to lua

stoic vector
#

Of course. It’s impossible to make the filter with shadows, so we just change the colours

potent jolt
#

You can use a overlay via lua drawing or overwrite world texture

#

Overwriting world texture is simply a bad idea

#

But drawing a overlay wouldn't really have much effect

low jewel
strong cedar
uncut field
#

Or are you talking about something else in the photo?

stoic vector
#

Colors setting

#

I want to make my own

uncut field
#

Oh, I see

potent jolt
#

we cant really

uncut field
#

The best thing you have are overlays

potent jolt
#

yeah but i doubt a static color overlay can give the desired effect

potent jolt
#

Man I hate that errors in GUI event functions get supressed

stoic vector
#

I frogor the link to the lua docs
What line am i supposed to put first in a lua

potent jolt
#

There's no required lines

stoic vector
#

Basically a simple code

potent jolt
#

It helps if I knew what you were trying to do

stoic vector
#

I want it to set every tree on one map on fire

potent jolt
#

That's pretty easy

stoic vector
#

Also make a light pollution influence

potent jolt
#

Simply issue the fire disaster in every tile

#

Then wait for 10 minutes as the game processes what you've just done

stoic vector
#

Writing that down in me old notebook

stoic vector
potent jolt
potent jolt
#

mfw you cant make dialogs in settings stage

#

anyone know a resource for the in game sound drafts

stoic vector
#

I have the mp3 files

#

But not the drafts

potent jolt
#

i just need the button press sound

light plinth
potent jolt
#

ye i forgot about scale not being linear in the first place

potent jolt
#

when lua doesnt have a clamp function

#
            local randomPos = math.random(cityHeight - MIN_DISTANCE * 2)
            if randomPos >= current - MIN_DISTANCE then
                randomPos = randomPos + MIN_DISTANCE * 2
            end
#

now thats an improvement

#

from ```lua

        local function belowCurrent()
            return math.random(current - MIN_DISTANCE)
        end
        local function aboveCurrent()
            return math.random(current + MIN_DISTANCE, cityHeight)
        end
        -- check if point isnt too close to city border
        if current + MIN_DISTANCE > cityHeight then
            return belowCurrent()
        elseif current - MIN_DISTANCE < 0 then
            return aboveCurrent()
        -- decide whether to go above or below current point
        elseif math.random() > 0.5 then
            return aboveCurrent()
        else
            return belowCurrent()
        end
weak mural
potent jolt
#

wut

#

let me have another try

#

well that didnt work

#

i want to show a dialog when a setting is clicked

#
{
            name = 'show first start dialog again',
            value = settings.firstStart,
            onChange = function ()
                Runtime.postpone(showFirstStartDialog())
                --settings.firstStart = not settings.firstStart
            end
        }
#

end:333 bad argument: function expected, got nil

#

hmm

weak mural
#

try with a blank dialog. if there are no errors, there is something wrong with your plugin settings value.

potent jolt
#

ah right im an idiot

#

nah i ran the function

#

instead of passing as an argument

#

well

#

now it simply doesnt do anything

#

nah looks like doing it in the settings onChange event function is a no no

#

dang it worked

#

didnt expect that

#

ah

#

looks like it does not work when runtime.postpone does not have a delay

#

running it with a delay of 10ms also does not work

#

while 100ms does

#

wack

#

sure hope that behaviour is consistent on mobile

potent jolt
#

lua back at it with the excellent error reporting

potent jolt
#

society if i knew how city.createdraftdrawer worked

potent jolt
#

ive managed to enter a tool draft with it

#

now i need to find out how to exit it

elfin geyser
#

Me used module just to pass values from one to other drafts

potent jolt
#

lol

#

doesnt a module get loaded as its own instance every time though

elfin geyser
#

Two script uses one module

potent jolt
#

that shares variables though?

#

i assumed both scripts would create their own copy of the module

elfin geyser
potent jolt
#

neat

#

ill have to keep that in mind

elfin geyser
#

I used to do it like this

local mdl = require("../modules/aos_trainstation_data_transfer.lua")

local function getValue()
  storageKey, ownerX, ownerY = mdl.getValues()
  storage = Tile.getBuildingStorage(ownerX, ownerY)[storageKey]
end
potent jolt
#

i guess it works if storage doesnt want to

elfin geyser
#

It saves value while scripts are running

dull idol
#

my mind is melting

wary pewter
misty python
#

??

tired escarp
potent jolt
#

now the question is

#

is it a terrible idea to use sinus in script:update

#

or i just 3x^2 - 2x^3

elfin geyser
#

I preferred the second way

stoic vector
#

Can someone send the link to the lua docs

#

Its like finding a grain of sand in a haystack

elfin geyser
#

I forgot l

stoic vector
#

Thank you woman

potent jolt
#

the actual link

stoic vector
#

Oh thank you reimu

potent jolt
#

youre welcome

stoic vector
#

Lua seems to be a more simple json

potent jolt
#

lol

#

you could not be more incorrect