Hello!
I have this problem : When we have multiple avatars on the same map and one of them moves to another map, it moves ALL the avatars to the same map.
I use the method openspace.loadMap(roomName) to change maps.
Please help me. I have looking for an answer for 3 days an I'm stuck here.
all avatars go to same map problem
-
- Posts: 15
- Joined: 14 Sep 2011, 19:44
I think you should double check your code, because this is not happening in our tests. What happens if you have two clients opened and tell client A to load a new map? Do you see the map being switched on client B too?
What I need to understand is the same on both clients or not.
What I need to understand is the same on both clients or not.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
-
- Posts: 15
- Joined: 14 Sep 2011, 19:44
-
- Posts: 15
- Joined: 14 Sep 2011, 19:44
Thank you for you quick response. After somo more tests on different clients. We have found that this problem is intermittent. Some times an avatar drags all of them to the same room, some times one avatar can change room without affecting all others and sometimes one avtar drags only another ONE avatar whit it.
It's really strange...
It's really strange...
-
- Posts: 15
- Joined: 14 Sep 2011, 19:44
This is a part of my code:
And then, we have the loadMapFormTrigger code (the same as the Ranch example)
And we add the triggers and params in the openSpace editor and everything passes ok.
Code: Select all
private function onAvatarStopOverTile(e:AvatarEvent):void
{
if (e.params.trigger.target == "cambiarRoom"){
loadMapFromTrigger(e.params.trigger);
}
}
And then, we have the loadMapFormTrigger code (the same as the Ranch example)
Code: Select all
public function loadMapFromTrigger(trigger:Trigger):void
{
var params:Array = trigger.params.split("|");
var roomName:String = params[0];
var coords:Array = params[1].split(",")
var dir:int = params[2]
if (coords.length == 2)
{
nextCenteringCoords = new Point(coords[0], coords[1]);
nextDir = dir;
}
os.loadMap(roomName);
}
And we add the triggers and params in the openSpace editor and everything passes ok.
-
- Posts: 15
- Joined: 14 Sep 2011, 19:44
I finally got it!
The answer was in the question it self!
When you make your map on the OpenSpace Editor, you create the triggers and there is a little checkbox that reads "ALL AVATARS"!!
Looking here I realized my error.
You just have to leave this UNCHECKED so that the trigger only affects ONE AVATAR, not ALL of them!
Thank you for your support on all my questions.
The answer was in the question it self!
When you make your map on the OpenSpace Editor, you create the triggers and there is a little checkbox that reads "ALL AVATARS"!!
Looking here I realized my error.
You just have to leave this UNCHECKED so that the trigger only affects ONE AVATAR, not ALL of them!
Thank you for your support on all my questions.
Return to “OpenSpace v2 discussions and help”
Who is online
Users browsing this forum: No registered users and 34 guests