• Combine Mech - Small error after porting
    3 replies, posted
Alright Well we ported the addon combine mech (I'm sure many of you have heard of it) And it almost works perfectly. There is an error that pops up when you press SPACE (to use your thruster) This is what it looks like: [IMG]http://gyazo.com/1013f28c12d6c40bcc325b5cad976959.png?1367198750[/IMG] The error that spits out in console: [CODE][ERROR] addons/fixed_combine_mech/lua/entities/sent_combinemech/init.lua:686: bad argument #2 to 'ChangePitch' (number expected, got no value) 1. ChangePitch - [C]:-1 2. unknown - addons/fixed_combine_mech/lua/entities/sent_combinemech/init.lua:686 [/CODE] [editline]28th April 2013[/editline] And i think i narrowed it down in the init.lua file. here- [CODE]local pitch = 50 + ((self.flyHeight / 1000) * 150) self.JetSound:ChangePitch( pitch ) local pos = self.mech:GetPos() + self:GetForward() * -11.5 + self:GetUp() * -10 local ang = self:GetAngles() --Jet fart local effectdata = EffectData() effectdata:SetOrigin( pos ) effectdata:SetAngle( ang ) effectdata:SetScale( 1 ) util.Effect( "MuzzleEffect", effectdata ) pos = self.mech:GetPos() + self:GetForward() * -30 + self:GetUp() * -2 local effectdata2 = EffectData() effectdata2:SetOrigin( pos ) effectdata2:SetAngle( ang ) effectdata2:SetScale( 1 ) util.Effect( "MuzzleEffect", effectdata2 ) else --Stopping the jet sound if we aren't flying self.JetPlay = false self.JetSound:Stop() end [/CODE] So If anyone can help me out with this error that would be greatly appreciated. I plan on releasing this on the workshop once this error is fixed. Thanks
Oops, missed that. Add "pitch, 0" instead of "pitch" in the ChangePitch function.
[QUOTE=Robotboy655;40462483]Oops, missed that. Add "pitch, 0" instead of "pitch" in the ChangePitch function.[/QUOTE] Thank you :) edit: BTW congrats 1000 posts ;p ANNNNND another error... [CODE][ERROR] addons/fixed_combine_mech/lua/entities/sent_combinemech/init.lua:694: attempt to call method 'SetAngle' (a nil value) 1. unknown - addons/fixed_combine_mech/lua/entities/sent_combinemech/init.lua:694[/CODE] [CODE]local pitch = 50 + ((self.flyHeight / 1000) * 150) self.JetSound:ChangePitch( pitch, 0 ) local pos = self.mech:GetPos() + self:GetForward() * -11.5 + self:GetUp() * -10 local ang = self:GetAngles() --Jet fart local effectdata = EffectData() effectdata:SetOrigin( pos ) effectdata:SetAngle( ang ) effectdata:SetScale( 1 ) util.Effect( "MuzzleEffect", effectdata ) pos = self.mech:GetPos() + self:GetForward() * -30 + self:GetUp() * -2 local effectdata2 = EffectData() effectdata2:SetOrigin( pos ) effectdata2:SetAngle( ang ) effectdata2:SetScale( 1 ) util.Effect( "MuzzleEffect", effectdata2 ) else --Stopping the jet sound if we aren't flying self.JetPlay = false self.JetSound:Stop() end [/CODE] and im pretty sure we have to fix that in two places... beacuse theres two SetAngle(ang) so im guessing just fixing one wouldn't solve it...
Let me reupload it real quick... Aaaand done: [url]http://filesmelt.com/dl/fixed_combine_mech1.zip[/url]
Sorry, you need to Log In to post a reply to this thread.