reepblue Posted March 28, 2019 Share Posted March 28, 2019 Simple script issue where the stock Sliding Door script no longer starts open when told to do so out of the box. This is my Start function fix. If you think of anything better, let me know. function Script:Start() self.entity:SetGravityMode(false) if self.entity:GetMass()==0 then Debug:Error("Entity mass must be greater than 0.") end self.sound={} if self.opensoundfile~="" then self.sound.open = Sound:Load(self.opensoundfile) end if self.loopsoundfile~="" then self.sound.loop = Sound:Load(self.loopsoundfile) end if self.closesoundfile~="" then self.sound.close = Sound:Load(self.closesoundfile) end if self.sound.loop~=nil then self.loopsource = Source:Create() self.loopsource:SetSound(self.sound.loop) self.loopsource:SetLoopMode(true) self.loopsource:SetRange(50) end if self.manualactivation==false then self.Use=nil end self.opentime=0 --Create a motorized slider joint local position=self.entity:GetPosition(true) local pin=self.distance:Normalize() self.joint=Joint:Slider(position.x,position.y,position.z,pin.x,pin.y,pin.z,self.entity,nil) self.openangle=self.distance:Length() self.closedangle=0 if self.openstate then self.entity:SetPosition(position+self.distance) self.joint:SetAngle(self.openangle) end self.joint:EnableMotor() self.joint:SetMotorSpeed(self.movespeed) end Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted March 28, 2019 Share Posted March 28, 2019 It looks good on first try but I want to think about this some more and decide what the correct behavior should be. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
mdgunn Posted March 28, 2019 Share Posted March 28, 2019 For what it's worth. We have begun some further work on Forth Project (in game projects). We found some oddities with physics where platforms were floating up that previously were stationary. It isn't code I wrote, haven't looked closely at it, and I'm focusing on some modelling at the minute so I don't have any info on what the cause is. I am sticking with 4.5 for this project. I am just reporting it to inform that there do seem to be some differences physics between 4.5 and 4.6. If I get to investigating that I'll update or if there are changes in 4.6 we can probably check against our know problem area in Forth as an extra test bed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.