Archive 17/01/2023.

[SOLVED] How to use resources in *.pak

codingmonkey

hi [size=50]world[/size] folks!)
i found some interesting section on urho.io and read this info about packages:
urho3d.github.io/documentation/H … urces.html

I was especialy interested in this:

then i go to test this:
i copy my bin directory with worked testscene.exe and create *.bat file:

PackageTool.exe CoreData\ CoreData.pak -c PackageTool.exe Data\ Data.pak -c

after packages compile two *.pak file i delete old dirs Data\ and CoreData\

Then i try to run testscene.exe and it not runnning(
why? i forgot something, to do ?

Pellucas

No problem on OSX

codingmonkey

how do you make the packages ?

in the program anything needed to rewrite or add some code? for use *.pak’s
or it just if there are no folders ResourceCache will search for packages ?

i try to debug my app with only pakages and it handle error on getting “cameraNode” of Scene.
this getNode it’s first get in program, and it ended with err.
I think that the scene is not loaded as needed, but why :question:

codingmonkey

i rewrite scene loading proc
and now it’s work

void GameMain::LoadScene(Urho3D::String sceneFileName) 
{
	scene_ = new Scene(context_);
	
	//File sceneFile(context_, 
	//				GetSubsystem<FileSystem>()->GetProgramDir() + "Data/Scenes/" + sceneFileName,
	//				FILE_READ);
	
	File sceneFile (context_, 
					new PackageFile(context_,GetSubsystem<FileSystem>()->GetProgramDir() +"/Data.pak"), 
					"Scenes/" + sceneFileName);

	scene_->LoadXML(sceneFile);
}