Hi! I'm a noob at ruby scripts and I'd like to make a ruby plugin for converting sketchup models to GTK Radiant editor (Quake III Arena) .map files.
The .map file is basically a .txt file structured as follows:
**```
//entity 0
{
"classname" "worldspawn"
// brush 0
{
( 126 -344 92 ) ( 130 -344 92 ) ( 130 -352 96 ) common/caulk 0 0 90 0.25 0.25 0 0 0
( 126 -336 128 ) ( 126 -352 128 ) ( 126 -336 0 ) gothic_ceiling/woodceiling1a 0 0 90 0.25 0.25 0 0 0
( 130 -344 92 ) ( 126 -344 92 ) ( 130 -344 0 ) gothic_ceiling/woodceiling1a 0 0 90 0.25 0.25 0 0 0
( 130 -352 0 ) ( 130 -336 0 ) ( 122 -352 0 ) common/caulk 0 0 90 0.25 0.25 0 0 0
( 130 -352 0 ) ( 130 -352 128 ) ( 130 -336 0 ) gothic_ceiling/woodceiling1a 0 0 90 0.25 0.25 0 0 0
( 130 -352 0 ) ( 122 -352 0 ) ( 130 -352 128 ) gothic_ceiling/woodceiling1a 0 0 90 0.25 0.25 0 0 0
}
}
where, in a brush (a block), each line represents a plane whith its texture. Each plane is represented by 3 coordinates (a triangle). Planes can only define convex brushes (blocks); no concavities allowed
**```
//entity 0
{
"classname" "worldspawn"
// brush 0
{
( x y z ) ( x y z ) ( x y z ) texturefolder/texture sShift tShift rotation sScale tScale |detail|structural| 0 0
( x y z ) ( x y z ) ( x y z ) texturefolder/texture sShift tShift rotation sScale tScale |detail|structural| 0 0
( x y z ) ( x y z ) ( x y z ) texturefolder/texture sShift tShift rotation sScale tScale |detail|structural| 0 0
( x y z ) ( x y z ) ( x y z ) texturefolder/texture sShift tShift rotation sScale tScale |detail|structural| 0 0
( x y z ) ( x y z ) ( x y z ) texturefolder/texture sShift tShift rotation sScale tScale |detail|structural| 0 0
( x y z ) ( x y z ) ( x y z ) texturefolder/texture sShift tShift rotation sScale tScale |detail|structural| 0 0
}
}
```**
I think what I'm trying to script is at least conceptually quite easy, but I don't know how to start..
The main question I ask is how to make sketchup creat a txt or map file to input converted data into?