trajectory issue

Thank you all people for your support, and that is a little question.
I`m testing Orbz Trajectory3 from here: http://forums.gamesalad.com/discussion/comment/278843#Comment_278843

But i dont know why, the trajectory is on diferent position, how to constrain it to my principal actor, because he use "self.Plot Index / self.Plot Points * game.Display Size.Width" and want to use same position, i have tested self positionx, but then dont work on higher level i know...
Thank you for read that

Comments

  • mrpacogpmrpacogp Member Posts: 400
    Hello all people and good morning.
    Im searching at forum and all sites to one trajectory with same position of x as my actor launcher.
    Anyone know any template or how to do it in the template orbz?
  • mrpacogpmrpacogp Member Posts: 400
    edited December 2012
    Bump

    Still looking for how to do it when my actor its on any position different of x=0
    for spawn trajectory i use self.Plot Index / self.Plot Points * game.Display Size.Width same is on the canon template...maybe using display size width - canon position x or something?

    Im searching for all sites and no templates with trajectory like angry birds or something.
    I have the commented above working with x values corrects, but y values some higher...
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited December 2012
    Are you asking how to modify Orbz' Trajectory Demo so that you can move the canon around to any X location and still have it work? If yes, here is how to do it.

    First, make a game-level attribute (type = real) and call it something like 'gunXPosition'.

    Second, use a constrain attribute behavior at the top of the gun actor's behavior list:
    Constrain Attribute: gunXPosition To: self.Position.X

    Third, in the gun actor's spawn behavior, change the horizontal position equation (->) to:( self.Plot Index / self.Plot Points * game.Display Size.Width )+ game.gunXPosition

    Last, in the plot point actor's constrain behavior, change the equation to:
    max(-10, self.Init Y +( self.Position.X - game.gunXPosition )*tan( game.Launch Angle )-( game.Gravity *( game.gunXPosition - self.Position.X )^2)/(2*( game.Launch Velocity *cos( game.Launch Angle ))^2))

    (Notice that 'game.gunXPosition' was embedded into that last equation in two places.)
  • mrpacogpmrpacogp Member Posts: 400
    edited December 2012
    thank you for answer that, yes i`m working on that. let me a few minutes for test what you suggest ...and thank you very much for your support!!!!!!

    Tested and working.
    Your are the best man!!! Two days fighting with that equation. And got the first part, but the second .... just about to make crazy you come and rescue me!!!
    Thank you very much another time!!!!!!!
  • eskillroyeskillroy Member Posts: 1
    Thanks a lot RThurman. I was in the same position trying to figure out how to get the same thing to work.

    I have another related question. I tried making changes to Orbz trajectory template and everything worked fine. However, when I tried to replicate the same template from scratch, I could get the gun and projectile to function properly, but the plot point trajectory would not show up. I tried many different things including changing Plot Index and Plot Points value but all I could get was just one plot point in the trajectory spawning next to the gun. Changing the Plot Index to 10 or more resulted in that single plot point moving around the gun but I could never get more than one plot point.

    I have repeatedly looked at the template but I can see no difference apart from the fact that the Plot Index attribute is an Index attribute in Orbz template while I do not have the index attribute option is GS Windows. I have used the Real attribute with a value set to 0.

    Can you please let me know what I might be doing wrong?

    Thanks
  • mrpacogpmrpacogp Member Posts: 400
    HI there!!
    I `m trying to set before the cannon another actor constrained but it feel very ugly. What is your opinion?
    https://www.dropbox.com/sh/sk5rhk9i0hrrbu2/sbqjcfODPy

    Thank you very much
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    This is a completely different question. Why not start a new discussion?
Sign In or Register to comment.