Are you trying to make something like a little map that is displayed in the corner of the screen that shows the locations of the actors in relationship to you? (Like the type of map display often shown in first-person-shooter games on console games?)
Alright. I got something that works, at least on a basic level, but it may not be helpful depending on the size of your screen, number of actors you want to track, etc... It uses a bit of math, so I made my sizes and stuff to fit the math, but that may not be possible for you, depending on what you're going for.
Basically what I did was this:
First I created 2 actors. One is the REAL actor (the REAL actor is the one that moves around your whole scene) and the other is the MAP actor (the MAP actor displays on the little map).
I created 2 game attributes to store the X and Y positions of the REAL actor. I called the attributes "RealActorPosX" & "RealActorPosY". They are both real numbers.
In the REAL actor I set 2 Constrain Attributes: Constrain game.RealActorPosX to self.Position.X Constrain game.RealActorPosY to self.Position.Y
In the MAP actor I also set 2 Constrain Attributes: Constrain self.Position.X to game.RealActorPosX/40 Constrain self.Position.Y to game.RealActorPosY/40
Then I just made a little map background and placed it down in the lower left corner behind the MAP actor.
And that's about it.
Now, I'll try to explain what's going on, where the numbers came from, and how you might be able to make it work for your project. All that is happening is that the REAL actor is updating the game attributes to its position, and the MAP actor is taking those numbers and setting itself to smaller versions. I set my scene to be 10 screens wide and 10 screens tall, so the numbers would all be multiples of ten. (If I had divided by 10 in the MAP actor constrains, the movement would have been recorded across the entire screen. Dividing by 20 would have made the map half the screen size. I chose 40 to make it a fourth of the screen size.) In order to set this up for your actors, I believe each actor would need both of those game attributes (X & Y Positions, two for each REAL actor) and they would all need to constrain the attributes to their positions. The MAP actors would then just read those positions, and adjust accordingly.
The two concerns I have are: If you have a bunch of actors, you will have to set up twice as many game attributes for them (EG: if you are tracking 10 actors, that's an extra 20 game attributes). Also, I've read that Constrain Attributes are taxing on the processor and you will have 4 for each REAL actor. That could seriously slow down your game if you have a lot of REAL actors...
But that's my take on the issue. If you have questions or want me to send you the project file, just give me your email and I'll send it your way.
Comments
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Basically what I did was this:
First I created 2 actors. One is the REAL actor (the REAL actor is the one that moves around your whole scene) and the other is the MAP actor (the MAP actor displays on the little map).
I created 2 game attributes to store the X and Y positions of the REAL actor. I called the attributes "RealActorPosX" & "RealActorPosY". They are both real numbers.
In the REAL actor I set 2 Constrain Attributes:
Constrain game.RealActorPosX to self.Position.X
Constrain game.RealActorPosY to self.Position.Y
In the MAP actor I also set 2 Constrain Attributes:
Constrain self.Position.X to game.RealActorPosX/40
Constrain self.Position.Y to game.RealActorPosY/40
Then I just made a little map background and placed it down in the lower left corner behind the MAP actor.
And that's about it.
Now, I'll try to explain what's going on, where the numbers came from, and how you might be able to make it work for your project. All that is happening is that the REAL actor is updating the game attributes to its position, and the MAP actor is taking those numbers and setting itself to smaller versions. I set my scene to be 10 screens wide and 10 screens tall, so the numbers would all be multiples of ten. (If I had divided by 10 in the MAP actor constrains, the movement would have been recorded across the entire screen. Dividing by 20 would have made the map half the screen size. I chose 40 to make it a fourth of the screen size.) In order to set this up for your actors, I believe each actor would need both of those game attributes (X & Y Positions, two for each REAL actor) and they would all need to constrain the attributes to their positions. The MAP actors would then just read those positions, and adjust accordingly.
The two concerns I have are: If you have a bunch of actors, you will have to set up twice as many game attributes for them (EG: if you are tracking 10 actors, that's an extra 20 game attributes). Also, I've read that Constrain Attributes are taxing on the processor and you will have 4 for each REAL actor. That could seriously slow down your game if you have a lot of REAL actors...
But that's my take on the issue. If you have questions or want me to send you the project file, just give me your email and I'll send it your way.
Good luck!