Splitting material.inc

Game development with Board Game Arena Studio
Post Reply
User avatar
Lunalol
Posts: 584
Joined: 09 October 2016, 23:21

Splitting material.inc

Post by Lunalol »

Hi. Is there a way to split "material.inc" using require_once ?

require_once("module/something.php") doesn't work, bad path.
require_once("something.php") doesn't work, bad path.

Inclusion works in js with : g_gamethemeurl + "modules/something.js
Inclusion works in php but only in mygame.game.php not in material.inc

Thansk a lot.
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

Re: Splitting material.inc

Post by Draasill »

I didn't try, but maybe you can use __DIR__ ?

Code: Select all

require_once __DIR__ . "/foobar.php";
User avatar
Brainchild
Posts: 71
Joined: 31 January 2014, 19:42

Re: Splitting material.inc

Post by Brainchild »

Lunalol wrote: 29 June 2020, 16:08 Hi. Is there a way to split "material.inc" using require_once ?

require_once("module/something.php") doesn't work, bad path.
The directory name is modules (with an 's'), maybe you just spelled it wrong?
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Splitting material.inc

Post by Tisaac »

Brainchild is right, you just have to put in the right name.
I am using require_once a lot in the Santorini adaptation and it works just fine in the material.inc file.
User avatar
Lunalol
Posts: 584
Joined: 09 October 2016, 23:21

Re: Splitting material.inc

Post by Lunalol »

SOLVED !
The problem was not the 's' (I dont forget it), it was the ONCE, require is ok, require_onde doesn't work (game start but data are losing after).
Post Reply

Return to “Developers”