Skip to content

Commit 29a9af6

Browse files
committed
Fixed shipdoor
1 parent 0756fd3 commit 29a9af6

5 files changed

Lines changed: 107 additions & 78 deletions

File tree

_metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"version" : "2.8.5",
3-
"tags" : "Crafting and Building|Weapons|Cheats and God Items|Furniture and Objects|Armor and Clothes",
42
"author" : "thakyZ",
5-
"description" : "^#EA9931;A mod about a little kitty named Lilly, and other things.^#FFFFFF;\n\nThis is a mod for Starbound. It contains an assorted amount of changes and additions to Starbound.\nLilly is my cat who is a 12 year old calico, and she is so cute I just had to name a mod after her.\n\nThis mod contains armor, weapons and objects. The armor is an end tier armor set and is titled, Zorabian Armor, this armor is not based off of anything, but is Thaky's own creation. The armor has been balanced and with other mods, such as Frackin' Universe, it does change to not being an end tier armor set. There is an admin version of the armor set and is only able to be spawned in via admin mode (more details in the item list for this mod).\n\nThe Weapons in this mod is first the Void Excalibur, which is a top tier sword that has a unique texture and not so unique secondary ability; the secondary abality is planned on changing in the future. The second weapon is the Zorabian Assault rifle, it is a high powered rifle, and it too has a secondary ability already in the game and is going to be changed in the future.\n\nOther miscellaneous items are the Zorcan Crystal, which is a element created by infusion of all tier 5 ores and solarium. This item is used only for creating Zorabian products like the Void Excalibur or Zorabian Armor.\n\nA new pet texture to the cat provides Thaky's kitty, Lilly to be able to be a pet. If you want to have Lilly specifically you must download the Purchasable Pets mod. With the Purchasable Pets mod being an optional mod, DO NOT use the Lilly's Pet House if you are going to not get the Purchasable Pets mod.\n\nThis also adds some furniture like a painting of Lilly, custom teleporters, an ancient torch stand, Lilly's Emblem, and gravestones. These gravestones consist of my previous real life cats Oscar and Wilson.\n\nSome other objects that have been added, is a painting of Lilly, a emblem of Lilly's paw (not actually Lilly's paw), and some other hidden objects that have yet to be implemented.\n\n^#A451C4;Item List:^#FFFFFF; ^#9BBA3D;https://files.nekogaming.xyz/games/starbound/lillymod-item-list/^#FFFFFF;\n\n^#A451C4;Chucklefish Forums:^#FFFFFF; ^#9BBA3D;https://community.playstarbound.com/resources/lillymod.4686/^#FFFFFF;\n^#A451C4;Steam Workshop:^#FFFFFF; ^#9BBA3D;https://steamcommunity.com/sharedfiles/itemedittext/?id=729548200^#FFFFFF;\n\nIf you would like to have Lilly as a purchasable pet you can download \"^#0080FF;LillyMod Purchasable Pets Patch^#FFFFFF;\"\n^#A451C4;Chucklefish Forums:^#FFFFFF; ^#9BBA3D;https://community.playstarbound.com/resources/lillymod-purchasable-pets-patch.5620/^#FFFFFF;\n^#A451C4;Steam Workshop:^#FFFFFF; ^#9BBA3D;https://steamcommunity.com/sharedfiles/filedetails/?id=1595365078^#FFFFFF;\n\nFully compatible with Frackin' Universe\n^#9BBA3D;https://i.imgur.com/1TfuM5F.png^#FFFFFF;",
6-
"name" : "LillyMod",
3+
"description" : "^#EA9931;A mod about a little kitty named Lilly, and other things.^reset;\n\nThis is a mod for Starbound. It contains an assorted amount of changes and additions to Starbound.\nLilly is my cat who is a 12 year old calico, and she is so cute I just had to name a mod after her.\n\nThis mod contains armor, weapons and objects. The armor is an end tier armor set and is titled, Zorabian Armor, this armor is not based off of anything, but is Thaky's own creation. The armor has been balanced and with other mods, such as Frackin' Universe, it does change to not being an end tier armor set. There is an admin version of the armor set and is only able to be spawned in via admin mode (more details in the item list for this mod).\n\nThe Weapons in this mod is first the Void Excalibur, which is a top tier sword that has a unique texture and not so unique secondary ability; the secondary abality is planned on changing in the future. The second weapon is the Zorabian Assault rifle, it is a high powered rifle, and it too has a secondary ability already in the game and is going to be changed in the future.\n\nOther miscellaneous items are the Zorcan Crystal, which is a element created by infusion of all tier 5 ores and solarium. This item is used only for creating Zorabian products like the Void Excalibur or Zorabian Armor.\n\nA new pet texture to the cat provides Thaky's kitty, Lilly to be able to be a pet. If you want to have Lilly specifically you must download the Purchasable Pets mod. With the Purchasable Pets mod being an optional mod, DO NOT use the Lilly's Pet House if you are going to not get the Purchasable Pets mod.\n\nThis also adds some furniture like a painting of Lilly, custom teleporters, an ancient torch stand, Lilly's Emblem, and gravestones. These gravestones consist of my previous real life cats Oscar and Wilson.\n\nSome other objects that have been added, is a painting of Lilly, a emblem of Lilly's paw (not actually Lilly's paw), and some other hidden objects that have yet to be implemented.\n\n^#A451C4;Item List:^reset; ^#9BBA3D;https://files.voidinc.net/games/starbound/lillymod-item-list/^reset;\n\n^#A451C4;Steam Workshop:^reset; ^#9BBA3D;https://steamcommunity.com/sharedfiles/itemedittext/?id=729548200^reset;\n^#A451C4;Chucklefish Forums:^reset; ^#9BBA3D;https://community.playstarbound.com/resources/lillymod.4686/^reset;\n^#A451C4;Github Repo:^reset; ^#9BBA3D;https://github.com/thakyZ/LillyMod^reset;\n\nIf you would like to have Lilly as a purchasable pet you can download \"^#0080FF;LillyMod Purchasable Pets Patch^reset;\"\n^#A451C4;Steam Workshop:^reset; ^#9BBA3D;https://steamcommunity.com/sharedfiles/filedetails/?id=1595365078^reset;\n^#A451C4;Chucklefish Forums:^reset; ^#9BBA3D;https://community.playstarbound.com/resources/lillymod-purchasable-pets-patch.5620/^reset;\n^#A451C4;Github Repo:^reset; ^#9BBA3D;https://github.com/thakyZ/LillyMod_PurchasablePets^reset;\n\nFully compatible with Frackin' Universe\n^#9BBA3D;https://i.imgur.com/1TfuM5F.png^reset;",
74
"friendlyName" : "LillyMod",
5+
"link" : "steam://url/CommunityFilePage/729548200",
6+
"name" : "LillyMod",
87
"steamContentId" : "729548200",
9-
"link" : "steam://url/CommunityFilePage/729548200"
8+
"tags" : "Crafting and Building|Weapons|Cheats and God Items|Furniture and Objects|Armor and Clothes",
9+
"version" : "2.8.6"
1010
}

objects/lilly/shipdoor/lillyshipdoor.animation

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"default" : "closed",
66
"states" : {
77
"opening" : {
8-
"frames" : 3,
8+
"frames" : 2,
99
"cycle" : 0.15,
1010
"mode" : "transition",
1111
"transition" : "open"
1212
},
1313
"open" : {},
1414
"closing" : {
15-
"frames" : 3,
15+
"frames" : 2,
1616
"cycle" : 0.15,
1717
"mode" : "transition",
1818
"transition" : "closed"

objects/lilly/shipdoor/lillyshipdoor.lua

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,68 +11,68 @@ function init()
1111
self.detectArea = config.getParameter("detectArea")
1212
self.detectArea[1] = object.toAbsolutePosition(self.detectArea[1])
1313
self.detectArea[2] = object.toAbsolutePosition(self.detectArea[2])
14-
14+
1515
self.connectedDoor = nil
1616
self.doorLocked = false
1717
self.lockInputLevel = nil
1818
self.forceOpenTimer = 0
19-
19+
2020
message.setHandler("openDoor", function()
21-
if animator.animationState("doorState") == "closed" or animator.animationState("doorState") == "closing" then
22-
animator.setAnimationState("doorState", "open")
23-
self.forceOpenTimer = 0.5
24-
end
21+
if animator.animationState("doorState") == "closed" or animator.animationState("doorState") == "closing" then
22+
animator.setAnimationState("doorState", "open")
23+
self.forceOpenTimer = 0.5
24+
end
2525
end)
2626
end
2727

2828
function update(dt)
2929
--If we don't have a connected door, check for one every frame
3030
--Doing this every frame prevents rare issues where the connection check fails when loading a new sector
3131
if not self.connectedDoor then
32-
checkDoorConnection()
32+
checkDoorConnection()
3333
end
34-
34+
3535
--If we have input on the lock node, invert that to set lock state. If there is no connection in the lock node, unlock the door
3636
if object.isInputNodeConnected(1) then
37-
self.lockInputLevel = object.getInputNodeLevel(1)
38-
self.doorLocked = not self.lockInputLevel
37+
self.lockInputLevel = object.getInputNodeLevel(1)
38+
self.doorLocked = not self.lockInputLevel
3939
else
40-
self.doorLocked = false
40+
self.doorLocked = false
4141
end
42-
42+
4343
--Count down the force open timer
4444
self.forceOpenTimer = math.max(0, self.forceOpenTimer - dt)
45-
45+
4646
--Check if there are players nearby
4747
local players = world.entityQuery(self.detectArea[1], self.detectArea[2], {
48-
includedTypes = {"player"},
49-
boundMode = "CollisionArea"
48+
includedTypes = {"player"},
49+
boundMode = "CollisionArea"
5050
})
5151

5252
--If the door is connected, open or close the door based on player proximity
5353
if #players > 0 and self.connectedDoor and animator.animationState("doorState") == "closed" and not self.doorLocked then
54-
animator.setAnimationState("doorState", "opening")
55-
animator.playSound("open")
54+
animator.setAnimationState("doorState", "opening")
55+
animator.playSound("open")
5656
elseif #players == 0 and self.connectedDoor and animator.animationState("doorState") == "open" and self.forceOpenTimer == 0 and not self.doorLocked then
57-
animator.setAnimationState("doorState", "closing")
58-
animator.playSound("close")
57+
animator.setAnimationState("doorState", "closing")
58+
animator.playSound("close")
5959
--If the door isn't connected, try to close the door
6060
elseif not self.connectedDoor and animator.animationState("doorState") == "open" and self.forceOpenTimer == 0 and not self.doorLocked then
61-
animator.setAnimationState("doorState", "closing")
62-
animator.playSound("close")
61+
animator.setAnimationState("doorState", "closing")
62+
animator.playSound("close")
6363
elseif animator.animationState("doorState") == "open" and self.doorLocked then
64-
animator.setAnimationState("doorState", "closing")
65-
animator.playSound("close")
64+
animator.setAnimationState("doorState", "closing")
65+
animator.playSound("close")
6666
end
67-
67+
6868
--If we have a connected door and it still exists, make the door interactive
6969
if self.connectedDoor and world.entityExists(self.connectedDoor) and not self.doorLocked then
70-
object.setInteractive(true)
70+
object.setInteractive(true)
7171
else
72-
object.setInteractive(false)
73-
self.connectedDoor = false
72+
object.setInteractive(false)
73+
self.connectedDoor = false
7474
end
75-
75+
7676
--Debug the detectArea and the stored door connection ID
7777
local detectPoly = {self.detectArea[1], {self.detectArea[1][1], self.detectArea[2][2]}, self.detectArea[2], {self.detectArea[2][1], self.detectArea[1][2]}}
7878
world.debugPoly(detectPoly, "cyan")
@@ -82,14 +82,14 @@ function update(dt)
8282
end
8383

8484
--Called on interaction from a player or NPC. Used for active teleportation
85-
function onInteraction(args)
85+
function onInteraction(args)
8686
local targetPosition = world.entityMouthPosition(self.connectedDoor)
8787
local interactedEntity = args.sourceId
88-
88+
8989
if self.connectedDoor then
90-
world.sendEntityMessage(interactedEntity, "applyStatusEffect", "thea-teleportentity", 0.1, self.connectedDoor)
90+
world.sendEntityMessage(interactedEntity, "applyStatusEffect", "thea-teleportentity", 0.1, self.connectedDoor)
9191
end
92-
92+
9393
--TODO: Implement status effect that teleports an entity. Use the sourceEntity to transmit target position?
9494
end
9595

@@ -102,16 +102,16 @@ end
102102
function checkDoorConnection()
103103
self.connectedDoor = nil
104104
for entityId, _ in pairs(object.getOutputNodeIds(0)) do
105-
if world.entityExists(entityId) then
106-
--Check if the connected object allows background door connections
107-
if world.getObjectParameter(entityId, "allowBackgroundDoorConnection", false) then
108-
self.connectedDoor = entityId
109-
end
110-
111-
--local entityName = world.entityName(entityId)
112-
--if entityName == world.entityName(entity.id()) then
113-
--self.connectedDoor = entityId
114-
--end
115-
end
105+
if world.entityExists(entityId) then
106+
--Check if the connected object allows background door connections
107+
if world.getObjectParameter(entityId, "allowBackgroundDoorConnection", false) then
108+
self.connectedDoor = entityId
109+
end
110+
111+
--local entityName = world.entityName(entityId)
112+
--if entityName == world.entityName(entity.id()) then
113+
--self.connectedDoor = entityId
114+
--end
115+
end
116116
end
117117
end
Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,74 @@
11
{
22
"objectName" : "lillyshipdoor",
33
"colonyTags" : ["lilly","misc"],
4-
"objectType" : "teleporter",
54
"rarity" : "Common",
6-
"description" : "A door that is also a teleporter!",
7-
"shortdescription" : "Lilly Co. Ship Door",
8-
"price" : 80,
5+
"category" : "door",
96
"printable" : true,
7+
"price" : 80,
8+
"description" : "A blast door. It can be linked to other background doors.",
9+
"shortdescription" : "Lilly Co. Ship Door",
1010

11-
"category" : "door",
11+
"apexDescription" : "I wonder where this door leads...",
12+
"avianDescription" : "I wonder where this door leads...",
13+
"floranDescription" : "Floran wondersss where door goesss...",
14+
"glitchDescription" : "Curious. I wonder where this door leads...",
15+
"humanDescription" : "I wonder where this door leads...",
16+
"hylotlDescription" : "I wonder where this door leads...",
17+
"novakidDescription" : "I wonder where this door leads...",
18+
19+
"aegiDescription" : "I wonder where this door leads...",
20+
"avikanDescription" : "I wonder where this door leads...",
21+
"draunaarDescription" : "I wonder where this door leads...",
22+
"trinkDescription" : "I wonder where this door leads...",
23+
"hymidDescription" : "I wonder where this door leads...",
24+
"notixDescription" : "I wonder where this door leads...",
25+
"jorgasianDescription" : "I wonder where this door leads...",
26+
"centensDescription" : "I wonder where this door leads...",
27+
"dremetonDescription" : "I wonder where this door leads...",
28+
"theleanDescription" : "I wonder where this door leads...",
29+
"drodenDescription" : "Scanning failed. Unable to determine where this door leads.",
30+
"akkimariDescription" : "Akki wonder where door leads...",
1231

13-
"interactAction" : "OpenTeleportDialog",
14-
"interactData" : "/interface/warping/remoteteleporter.config",
32+
"nekoDescription" : "I wonder where this door leads...",
1533

1634
"inventoryIcon" : "icon.png",
1735
"orientations" : [
1836
{
19-
"imageLayers" : [ { "image" : "lillyshipdoor.png:<color>", "fullbright" : true }, { "image" : "lillyshipdoorlit.png:<color>" } ],
37+
"imageLayers" : [ { "image" : "lillyshipdoor.png:<color>.<frames>", "fullbright" : true }, { "image" : "lillyshipdoorlit.png:<color>.<frames>" } ],
2038
"imagePosition" : [-16, 0],
2139
"animationPosition" : [-16, 0],
2240
"spaceScan" : 0.1,
2341

24-
"anchors" : [ "bottom" ],
42+
"anchors" : [ "bottom", "background" ],
2543
"direction" : "right"
2644
}
2745
],
2846

29-
"detectArea" : [ [-6, 0], [7, 6] ],
30-
"allowBackgroundDoorConnection" : true,
31-
"mouthPosition" : [0, -1], //Used to determine the teleport position of the door
32-
"inputNodes" : [ [-2, 0], [-2, 2] ],
33-
"outputNodes" : [ [1, 4] ],
34-
3547
"animation" : "/objects/lilly/shipdoor/lillyshipdoor.animation",
48+
"animationCustom" : {
49+
"sounds" : {
50+
"open" : {
51+
"pool" : [ "/sfx/objects/apexcooldoor_open.ogg" ],
52+
"rangeMultiplier" : 0.5
53+
},
54+
"close" : {
55+
"pool" : [ "/sfx/objects/apexcooldoor_close.ogg" ],
56+
"rangeMultiplier" : 0.5
57+
}
58+
}
59+
},
3660
"animationParts" : {
3761
"bg" : "lillyshipdoor.png",
3862
"fg" : "lillyshipdoorlit.png"
3963
},
64+
"animationPosition" : [-16, 0],
65+
66+
"scripts" : [ "/objects/lilly/shipdoor/lillyshipdoor.lua" ],
67+
"detectArea" : [ [-6, 0], [7, 6] ],
4068

41-
"scripts" : [ "/objects/lilly/shipdoor/lillyshipdoor.lua" ]
69+
"allowBackgroundDoorConnection" : true,
70+
"mouthPosition" : [0, -1], //Used to determine the teleport position of the door
71+
72+
"inputNodes" : [ [-2, 0], [-2, 2] ],
73+
"outputNodes" : [ [1, 4] ]
4274
}

objects/lilly/shipdoor/lillyshipdoorlit.frames

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,21 @@
33
"size" : [32, 40],
44
"dimensions" : [4, 3],
55
"names" : [
6-
[ "default.closed", "default.opening.3", "default.opening.2", "default.opening.1" ],
7-
[ "blue.closed", "blue.opening.3", "blue.opening.2", "blue.opening.1" ],
8-
[ "orange.closed", "orange.opening.3", "orange.opening.2", "orange.opening.1" ]
6+
[ "default.closed", "default.opening.1", "default.opening.2", "default.open" ],
7+
[ "blue.closed", "blue.opening.1", "blue.opening.2", "blue.open" ],
8+
[ "orange.closed", "orange.opening.1", "orange.opening.2", "orange.open" ]
99
]
1010
},
1111

1212
"aliases" : {
1313
"default.default" : "default.closed",
14-
"default.closing.1" : "default.opening.3",
15-
"default.closing.2" : "default.opening.2",
16-
"default.closing.3" : "default.opening.1",
14+
"default.closing.1" : "default.opening.2",
15+
"default.closing.2" : "default.opening.1",
1716
"blue.blue" : "blue.closed",
18-
"blue.closing.1" : "blue.opening.3",
19-
"blue.closing.2" : "blue.opening.2",
20-
"blue.closing.3" : "blue.opening.1",
17+
"blue.closing.1" : "blue.opening.2",
18+
"blue.closing.2" : "blue.opening.1",
2119
"orange.orange" : "orange.closed",
22-
"orange.closing.1" : "orange.opening.3",
23-
"orange.closing.2" : "orange.opening.2",
24-
"orange.closing.3" : "orange.opening.1"
20+
"orange.closing.1" : "orange.opening.2",
21+
"orange.closing.2" : "orange.opening.1"
2522
}
2623
}

0 commit comments

Comments
 (0)