Data Realms Fan Forums http://45.55.195.193/ |
|
Multi Turret Crab http://45.55.195.193/viewtopic.php?f=73&t=14977 |
Page 1 of 1 |
Author: | p3lb0x [ Tue May 26, 2009 2:42 pm ] |
Post subject: | Multi Turret Crab |
So, I succeeded in making a multi turret crab with the help of Roon3. I have single problem though. With my current code the crabs don't rotate with the crab, this makes it look like ♥♥♥♥ if it's walking down hills or tipping over. Any one know how I can change this? edit: Also all you people out there that probably wants this thing. What kinda gun should it have? ATM it has the dummy turrets machine gun |
Author: | Grif [ Tue May 26, 2009 2:54 pm ] |
Post subject: | Re: Multi Turret Crab |
Get the parent and then set the child RotAngle with the parent's RotAngle? It'll still look bad because the game won't know to attach them, so when you tilt too much the central body will be inside the others. |
Author: | Metal Meltdown [ Tue May 26, 2009 2:57 pm ] |
Post subject: | Re: Multi Turret Crab |
p3lb0x wrote: What kinda gun should it have? Red, evil, death ray. Or some sort of massive, apocalypse-bringing, nuclear crab guns. We're really short on explosive crab cannons. |
Author: | piipu [ Tue May 26, 2009 3:03 pm ] |
Post subject: | Re: Multi Turret Crab |
Quote: local offsetx = self.gun.Pos.X - self.Pos.X local offsety = self.gun.Pos.Y - self.Pos.Y self.gun.RotAngle = math.atan2(offsetx,-offsety) That should basically work. |
Author: | 411570N3 [ Tue May 26, 2009 3:09 pm ] |
Post subject: | Re: Multi Turret Crab |
p3lb0x wrote: What kinda gun should it have? ATM it has the dummy turrets machine gun |
Author: | piipu [ Tue May 26, 2009 3:11 pm ] |
Post subject: | Re: Multi Turret Crab |
YAK-47, revolver cannon and heavy sniper work nice for turrets. |
Author: | Daman [ Tue May 26, 2009 6:04 pm ] |
Post subject: | Re: Multi Turret Crab |
I don't understand? Why would setting the rotangle fix anything. That'd just rotate it and not actually move the orientation position it is attached at. If you're not setting the position via Lua, you should do that and you can set its position based on the parent's rotangle accurately. I'll give you an example of moving the position's orientation using rotangle and some minor trigonometry when I have access to my computer. |
Author: | AaronLee [ Wed May 27, 2009 3:14 am ] |
Post subject: | Re: Multi Turret Crab |
I was having this problem with my turret attempt with the coalition dropship. As Daman says, there's no real easy way atm. I was generating a hardcoded Vector and attempting to use the Vector's RadRotate function to rotate it relative to the parent's RotAngle. But, ther'es some unforseen thing that's loopy with some functiuons, that one included. It doesn't accept RotAngle for an argument and doesn't work atm. That means either bide your time or do it like Daman says and use atan2 and the like to do it "manually" fun fun |
Author: | Lord Tim [ Wed May 27, 2009 4:43 am ] |
Post subject: | Re: Multi Turret Crab |
I was messing around with this a bit to put turrets on dropships. Here are the formulas you want I think: |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |