- NSIS Discussion
- Super Function Task
Archive: Super Function Task
Afrow UK
7th March 2003 23:45 UTC
Super Function Task
I have a super task that I would like to see if anyone can do it...
1. It will search for any .wal files listed inside a .map file
2. It will assign the list of .wal files to a string.
2x. There will be more than 1 of the .wal files in the .map file.
3. It will print a list of all .wal files used in the .map.
4. It will check if the .wal files exist in a directory. If they do not, then it will alert the user with a 'texture.wal was not found in textures dir' message.
Seems a task that is very complex!
-Stuart
kichik
8th March 2003 11:07 UTC
Open the file, read line by line, if the line ends with .wal (StrCpy $0 $1 -4) check if the file exists, and if it doesn't print a warning.
That assumes of course that the files are listed line by line. If they are not just process it. For example, if they are listed in the form of FileSize=filename.wal then just use StrStr to skip the equal sign.
Afrow UK
8th March 2003 11:20 UTC
Anyone going to write the code though :p
-Stuart
Sunjammer
8th March 2003 11:21 UTC
I might have a go later tonight, depends if I pass my motorbike test I've got to do sometime in the next few hours :) (depends 'cause if I don't pass I might be miserable :P)
Afrow UK
8th March 2003 13:25 UTC
Heh!
Good luck, and don't fall off :p
Btw, my dad used to ride motor bikes till he fell off and did a lot of damage to himself and what ever he went into lol.
Sorry, musn't put you off!
I should try doing this script myself, but I have no idea how or what to do, let alone where to start.
-Stuart :)
Afrow UK
8th March 2003 14:02 UTC
New modified task...
1. Gets list of wal files in map
2. Prints only wal files from list that aren't found in the textures directoy.
Also, the wal files will have directories assigned to them...
e.g.
afrowuk/afrow_wall2.wal
It will then have to check whether textures\afrowuk\afrow_wall2.wal exists or not. If it doesn't then it needs to print a message saying that it doesn't exist.
I still can't think how this would be done.
Some sort of function with a loop in it.
First loop, gets wal file no1 and finds if it exists.
Loops, and goes to next wal file etc
-Stuart :o
Sunjammer
8th March 2003 20:32 UTC
Hee hee I passed :)
Afrow UK
8th March 2003 20:55 UTC
????
Goo you really are god you!
Show us the script and I shall give you a prize!!!!
-Stuart :)
kichik
9th March 2003 17:00 UTC
First one:
ClearErrors
FileOpen$0 file.map
IfErrors error
loop:
FileRead $0 $1
StrCmp$1 "" done
StrCpy$2 $1 -4
StrCmp$2 ".wal" 0 loop
DetailPrint$1
IfFileExists"$INSTDIR\\$1" loop
DetailPrint "Warning: file doesn't exist!"
Goto loop
error:
Abort "Error"
>done:
FileClose $0
>
Not so hard to get to the second.
kichik
9th March 2003 17:00 UTC
Oh, and congratulations Sunjammer! :D
Afrow UK
11th March 2003 18:52 UTC
What comes next?
I tried the script but $1 prints nothing
I have set it to target a definate map file too.
-Stuart
kichik
12th March 2003 20:56 UTC
If that script prints nothing attach a zip with an example .map file.
kichik
15th March 2003 10:35 UTC
There are no .wal files listed in that file.
Afrow UK
15th March 2003 12:58 UTC
Really?
The .map file is what stores all the map structure data including what textures go on which surface.
I shall try the script on a .bsp file instead.
Does that mean the .map file stores the .wal files in an encipted way?
-Stuart
Afrow UK
15th March 2003 13:04 UTC
Right OK, I found the textures.
They don't have .wal on the end of them...
( -10 2250 664 ) ( -10 2376 664 ) ( 117 2250 664 ) e1u1/sky1 0 2304 0 1.000000 1.000000 0 133 0
The e1u1/sky1 bit is the texture (goes in C:\quake2\baseq2\textures\e1u1\sky1.wal)
This makes it even harder to get only the .wal bits out of it.
I will look at other ways of getting it, for example..
Search for
) path/file
Edit:
.bsp files are the same. They don't have the .wal extension on the ends.
-Stuart