How can I load the JS files from an index file in a different directory

Joined
May 25, 2015
Messages
1
Reaction score
0
First Language
English
Primarily Uses
Hello. I have created an MV project and deployed it as an android app. It gives me a directory called 'www' within a directory named after my game; the 'www' directory has an index.html file that calls the required scripts to start the game processing. Now, what I've done is placed this 'www' directory on a website and, using a PHP file in a different directory, I've recreated the html that the index file in the 'www' directory uses to start my game and correctly altered the href of the required script libraries. However, since the PHP file is being run as example.com/php-page, the scripts called from within the RPG Maker MV are inaccessible to the body, where the scripts are placed within the document. I get errors in my console saying can not load resource example.com/php-page/www/js/** . This is obviously because the MV resources are in a directory next to the directory with my php files that construct my content management system and MV resources are calling from a relative path to that of the PHP file. 


My question now becomes, does anyone have an idea how I should go about getting the MV scripts within  to correctly load from a path of my choosing? If it helps, the site is www.guelstie.com, and the game is currently playing off the originally deployed index file within it's own directory on my site at http://www.guelstie.com/games/Tamria. I'm trying to add some security to the game so that you can only play if you're logged in. 
 

ロリ先輩

ロリだけど先輩だよ
Veteran
Joined
Mar 13, 2012
Messages
379
Reaction score
96
Primarily Uses
Just put the php file in the same directory as your assets. PHP embeds into HTML very well, so you shouldn't have to proxy it at a different URL. If you really need to mask the URL, I recommend using custom settings in NGINX or Apache (not sure if IIS supports this) to route example.com/php-page directly to your game directory.


KISS. There's no real reason to over engineer.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top