logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
xp_ini - .ini file reading/writing

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
FoamBats4All



Joined: 24 Jun 2009
Posts: 8

PostPosted: Wed Oct 12, 2011 4:47    Post subject: xp_ini - .ini file reading/writing Reply with quote

Version: 1.0, 2011-10-11

Download: NWVault

= Description: =
This NWNX4 plugin allows NWScript to create, delete, open, save, close, read from, and write to .ini files located on the host machine.

= Features: =
File I/O
INIFileOpen: Opens a .ini file.
INIFileSave: Saves all changes to an .ini file.
INIFileClose: Closes a .ini file when it is no longer needed.
INIFileCreate: Create a .ini file that does not already exist.
INIFileDelete: Delete a pre-existing .ini file. WARNING: There is no checking for this. Make sure you don't delete something important!
INIFileIsOpen: Checks if a .ini file is already opened.
INIFileIsEmpty: Returns true if a .ini file is empty of content.
INIFileGetPath: Takes an ID of an .ini file and returns its location on the filesystem.

File Settings
INIGetIsUnicode: Returns true if the file is unicode.
INIGetIsMultikey: Returns true if the file supports multiple keys.
INIGetIsMultiline: Returns true if the file supports multiple lines per setting.
INIGetUseSpaces: Returns true if the saver inserts spaces between keys and values.
INISetIsUnicode: Sets/unsets unicode use.
INISetIsMultikey: Allows/disallows multiple keys.
INISetIsMultiline: Allows/disallows multiple lines per value.
INISetUseSpaces: Uses/disuses spaces between keys/values.

INI Reading
INIReadInt: Read an integer value from a section/key.
INIReadFloat: Read a float value from a section/key.
INIReadString: Read a raw (string) value from a section/key.

INI Writing
INIWriteInt: Write an integer to a specific section/key.
INIWriteFloat: Write a float to a specific section/key.
INIWriteString: Write a string (or raw value) to a specific section/key.

= Installation and Support: =
Import the .erf file into your module, and place the .dll file into your NWNX directory. If you need further help, please feel free to contact me, via the information found in my profile. Please report bugs here, or directly to me.

= Change Log: =
2011-10-11 : v1.0 : Initial release.

= Credit: =
Thanks as always to Skywing, for all the help he has provided me. While he didn't directly help with this project, it never would have been made without him.
Jellycan Code's SimpleIni library is the real backbone of this, and a lot of credit should be given to them.

= Screens: =
nwnx.ini dump
Demonstration of custom player file.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
marshallvyper



Joined: 18 Oct 2012
Posts: 5

PostPosted: Thu Oct 18, 2012 4:46    Post subject: Reply with quote

Is there any documentation for this? I have a need to be able to use NWNScript and pull the nwnserver.exe UDP port that it is currently using. I'm assuming this could do that by reading what the gamespy listening port is set to in NWNX.INI file but there doesnt appear to be much in the way of a HowTo for this.

Thanks for the help.
Back to top
View user's profile Send private message
marshallvyper



Joined: 18 Oct 2012
Posts: 5

PostPosted: Thu Oct 18, 2012 19:45    Post subject: Reply with quote

Nevermind. I did it with an env var and used xp_spawn instead. Works great.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group