Page 1 of 1

[SOLVED] Need help on how to see why .play() does nothing!

Posted: 09 May 2013, 15:14
by Rudolf
Hello,
well I've got a big pb on which i stump since 3 days.
I've tried to look at it with Firebug, but when i go in dojo with firebug, all the code is displayed on only one line... so it's difficult to trace.
If for example I would like to check what happens in SlideToObject, It's complex.

Is there a better way to go and debug inside this funcitons (have a view of code formated)?
The reason I have to check is that I don't find my problem:
In a case where all the players choose to play an 'eagle' at turn 1, red player put his axe on yellow player,
then all red scouts come back to red player board, prepare to be replaced (because of eagle move).

Then I click on a free place on mountain board, the function SlideScoutFromPlayerBoard is called but nothing is animated and there is no error shown (the database is updated with values, etc..).
This function is moreover used at the beginning of the game and run perfectly during this phase....
I don't understand why it does not run.... the nodes are the right one, it's same bahaviour that in the beginning.... begin and destination are different....
Player is active... it's like play() does nothing...

Code: Select all

                                               SlideScoutFromPlayerBoard: function(zeplayer_id,zenode,index,$scout)
						{ 
							if (typeof zeplayer_id == "undefined") zeplayer_id =0;							
							if (typeof $scout == "undefined")
							{
								var player= this.gamedatas.players[zeplayer_id];							
								$scout = player['scoutstock'];
							}
							var zetempscout = 'scout_'+zeplayer_id+"_"+$scout;
							this.attachToNewParent( zetempscout, zenode ); // To keep position behaviour in case of reduce/enhance
							this.showMessage('OK it arrives here with good nodes!','info');
                                                        this.slideToObject(zetempscout,zenode,1000).play();
						},

To reproduce,
you can open a game, then
1) places all the scouts whereever in mountain board (for each players)
2) play eagle moves for each player
3) BLUE play the pipe on an hunter in plain board
4) RED plays the axe on yellow player board (click on the back square in player board)
5) then RED try to place a scout again on mountain board, nothing slides...
Thanks for ideas :)

Re: Need help on how to see why .play() does nothing!

Posted: 10 May 2013, 02:31
by pikiou
Are you sure zetempscout CSS position isn't static?
Are you sure zetempscout and zenode are positioned where they should be? Maybe "console.log" them to visually check where they are. slideToObject moves the center of an element to the other element center, so widths and heights are important.
Good luck ^^

Re: Need help on how to see why .play() does nothing!

Posted: 10 May 2013, 10:01
by Rudolf
Yes they are positionned (I can check with Firebug), and this.showmessage give me the rights div and coordinates.
I call this function in more than one step (at the beginning, it runs), At this step, no.
vacations are ending, I will have to continue this in a few weeks ...

Re: Need help on how to see why .play() does nothing!

Posted: 10 May 2013, 23:39
by Rudolf
Something Strange: when step goes to next player, the first slide is done, as he was delayed !
Is there something that disable the events or timers ? Maybe I did something wrong in step management?
by the way is it possible to call the same function with different steps???

Re: [SOLVED] Need help on how to see why .play() does nothin

Posted: 11 May 2013, 00:59
by Rudolf
Solved: that was a combination of Slide, the return was done and because they were executed at same time, nothing was moving.