Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Many thanks! This is exactly what I need!
Re: Ask a simple question, get a simple answer
I have a newbisch question about posting images on this forum. Somehow I cannot get it to work. I can get a link working to a picture (see my dirt cave post) but not the picture directly on the forum.
I want to post some more pictures. How to do this?
I am using imgur.
I want to post some more pictures. How to do this?
I am using imgur.
Re: Ask a simple question, get a simple answer
If you can see this image, then depending on your browser, you can copy the image link by right-clicking the image (and choosing the correct option), or taking it from the URL address bar. On the imgur website, clicking the image (to zoom) takes you to a direct file URL. You can copy that from the address bar, and paste it into an img tag, on the forum.
- Mysterious
- Posts: 226
- Joined: Wed Nov 06, 2013 8:31 am
Re: Ask a simple question, get a simple answer
Hi all again.
Ok im trying the Script from Skuggs for night and day time actions. What I would like to do is if its 6Pm then the doors shut and if its 7am the doors open.
The Door Code Object:
Night and Day Code (in editor):
What happens is the door is unuseable at night but when the day cycle come back I cannot open the door. I have set a timer on to check 0.1 seconds. I don't know what I have done wrong here?
Ok im trying the Script from Skuggs for night and day time actions. What I would like to do is if its 6Pm then the doors shut and if its 7am the doors open.
The Door Code Object:
Code: Select all
defineObject{
name = "sx_swingdoor_clickable",
components = {
{
class = "Model",
model = "mod_assets/models/doors/swingdoor.fbx",
offset = vec(0,1.375,0),
},
{
class = "Model",
name = "door_logic",
model = "assets/models/env/dungeon_secret_door.fbx",
enabled = false
},
{
class = "Animation",
animations = {
activate = "mod_assets/animations/swingdoor_open.fbx",
deactivate = "mod_assets/animations/swingdoor_close.fbx",
},
},
{
class = "Door",
sparse = true,
killPillars = false,
openVelocity = 10,
closeVelocity = 0,
closeAcceleration = -10,
openSound = "silent",
closeSound = "silent",
lockSound = "silent"
},
{
class = "Clickable",
maxDistance = 1,
-- offset vector is the point where begin the clickable box
offset = vec(0,1.3,0),
-- size is the size of our clickable box
size = vec(2.5,2.5,0.3),
onClick = function(self)
if self.go.door:isClosed() then
self.go.controller:open()
else
self.go.controller:close()
end
end
},
{
class = "Controller",
onOpen = function(self)
self.go.door:open()
playSound("lever") --Change to what you want
self.go.animation:play("activate")
end,
onClose = function(self)
self.go.door:close()
playSound("lever") --Change to what you want
self.go.animation:play("deactivate")
end,
onToggle = function(self)
if self.go.door:isClosed() then
self.go.controller:open()
else
self.go.controller:close()
end
end,
},
},
placement = "wall",
editorIcon = 124,
tags = { "doors" },
}
Code: Select all
function nightdoors2()
if GameMode.getTimeOfDay() > 1.04 and GameMode.getTimeOfDay() < 1.97 then
sx_swingdoor_clickable_3.clickable:disable()
sx_swingdoor_clickable_3.controller:disable()
else
sx_swingdoor_clickable_3.clickable:enable()
sx_swingdoor_clickable_3.controller:activate()
end
end
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
ReplaceMysterious wrote:Night and Day Code (in editor):What happens is the door is unuseable at night but when the day cycle come back I cannot open the door. I have set a timer on to check 0.1 seconds. I don't know what I have done wrong here?Code: Select all
function nightdoors2() if GameMode.getTimeOfDay() > 1.04 and GameMode.getTimeOfDay() < 1.97 then sx_swingdoor_clickable_3.clickable:disable() sx_swingdoor_clickable_3.controller:disable() else sx_swingdoor_clickable_3.clickable:enable() sx_swingdoor_clickable_3.controller:activate() end end
sx_swingdoor_clickable_3.controller:activate()
with
sx_swingdoor_clickable_3.controller:enable()
Or you can just leave out the calls to the sx_swingdoor_clickable_3.controller methods.
Re: Ask a simple question, get a simple answer
I think that rather than have it set to 0.1, that you could probably just as well set your timer to 180, or 360.
It could save an awful lot of —guaranteed failure— time checks.
Or you could perhaps check or set the time when the game loads, and set the timer to the exact delay that you need.
It could save an awful lot of —guaranteed failure— time checks.
Or you could perhaps check or set the time when the game loads, and set the timer to the exact delay that you need.
Re: Ask a simple question, get a simple answer
The performance impact of this is utterly irrelevant.Isaac wrote:I think that rather than have it set to 0.1, that you could probably just as well set your timer to 180, or 360.
It could save an awful lot of —guaranteed failure— time checks.
Except time of day doesn't work that way. It increments when the party moves or turns, not with real-time.Isaac wrote:Or you could perhaps check or set the time when the game loads, and set the timer to the exact delay that you need.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
Is it? I will take your word for it; it still seems a waste to make that check ten times a second for half of the day.minmay wrote:The performance impact of this is utterly irrelevant.Isaac wrote:I think that rather than have it set to 0.1, that you could probably just as well set your timer to 180, or 360.
It could save an awful lot of —guaranteed failure— time checks.
I never liked that part about it. It seems to me that the time should pass even when squandered by loitering. I suppose it is to obfuscate the —much faster than realistic— passage of time during the game.Except time of day doesn't work that way. It increments when the party moves or turns, not with real-time.Isaac wrote:Or you could perhaps check or set the time when the game loads, and set the timer to the exact delay that you need.
Re: Ask a simple question, get a simple answer
ok, understood!minmay wrote:The game only has one reflection buffer. The only things you accomplish by having multiple WaterSurfaceComponents on the same level are:bongobeat wrote:Well I didn't know that you can have (and should) only one. But what is the matter when using 5 water_surface_component on the same map? Except for the issue of reflection.
1. You make it difficult to know which WaterSurfaceComponent will be used to calculate the reflection buffer. This is bad.
2. You make performance slightly worse. This is also bad.
Note that WaterSurfaceComponent isn't really affected by disabling it. You should remove the components entirely, not just disable them.
well this is corriged then. Thank you!
- Mysterious
- Posts: 226
- Joined: Wed Nov 06, 2013 8:31 am
Re: Ask a simple question, get a simple answer
Hi al.
Thank you for the (door) help Someone said to me there was a way you could load a save game into your new mod eg: Legends 1 - and when you finish this game you can continue to Legends 2 - with the same equipment, skils etc....
My question is. Is it possible and where might I find the code for this function?
Than you
Thank you for the (door) help Someone said to me there was a way you could load a save game into your new mod eg: Legends 1 - and when you finish this game you can continue to Legends 2 - with the same equipment, skils etc....
My question is. Is it possible and where might I find the code for this function?
Than you