autocaulk tool


(C) #21

I did only look at Your code for a few seconds… because i could not understand why You process all the numbers on a line, while You want to replace the texture/shader-names.
i know TP, i once bought it… (waaaay back in the late 80’s or begin 90’s)… I use Delphi now for most of my programming,… (and other languages on occasion)

I have a tip for You: Create the initial program in pseudo-code, and then later replace it with real code graduately…
And… create more functions, so it is easier to spot errors (debug)

I find this strange:

the variables get the numbers -32 -32 48 32 -32 48 32 -32 (all correct so far) and 0 (that means it did not get any value)

a 0 means no valid value in Your proggy?.. but what if there is a brush constructed on the map’s origin (0,0,0) ?.. 0 can be a valid number too.

can tp handle strings faster than numbers
for a computer everything is a number when it gets to the CPU…
Strings usually take more memory than numbers… any floating-point number is only 4 bytes long in memory, and a string can be much longer (a TP7 string always takes 256 bytes… so what if Your .map lines are longer??).
It takes more effort to search/compare strings than to compare numbers…

And… if replacing some text for another text is all You want to do, why not just open a text-editor and find/replace “radiant/notex” with “common/caulk”?..

i am still convinced that the program hasnt a mistake
:slight_smile: this just sounds funny to me…


(isbowhten) #22

the problem has been solved…
i added if tzhe last char of that string is a ’ ’ then delete it…
but that is so ****ing weird because all the other spaces ’ ’ always had been deleted already.

well… it seems that tp has limits of the size of a map… i halfed goldrush (then 7mb)… full goldrush could not be opened…
well lines that are longer than 255… in a map build with “snap to the grid” and a rather big grid and simple directories for trxtures should not hit this.
i dont want to replace textures only !
i want to put caulk on surfaces that cant be seen, so no way with editor.

anyway that 7mb file (halfed golrush) took more than 10 minutes just to read out the numbers.

i wanna learn some other languages when i have time and come back to this then.


(ailmanki) #23

your code will be at same speed in C.
Its not the language its the code…
Beside if you want to move on, use freepascal.

You need to learn better technics to read a file, the limitations you hit cause the stuff u use to read the file, have not been thought for what you do. Also they are slow.

I really suggest you have a look at the original code from gtkradiant. It can read/write these files… what do you want more?


(isbowhten) #24

i never copy.

i do all my stuff alone with thinking by myself.
the risk, not to be able to prgram what i want, is it worth to learn programming in my own way.

the language does raelly matter.
while turbo pascal doesnt have a command parsing a string like “3+4”, java can give you “7” as result even if it is a string.
eval() is what i am talking about…
new, better commands mean that the code also changes.
this does not mean that it is faster, but i am sure it is cause java is new and turbo pascal is old

so i do not have to use my code anymore, cause i can have a more easier one


(C) #25

i want to put caulk on surfaces that cant be seen

Even if You have all Your numbers from the .map-file, … You know those numbers describe planes (not brushfaces)?..
A typical brush consists of 6 faces (sides), but in the .map these 6 faces are not listed…
A line in the .map holds 3 vertex, with which You could create a triangle… but…You cannot make a complete brushside of just 3 points (the 6-sided brush needs 4 vertexes per face)…

So… You need more calculation to know the exact vertexes that make a face of a brush.
Otherwise You would process only half a map.

You first have to make planes for all sides of the brush,… then intersect the planes to find the corner-points of a brush (the face of a brush).


When You have all the faces of a map, Your application would have to calculate if a brushface is visible (from any point within boundries of the map)…
It may be an ambitious project for You… but if You would manage to learn all this, You would gain a whole new insight in mapping.


btw: There is also this Delphi-clone called Lazarus… it is free.


(isbowhten) #26

you dont have to tell me this in a thread, where i did not ask for it,
i already know this,
and i CAN calculate if a surface is seen or not if i ignore clip brushes.
thanks maybe i have a look at this clone when i have holidays from school


(C) #27

It was my intention to help, give information…
(nobody told me how it worked, when i was finding my own answers).

I remember me loading my first map in my home-made map-loader… and i saw only triangles, and half my map was missing triangles… that was a typical WT* moment for me back then.
After i found out how (and why) they store a .map like that, i also understood the way a BSP works (with all the planes instead of brushes, the protals/leafs etc)…and the whole jigsaw fell in place for me…

In fact, I think it is good to create a program like You do… like i said, You learn a lot from it.
Just keep it up!


(isbowhten) #28

thanks for motivating me xD