LoadString not working with mojo2

Monkey Forums/Monkey Bug Reports/LoadString not working with mojo2

peterigz(Posted 2015) [#1]
This gives me a 404 error when trying to load test.txt which is properly located in the data folder.

Import mojo2

Function Main()
	New Game()
End

Class Game Extends App

	'summary:The OnCreate Method is called when mojo has been initialized and the application has been successfully created.
	Method OnCreate()
	
		Print LoadString("test.txt")
	
	End

End


Change it to import.mojo and it works fine. Does it in Chrome and Firefox. If I look at the network in the console and click the actual link that it tries to load it comes up fine in the browser, very odd!


ImmutableOctet(SKNG)(Posted 2015) [#2]
That is pretty odd. Mojo 2 just uses 'mojo.app', which then uses the 'BBGame' framework. Keeping that in mind, I don't see why it should be any different. Are you sure everything's being copied to your "data" folder when building with Mojo 2? I remember hearing Mark say you needed to create a 'Canvas' before doing anything in Mojo 2, but I assume that's regarding graphics.


marksibly(Posted 2015) [#3]
Ok, it's to do with the way I'm adding the '.glsl' extensions for text files - think I'll just add this to the standard text file types.


peterigz(Posted 2015) [#4]
Just to confirm this is working fine now in 84b, thanks for the fix!


marksibly(Posted 2015) [#5]
Actually, it's not completely fixed...v84c should be the winner!

The problem is that the CONFIG.MONKEY files in the targets dir use #TEXT_FILES="...blah...", which will have no effect if #TEXT_FILES has already been set to something by the app. v84c will change all these to #TEXT_FILES+="...blah..."