Constraining multiple types of the same actor to different points

Is there any easy way to constrain multiple of the same actor go to different coordinates in the scene? For Galastar, I have this giant ship for the final boss, and I want to make it so all the turrets and red domes with yellow tops to be separate objects. I want to make it so that you have to damage individual parts of the ship instead of the ship as a whole.
photo Behemoth_zps5f152f5a.png
(Unfinished by the way, shading isn't complete)

The only 2 ways I know of doing this is by either making a bunch of different actors constrain at different points, or change each instance actor's constrain attribute behavior, which would be an inconvenience since I want to actually have the Main ship spawn each of the turrets and red domes upon the scene being made just to make things a tad easier for me. Do I have any other options? (Maybe tables? I'm a tad new to them, so I've got no idea.) Thanks in advance! :)

Having trouble with your game? Sounds like a personal problem.

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited June 2013
    You can put them off scene and set the alpha to 0 then when the ship is on screen have them lock on using scene linking and once in position change the alpha to 1 this can all be done in one code cycle so it would execute in .02 second. How I usually do offsets is I put the main object in the scene and put all the other objects where they will go and write all the positions down. Then it's just simple math based off the center X and Y of the main actor. Then just put that number before the scene link so if a turret is 25 pixels off center of main it would be constrain: self.position X to 25+scene.layer.ship. Tables won't help as they would each have their own column and row info anyway.

    BTW: Nice ship!
  • ADSentertainmentADSentertainment Member Posts: 397
    You can put them off scene and set the alpha to 0 then when the ship is on screen have them lock on using scene linking and once in position change the alpha to 1 this can all be done in one code cycle so it would execute in .02 second. How I usually do offsets is I put the main object in the scene and put all the other objects where they will go and write all the positions down. Then it's just simple math based off the center X and Y of the main actor. Then just put that number before the scene link so if a turret is 25 pixels off center of main it would be constrain: self.position X to 25+scene.layer.ship. Tables won't help as they would each have their own column and row info anyway.

    BTW: Nice ship!
    I hope you don't mind, but can I get an example so I can get a more visual idea of what I have to do? I understand things better that way.

    Having trouble with your game? Sounds like a personal problem.

  • FajlajpFajlajp Member Posts: 666
    Read my pm :)
  • AlphaCentoriAlphaCentori Member Posts: 57

    Hey i have a similar project going on and i would like to understand better how to do this. Please can you give a visual example? Thanks

Sign In or Register to comment.