Custom card field null in db

Game development with Board Game Arena Studio
Post Reply
User avatar
Shyghar
Posts: 4
Joined: 06 November 2020, 17:04

Custom card field null in db

Post by Shyghar »

Hi,
I'm trying to define a deck with card with a custom field in this way but in my bd the 'direction' field is always empty : (
Can someone help me finding the error?

dbmodel
CREATE TABLE IF NOT EXISTS `cardGK` (
`card_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`card_type` varchar(16) NOT NULL,
`card_type_arg` int(11) NOT NULL,
`card_location` varchar(16) NOT NULL,
`card_location_arg` int(11) NOT NULL,
`direction` varchar(16) NOT NULL,
PRIMARY KEY (`card_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
material.inc.php
$this->goalKeeperCars[] = array( 'type' => 'goalkeeper', 'type_arg' => 3, 'direction' => 'dx' , 'nbr' => 1 );
$this->goalKeeperCars[] = array( 'type' => 'goalkeeper', 'type_arg' => 3, 'direction' => 'sx' , 'nbr' => 2 );
..
xxxxx.game.php
__construct( ){
..
$this->GKDeck = self::getNew( "module.common.deck" );
$this->GKDeck ->init( "cardGK" );
}

setupNewGame( $players, $options = array() ){
..
$this->GKDeck->createCards($this->goalKeeperCars, 'deck' );
}
Thank you in advice ^^
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: Custom card field null in db

Post by Tisaac »

Well that's simply because the deck does not handle custom fields...
So you will need to add them by hand, or to use the v2 Deck component I made that handle that (Victoria also have one).
Post Reply

Return to “Developers”