Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Packaging a txt. file  (Read 2436 times)

0 Members and 1 Guest are viewing this topic.

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Packaging a txt. file
« on: June 21, 2007, 10:15:47 PM »

Hi there,

following thing, we read some txt files out with additional text information for the player, for something like an diary. This runs perfect in debug mode, but when compiling it, it doesn't work and gives out a [null].
Is it not possible to put the txt files in a package? Or do we need a workaround?

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Packaging a txt. file
« Reply #1 on: June 22, 2007, 09:19:04 AM »

It should be possible. In what way exactly are you using the text file in your scripts?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Re: Packaging a txt. file
« Reply #2 on: June 22, 2007, 12:46:50 PM »

function Hilfetext_ON()
{
   var TextFile = new File("txt\hilfe\hilfe_" + story + ".txt");
   TextFile.OpenAsText(1);
   helpscreen = PDAWin.GetWidget("helpscreen");
   helpscreen.Text = TextFile.ReadText(TextFile.Length);
   TextFile.Close();
   helpscreen.AlphaColor = MakeRGBA(255, 255, 255, 0);
}

Thats the way how they get loaded. The "txt" is the packagefolder, the rest of the path are subfolders.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Packaging a txt. file
« Reply #3 on: June 22, 2007, 01:00:13 PM »

If 'txt' is the name of the package, it shouldn't be included in the path when referencing the file. That's the cause of your problem.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Re: Packaging a txt. file
« Reply #4 on: June 22, 2007, 05:35:33 PM »

Thanks, it works now.
 

Page created in 0.044 seconds with 23 queries.