User Tag List

Results 1 to 6 of 6

Thread: NPCs and INI files

  1. #1
    No Products Registered

    Join Date
    Dec 2008
    Location
    http://kromblite.weebly.com/
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    NPCs and INI files

    I have two more things I can't figure out. I'm trying to make an RPG-ish NPC system complete with text that appears one level at a time. To do this, I used a tutorial and got the application to transfer a letter every 5 100ths of a second from one string object to another. Unfortunately, I have not been able to make a condition to test for when the two strings are equal (meaning the dialogue has all of the needed letters added to it). I've tried using a global string and comparing to that, but it didn't work- I can't figure out how to use the expression editor for anything but numbers.

    I'm also making an INI based save system, but I can't figure out what directory to put save files in- if they're in C:, the directory varies depending on the OS. I'd like to save them in a folder right outside the application, but I don't know how to save files in a non-specific location relative to the application.

    Sorry for the wall of text. Can anyone help?

  2. #2
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: NPCs and INI files

    For saving you can do apppath$+"game.ini" and it will be in the same directory as your game.

  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: NPCs and INI files

    The AppPath$ part of the file path isn't needed; simply using "Save.ini" will save/load to the current directory.

    As for the string comparison, you can easily compare strings; in the Special object, Compare Two General Values, you can compare two expressions to each other. You can compare teo values, or you can compare two strings, as you want to do.

    Also, for future reference, Val(>String<) takes a number in string format (eg "100") and converts it to a number value, and Str$(>Value<) takes a number (eg 100) and converts it to string format.
    Working as fast as I can on Fusion 3

  4. #4
    No Products Registered

    Join Date
    Dec 2008
    Location
    http://kromblite.weebly.com/
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: NPCs and INI files

    Save.ini actually saved to C:\WINDOWS. Still, Apppath$+"Save.ini" worked. I'd like to know how to put the save file in a folder next to the application, but this is fine for now. The "compare two general values" expression editor will make things much easier, so thanks for the advice, but it turns out I was just grabbing the text of "paragraph 1" instead of the text object's current displayed text. Anyway, thanks for the help!

  5. #5
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: NPCs and INI files

    Yeah I was thinking you had to have a file path for the directory. Although I was under the impression it saved in AppData by default but apparently not. I know the hi-score object saves in AppData without a file path.

    As for a folder, you would just have to have Apppath$+"\folder\"+"save.ini".

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: NPCs and INI files

    Ahh, yes, sorry, I was think of objects in general when I said that it saves like that. For the INI object in specific, it breaks this rule of thumb and saves to the Windows directory like you said.
    Working as fast as I can on Fusion 3

Similar Threads

  1. "Flash / INI object: now loads INI files stored as binary files in the application."
    By EdibleWare in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 2nd July 2014, 10:22 AM
  2. Loading files such as INI,Text files, List Files?
    By Gibbon in forum SWF/Flash Export Module Version 2.0
    Replies: 3
    Last Post: 21st July 2012, 06:41 AM
  3. INI files versus XML files - which one's better?
    By TheSynapse in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 6th April 2012, 03:14 PM
  4. How to make NPCs move randomly throughout a maze
    By RickyRombo in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 9th September 2009, 11:59 AM
  5. Making conversations between NPCs global events?
    By Krim in forum File Archive
    Replies: 5
    Last Post: 31st May 2007, 09:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •