Jump to content

Sign in to follow this  
hftrade

FileMode.WRITE Handle always = 0

Recommended Posts

After update, not work write in file.

v_fHandle    =    OpenFile(v_FileName, FileMode.WRITE);

filehandle always equal 0.

Share this post


Link to post
Share on other sites

Does the file exist? I don't think they would've changed anything for OpenFile.

Share this post


Link to post
Share on other sites

It's confirmed broken by numerous modders. Just wait till they fix it.

  • Like 1

Share this post


Link to post
Share on other sites
  On 11/9/2018 at 5:55 AM, IMT said:

Does the file exist? I don't think they would've changed anything for OpenFile.

read\append\FileExist - it works

OpenFile - not

I've checked with and without a file

Share this post


Link to post
Share on other sites
  On 11/9/2018 at 6:09 AM, hftrade said:

read\append\FileExist - it works

OpenFile - not

I've checked with and without a file

Well, seems I was wrong, it's broken:

  On 11/9/2018 at 6:09 AM, DannyDog said:

It's confirmed broken by numerous modders. Just wait till they fix it.

 

Share this post


Link to post
Share on other sites

Getting reports that it's fixed now. This also explains why crafting broke in the previous patch.

Share this post


Link to post
Share on other sites
  On 11/9/2018 at 3:24 PM, DannyDog said:

Getting reports that it's fixed now.

........

v_fHandle    =    OpenFile(cv_fName, FileMode.WRITE);
Print(string.Format("v_fHandle: %1", v_fHandle));

.........

SCRIPT       :  cv_fName: $profile:SF_DB_CURRENCY.bin
SCRIPT       :  v_fHandle: 0x0000000000000000

Share this post


Link to post
Share on other sites

OpenFile() seems still broken, if you absolutely need it i suggest trying with FileSerializer.

Share this post


Link to post
Share on other sites
FileSerializer	file	=	new FileSerializer();
if (file.Open(cv_fName, FileMode.WRITE))
	{
		Print("+++++");
		file.Write(cv_CPS);
		CloseFile(file);
	}
else
	{Print("-----");}

-----

Edited by hftrade

Share this post


Link to post
Share on other sites
  On 11/9/2018 at 7:12 PM, hftrade said:
FileSerializer	file	=	new FileSerializer();
if (file.Open(cv_fName, FileMode.WRITE))
	{
		Print("+++++");
		file.Write(cv_CPS);
		CloseFile(file);
	}
else
	{Print("-----");}

-----

result:

SCRIPT       : Registered 365 temporary action enum(s), UAN==365
SCRIPT       : CreateGame()
SCRIPT       : -----

SCRIPT    (E): ScriptSerializer writing not allowed!

 

Edited by AXEL777

Share this post


Link to post
Share on other sites
  On 11/10/2018 at 11:30 AM, AXEL777 said:

how? please, describe this

Random russian spam i guess, ignore it.

Fixed the write issue by adding -scrAllowFileWrite launch option. (thx kerkkoh for wasting a few days on -srcAllowFileWrite :D :P )

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×