View Full Version : Super Function Task
7th March 2003, 22:45
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!
8th March 2003, 10:07
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.
8th March 2003, 10:20
Anyone going to write the code though :p
8th March 2003, 10:21
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)
8th March 2003, 12:25
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.
8th March 2003, 13:02
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...
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
8th March 2003, 19:32
Hee hee I passed :)
8th March 2003, 19:55
Goo you really are god you!
Show us the script and I shall give you a prize!!!!
9th March 2003, 16:00
FileOpen $0 file.map
FileRead $0 $1
StrCmp $1 "" done
StrCpy $2 $1 -4
StrCmp $2 ".wal" 0 loop
IfFileExists "$INSTDIR\\$1" loop
DetailPrint "Warning: file doesn't exist!"
Not so hard to get to the second.
9th March 2003, 16:00
Oh, and congratulations Sunjammer! :D
11th March 2003, 17:52
What comes next?
I tried the script but $1 prints nothing
I have set it to target a definate map file too.
12th March 2003, 19:56
If that script prints nothing attach a zip with an example .map file.
13th March 2003, 18:37
15th March 2003, 09:35
There are no .wal files listed in that file.
15th March 2003, 11:58
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?
15th March 2003, 12:04
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..
.bsp files are the same. They don't have the .wal extension on the ends.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.