View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:17 pm



Reply to topic  [ 9 posts ] 
 Multi Turret Crab 
Author Message
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post 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


Tue May 26, 2009 2:42 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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.


Tue May 26, 2009 2:54 pm
Profile
Banned
User avatar

Joined: Thu May 14, 2009 9:22 pm
Posts: 826
Location: Lookin' forward to mocking people on Jan 1st 2013.
Reply with quote
Post 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.


Tue May 26, 2009 2:57 pm
Profile YIM
User avatar

Joined: Mon Jun 30, 2008 9:13 pm
Posts: 499
Location: Finland
Reply with quote
Post 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.


Tue May 26, 2009 3:03 pm
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Multi Turret Crab
p3lb0x wrote:
What kinda gun should it have? ATM it has the dummy turrets machine gun
At least one version including a decent powered slug gun. Otherwise perhaps some decent speed, decent accuracy, semi-automatic rifles.


Tue May 26, 2009 3:09 pm
Profile WWW
User avatar

Joined: Mon Jun 30, 2008 9:13 pm
Posts: 499
Location: Finland
Reply with quote
Post Re: Multi Turret Crab
YAK-47, revolver cannon and heavy sniper work nice for turrets.


Tue May 26, 2009 3:11 pm
Profile
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post 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.


Tue May 26, 2009 6:04 pm
Profile
User avatar

Joined: Fri Jun 01, 2007 12:17 am
Posts: 106
Reply with quote
Post 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 :P


Wed May 27, 2009 3:14 am
Profile WWW
User avatar

Joined: Fri Apr 27, 2007 4:55 pm
Posts: 1178
Location: America!
Reply with quote
Post 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:

Image


Wed May 27, 2009 4:43 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.059s | 14 Queries | GZIP : Off ]