Jump to content

Packing scripts folder


Soamp
 Share

Recommended Posts

Is there any difference between packing models/texture folder with packing Script folder?

when I try to pack script folder, it will cause a "Can't Open" error.

while when I pack models/textures folders there is nothing wrong. :-??

Link to comment
Share on other sites

and here is additional information :D

post-580-0-29782400-1307718779_thumb.jpg

Language: C++

IDE: VisualStudio 2010

 

in fact we need to know if engine searchs for lua files inside zipped packes?

 

#include "engine.h"
#include <iostream>
#include <string>

const int 	ScreenWidth = 800;
const int 	ScreenHeight = 600;
const char* MediaDir =  ".";
const char* AppTitle = "DSGAME";

void ErrOut( const std::string& message ) { std::cerr << message << std::endl; }

//	-------------------------------
int main( int argn, char* argv[] )
{
if( !Initialize() )
	return 1;        

if( !Graphics(ScreenWidth,ScreenHeight) )
{                
	ErrOut( "Failed to set graphics mode."  );
	return 1;        
}
SetAppTitle( AppTitle ) ;
RegisterAbstractPath( MediaDir );
SetZipStreamPassword("Menu.pak","123");
SetZipStreamPassword("Scripts.pak","123");
TFramework fw = CreateFramework();        
if( fw == NULL )        
{
	ErrOut( "Failed to initialize engine." );                
	return 1;        
}        

SetGlobalObject( "fw", fw );                

BP lua = GetLuaState();        
lua_pushobject( lua, fw );        
lua_setglobal( lua, "fw" );        
lua_pop( lua, 1 );        

while(	GetGlobalNumber("Game") == 1 && !AppTerminate())        
{
	if( !AppSuspended() )
	{
		UpdateFramework();                
		RenderFramework();
		Flip( 0 );        
	}
}
return Terminate();
}

Link to comment
Share on other sites

Hello Soamp, i'm investigating this too, i wasn't able to package the scripts folder.

 

I have a Data folder with all the models, maps, etc and this works like a charm.

 

I'm unsure if you can do this without a modification.

 

This is why i prefer to code most of the important things in c++.

 

EDIT: What you can do in the worst case is put scripts in the data folder, for an instance i have a specific script inside the model folder, so basically what i have in the scripts folder is all generic Leadwerks stuff.

Link to comment
Share on other sites

You can pack model scripts into .pak files but I recommend leaving scripts that get included by other scripts as either the origjnal .lua files, or .luac if you want encrypted precompiled byte code.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

@Roland : Thanks for your attention . I know that. But our scripts are too long and too much.

@Josh: Thanks encrypting is good choice. But luac is not secure encrypting and my base code in lua, and our lua codes are import for me.

Do you know better solution for it?

Link to comment
Share on other sites

Thanks guys

I try to use This Command (“ for /r Your path %s IN ("*.lua") do luac.exe -o %sc %s “) for encrypting all of our Lua Code to LuaC on this time.

Although it’s safe less :) , It’s better than not encrypting.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...