Pluggy Txt File

Post » Mon Oct 19, 2009 6:41 am

Im try to make pluggy look in a txt file for a string, but i dont think its reading the file right, this is what i have for that bit:

let FileMale := "\DMRaces\Male.txt"...let path := getbipedmodelpath 0 upperbodyreftemplet upperbodystep := stringpos path FileMale


any help? did i put in the file directory wrong? (located at \Documents\My Games\Oblivion\Pluggy\User Files\DMRaces\male.txt)

or is it something else?


User avatar
Jacob Phillips
 
Posts: 3430
Joined: Tue Aug 14, 2007 9:46 am

Post » Mon Oct 19, 2009 10:04 am

Pluggy strings are one kind of strings, OBSE strings are a different kind.

I think what you need here is:
- Create a Pluggy string to hold the Filename >> let psFile := createstring -1 "MyFile.ini" 1 1
- Create a Pluggy string to hold the contents of the file >> let psAllPaths := createstring -1 0 1 1
- Create a Pluggy string to hold the path you are looking for >> let psMyPath := createstring -1 0 1 1
- Read the file to memory >> FileToString psFile psAllPaths

- To search the memory data >>
- - - Place your path into the pluggy string >> setString psMyPath $Path (assuming Path is an OBSE string)
- - - Check if your path is in the file contents >> If StringPos psMyPath psAllPaths > 0

Obs1- I am using "ps" as a prefix for the Pluggy string vars, which must be defined as Long in your script.
Obs2 - Don't forget to use Pluggy DestroyString function when done
Obs3 - Of course, you only have to read the file once if you are going to search it many times.
Obs4 - I suppose you could also convert the file contents into an OBSE string and use OBSE string functions to search it, but I don't know how to do it.
User avatar
Benjamin Holz
 
Posts: 3408
Joined: Fri Oct 19, 2007 9:34 pm

Post » Mon Oct 19, 2009 9:15 am

okay, i changed all those to ther pluggy versions....but still the same problem. The script isnt stalling or anything, it just doesnt connect my string to the one in the file.

Here's what i have on it:

let psFileMale := createstring -1 "Male.txt" 1 1let psAllPathsMale := createstring -1 0 1 1let psMyPath := createstring -1 0 1 1FileToString psFileMale psAllPathsMale...let path := getbipedmodelpath 0 upperbodyreftempsetString psMyPath $PathIf StringPos psMyPath psAllPathsMale > 0...endif


I also tried mkaing the file an ini just to check but it had the same result, in this i also moved it to the base pluggy file directory to aviod any problems there.
User avatar
+++CAZZY
 
Posts: 3403
Joined: Wed Sep 13, 2006 1:04 pm

Post » Sun Oct 18, 2009 7:25 pm

I tried it and the Pluggy part worked as expected.

Print the 'Path' string after the getbipedmodelpath and double check the string is in the file text.
There may be some differences, like "/" vs. "\" or presence/absence of the file extension.
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am

Post » Mon Oct 19, 2009 1:19 am

I don't really have time to help, but in both Map Marker Overhaul and Enhanced Economy I do writing and reading to/from Pluggy strings. So you could look there for ideas.
User avatar
Chris Cross Cabaret Man
 
Posts: 3301
Joined: Tue Jun 19, 2007 11:33 pm

Post » Mon Oct 19, 2009 1:28 am

Well I went in and checked it.

The function returns the following path with an iron cuirass:
Armor\Iron\M\Cuirass.NIF

So i put only that line in my pluggy file:
Armor\Iron\M\Cuirass.NIF

Still doesnt match them.

Im guessing its either this line:
setString psMyPath $Path


or that its not finding the file for some reason.
User avatar
Nicholas C
 
Posts: 3489
Joined: Tue Aug 07, 2007 8:20 am


Return to IV - Oblivion