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

Game development with Board Game Arena Studio
Post Reply
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

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

Post 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 :)
Last edited by Rudolf on 11 May 2013, 00:57, edited 2 times in total.
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

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

Post 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 ^^
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

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

Post 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 ...
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

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

Post 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???
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

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

Post by Rudolf »

Solved: that was a combination of Slide, the return was done and because they were executed at same time, nothing was moving.
Post Reply

Return to “Developers”