Lua chatbox

The Lua scripting language allows you to give your plugin more advanced features.

Moderator: Plugin Moderators

User avatar
CERRERA
Townsman
Reactions:
Posts: 48
Joined: 25 Jan 2020, 06:19
Location: Philippines
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Lua chatbox

#181

Post by CERRERA »

20211206_232418.jpg
20211206_232418.jpg (62.41 KiB) Viewed 6892 times
Anyone can help me?

If u press building or category you will go into link

Example I press the help category you will go to yt

Sorry Idk how lua works
Everything you can imagine is real

User avatar
kyoshimine1
Townsman
Reactions:
Posts: 50
Joined: 03 Oct 2020, 00:11
Location: Japan
Plugins: Showcase Store

Plugin Creator

Platform

Re: Lua chatbox

#182

Post by kyoshimine1 »

I have a question. I was creating a new plugin and it occurred to me that I could use Lua to do something....

Let's say, if I wanted the property
"conductive":true
Turn false, but only after a certain time since I entered the city, for example 5 minutes.
Would it be possible to do something like that using Lua?
自分の街のプラグインを作るのが好きなんです・・・
また、ドット絵を描くのも好き!

:img

User avatar
Hadestia
Inhabitant of a Megalopolis
Reactions:
Posts: 727
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

Plugin Creator

Platform

Re: Lua chatbox

#183

Post by Hadestia »

kyoshimine1 wrote:
22 Mar 2022, 17:51
I have a question. I was creating a new plugin and it occurred to me that I could use Lua to do something....

Let's say, if I wanted the property
"conductive":true
Turn false, but only after a certain time since I entered the city, for example 5 minutes.
Would it be possible to do something like that using Lua?
Do this method

Code: Select all    Reset

Debug.toast(Draft.orig.conductive)
Interactive Lua editor
Run
If it toast the value you put from its json probably you can change it dynamically
 ! Message from: Hadestia
Visit my YouTube channel:
https://youtube.com/channel/UC5qG-r8y21036JZbGRClbdQ

User avatar
erksmit
Villager
Reactions:
Posts: 23
Joined: 02 Mar 2018, 12:39
Plugins: Showcase Store
Version: Beta

Plugin Creator

Re: Lua chatbox

#184

Post by erksmit »

What happens with a lua script when i enter online mode? Im trying to make a script compatible with it, its got multiplayer: false in its manifest.

User avatar
Hadestia
Inhabitant of a Megalopolis
Reactions:
Posts: 727
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

Plugin Creator

Platform

Re: Lua chatbox

#185

Post by Hadestia »

erksmit wrote:
16 Aug 2022, 12:07
What happens with a lua script when i enter online mode? Im trying to make a script compatible with it, its got multiplayer: false in its manifest.
It will still work but locally
 ! Message from: Hadestia
Visit my YouTube channel:
https://youtube.com/channel/UC5qG-r8y21036JZbGRClbdQ

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Lua chatbox

#186

Post by ian` »

i realized the onDraw argument now ignores parent padding. is it a bug or a fix? :bt
:bc

User avatar
JustAnyone
Developer
Reactions:
Posts: 3480
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Lua chatbox

#187

Post by JustAnyone »

That is the intended change as of 1.10.73

User avatar
erksmit
Villager
Reactions:
Posts: 23
Joined: 02 Mar 2018, 12:39
Plugins: Showcase Store
Version: Beta

Plugin Creator

Re: Lua chatbox

#188

Post by erksmit »

With the addition of the Car module i had the idea of dynamically spawning cars with diffrent tails depending on what they carry (what they carry is decided within). Now i wanted to also dynamically set the animation of the car to show a certain resource on its cargo bed, but i noticed there are no functions to set a car's animation. Would it still be possible to do this?

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Lua chatbox

#189

Post by ian` »

also the method to change the car despawn time when the car speed is zero. AFAIK, the default car despawn time is 10 days in normal speed.
:bc

User avatar
Frodo01
Settler
Reactions:
Posts: 5
Joined: 13 Sep 2020, 21:25

Re: Lua chatbox

#190

Post by Frodo01 »

I don't understand what is wrong with this script. Nothing happens when the police car is at the coordinates of the road decoration.

function script.update()
-- Debug.toast("starting code!")
local car = Draft.getDraft('$carpolice00')
local carX = car.getX()
local carY = car.getY()
if Builder.isRoadDecoBuildable('$undead_horde_plugin_00', carX, carY) then
Builder.removeRoadDeco(carX, carY)
Debug.toast("destroy undead!")
end
end

Post Reply Previous topicNext topic

Return to “Lua Scripting”