Saving Locations of Actors

Hi...
como o título deste post, eu criei esta função, seguindo um tutorial de GShelper.
link here

But, I just needed create 1 actor (my player) and the movements from him are not Drag and Drop, they are pressing arrow left and right, and save the position every time that I press this arrows, I created some actors for the locations, and put them on a Tag (locations), and then my player Colide with the Tag (location), save the position on table.

all right so far!!!

my problem is:

it is saving when my player touch the actor location, but, I need save only when my player arrive on the center of the actor location. I mean, when touched "center from center"

I explained clearly?

Comments

  • FingertainmentFingertainment Member Posts: 5
    I'm not sure if I understood it properly but here goes nothing:

    1. Create a attribute x and attribute y make them both real attributes.

    2. Go into your player and constrain them to its x and y.

    3. Now create another two attributes call them whatever you want but here ill call them attribute x2 and attribute y2.

    4. Now for your location actors you want to create a rule saying when I collides with player change attribute x2 and y2 to self x and self y.

    5. Then in your player you make a rule saying when x and y = x2 and y2 do whatever you need it to do.

    Let me know if this works for you,

    Cheers.
  • doug_smuppetdoug_smuppet Member Posts: 99
    let me show you an example:

    image

    in my file, it's happening for me, the first example

    I have a doubt in your explanation. (I don't know so much about GS)

    1 - create a Game Attributes, all rigth?

    2 - go into my player e create a Constrain Attribute and
    ___Constrain: game.x to: self.position.x
    ___Constrain: game.y to: self.position.y

    3 - create another two attributes as Real?

    4 - Create a Rule when collide with the player:
    ___Change Attribute set: game.x2 to: self.positon.x
    ___Change Attribute set: game.y2 to: self.positon.y

    thanks
  • Brand0n1210Brand0n1210 Member Posts: 12
    Yup you got it, it should work for you I had to do something similar to that once.
  • Brand0n1210Brand0n1210 Member Posts: 12
    Basically what the code is doing for you is recording your players position in the x and y attributes (which is the center of your player) then whenever the player touches a location point the attribute x2 and y2 turn into the center of the location point. Then all you have to do is create a rule saying when x and y = x2 and y2 do what ever you need it to do.
  • Brand0n1210Brand0n1210 Member Posts: 12
    Btw I am fingertainment I didn't know I was signed into my old account.
  • doug_smuppetdoug_smuppet Member Posts: 99
    ok @Brand0n1210, maybe it's easy do this... but not worked for me.. or better saying.. I don't know how do this.

    Can you explain in more details?
  • Brand0n1210Brand0n1210 Member Posts: 12
    Give me your email (idk how to post files here) and tommoro night (sorry I have a ton of hw to do tonight and work all day tommoro) I will create a gamesalad file of it working.
  • doug_smuppetdoug_smuppet Member Posts: 99
    ok
Sign In or Register to comment.