Author |
Message |
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Ridable Vehicles Mk2
By using the new inventory() function Sean found, and my list hack, I have been able to iron out almost all the bugs in the vehicle demo. The demo is in my mod. I have a more modder freindly edition here.
|
Thu Jul 23, 2009 11:35 pm |
|
|
Sean Mirrsen
Joined: Fri Jun 19, 2009 5:57 pm Posts: 84
|
Re: Ridable Vehicles Mk2
Hooray, I'm useful! [/zoidberg]
|
Fri Jul 24, 2009 8:55 pm |
|
|
vagyr
Joined: Sun Jan 11, 2009 10:54 am Posts: 365
|
Re: Ridable Vehicles Mk2
perfect code. but i have a small problem,how can i make a crab not turn upside down? i mean how can i make it correct it self and prevent it from turning upside down while looking natural(and with minimoum terain damage)?
|
Mon Aug 03, 2009 2:56 pm |
|
|
Roon3
Joined: Sun May 11, 2008 12:50 pm Posts: 899
|
Re: Ridable Vehicles Mk2
self.RotAngle = WhatEverYouWantIt2B
|
Mon Aug 03, 2009 3:10 pm |
|
|
vagyr
Joined: Sun Jan 11, 2009 10:54 am Posts: 365
|
Re: Ridable Vehicles Mk2
Code: function Create(self) self.RotAngle = 45 end would mean than the crab would rotate only in 45 degrees? or is it a diffrend kind of value?
|
Tue Aug 04, 2009 2:08 pm |
|
|
Roon3
Joined: Sun May 11, 2008 12:50 pm Posts: 899
|
Re: Ridable Vehicles Mk2
put in update, and run that line when the vehicle is empty.
|
Tue Aug 04, 2009 2:50 pm |
|
|
robolee
Joined: Fri May 11, 2007 4:30 pm Posts: 1040 Location: England
|
Re: Ridable Vehicles Mk2
that code will set the crabs rotation to 45 degrees (but only once, when it is created). what you want is (in update) Code: if self.RotAngle > 0.436332313 then self.RotAngle = self.RotAngle - 0.0174532925; end if self.RotAngle < -0.436332313 then self.RotAngle = self.RotAngle + 0.0174532925; end what this does is everysimupdate that the crabs rotation is more than 20(or 25 I can't remember now xD) either way it corrects it by one degree. Also 45 wouldn't work, rotangle is in radians... and on a side note, I love google, type something like "45 degrees to radians" and poof "45 degrees = 0.785398163 radians".
|
Wed Aug 05, 2009 1:14 am |
|
|
vagyr
Joined: Sun Jan 11, 2009 10:54 am Posts: 365
|
Re: Ridable Vehicles Mk2
ok now i get it. thanks a lot. also i have a small question with the script the teacher.lua file has a line than asks for the file Module.rte/GlobalFunctions.lua... what does this file do? i am asking just out of quriocity
|
Wed Aug 05, 2009 11:45 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Ridable Vehicles Mk2
Dammit. I knew I would mess something up. It's loading something from my mod. I'll go post it.
|
Thu Aug 06, 2009 4:40 am |
|
|
vagyr
Joined: Sun Jan 11, 2009 10:54 am Posts: 365
|
Re: Ridable Vehicles Mk2
well i have another problem... i made a script than makes an actor fly(thelastbananas code for th hooverboards+some other parts) and i want to combine it with the script to make the vehicle ridable... but i cannot combine the 2 together... any chance than you can help me?
|
Sun Aug 09, 2009 2:47 pm |
|
|
|