How to Detect Firework Wires Using Fun
Posted: 05 Oct 2019, 21:25
This tutorial should help those of you who want to utilize the firework wire's functionality without having to make your own wire.
It is very simple to use a wire in your condition:
All you need is something like this that checks for the ID "$on". Very simple, but very useful. If you want to detect when the wire is off, then you'll need to use the ID "$off".
There's no need to worry about detecting frames. Checking for the ID will be enough.
Here's an example of its usage:
This code checks for an activated wire nearby and removes the building when the condition is true.
You can download the example file here:
It is very simple to use a wire in your condition:
Code: Select all
"condition":{"type":"building","id":"$on"}
There's no need to worry about detecting frames. Checking for the ID will be enough.
Here's an example of its usage:
Code: Select all
[
{
"frames":[
{
"steal":"$res00"
}
],
"fun":[
{
"actions":[
{
"type":"remove"
}
],
"condition":{
"id":"$on",
"type":"building",
"x":1
}
},
{
"actions":[
{
"type":"remove"
}
],
"condition":{
"id":"$on",
"type":"building",
"x":-1
}
},
{
"actions":[
{
"type":"remove"
}
],
"condition":{
"id":"$on",
"type":"building",
"y":1
}
},
{
"actions":[
{
"type":"remove"
}
],
"condition":{
"id":"$on",
"type":"building",
"y":-1
}
}
],
"height":1,
"id":"wire_sensor.kt101",
"needsroad":false,
"power":0,
"price":0,
"text":"Wiresensor",
"title":"Wiresensor",
"type":"terrain",
"water":0,
"width":1
}
]
You can download the example file here: