Mounting Turrets to Multiple Ships
A'ight, here's the deal. I have multiple battlehips (the triangle-looking object), each with two turrets (the circle with two barrels).
I'm trying to have the turrets stick to the battleships, one at 45 degrees to port and 18 pixels away, the other at 45 degrees to starboard and 18 pixels away.
In the screenshot below, the first two events (98 and 99) create the turrets (one is assigned to the battlehip's flag 30, the other to flag 31 - when they are created it turns on the flag.) 'TurretMountUnit' is the fixed value of the battleship (so the turret knows which battleship it is assigned to), and the other two values are it's angle and postition relative to the battleship. Event 99 assigns the turret a TurretMountAngle of -45 so it stick to the other side of the ship.
http://img81.imageshack.us/img81/3392/bigscreeneh9.png
I have a fastloop running on an 'always' event for all 'ship' objects (the battleships and turrets are in that group.) Value Z is always spreaded.
The third event (100) is supposed to stick each turret onto the battleship it is assigned to, but for some reason it only works for one of the battleships, not all of them. (Ignore the 'Inirtia' and 'MoveSpeed' lines.)
http://img224.imageshack.us/img224/3...leshipszf1.jpg
This is what happens - the turrets on the topmmost battleship work fine, but the other four (they are stacked by two) do not stick to their battleships. (Note; the turrets that are just floating in space stay at the initial position of the battleships.)
Anybody know how I can make all the turrets stick to their assigned battleships? I'm sure it's just something sneaky I have to do with the fastloops.
Hope this all makes sense! xD
Thanks a lot,
Wes
Re: Mounting Turrets to Multiple Ships
A similar problem happened here.
Re: Mounting Turrets to Multiple Ships
I had to do that exact same thing with the ships in my game, and it works fine. In fact I'll go help that guy out.
But for some reason these turrets are giving me trouble.
Re: Mounting Turrets to Multiple Ships
Spread val for ship and spread value for turret.
turret val = ship value set pos to xy from ship.