arCABAL | 2017-11-20 13:55
arCABAL GRUB type generator
25
points ]
 (3 votes)
Script to generate text geometry in a sauerbraten map by simply typing that text into a command.

arCABAL GRUB type generator
for Cube 2 Sauerbraten

Gif of the script in action

Script to generate text geometry in a sauerbraten map by simply typing that text into a command.
Based on cube2_typegen by Nyne. https://github.com/gitnyne/cube2_typegen.
The font used in this script is part of GNU GRUB, licensed under the GPLv3.

FEATURES
- both uppercase and lowercase characters
- punctuation marks
- letters with diacritics
- uppercase and lowercase cyrillic font
- compatible with Linux, Windows, and Mac OS

INSTALLATION
- Extract the content of agtg.zip into your sauerbraten directory and press accept if asked to confirm merging the packages folder
On Linux this is ~/.sauerbraten
On Windows 7 and 10 this is C:\Users\%username%\Documents\My Games\Sauerbraten
On an Apple Mac it is most likely macHD/users/%username%/library/Application Support/sauerbraten/
- add the following line to your autoexec.cfg inside your sauerbraten directory
exec agtg.cfg

USAGE
In edit mode, select the right face of a cube pointing towards one specific direction. See the included agtg.png to see which, and move back so all generated text will appear in your field of vision.
If you don't do this the generated text will be truncated to the part which can be generated in your view as you can only edit in sauerbraten on things which are inside your field of view.
You probably want to use the smallest grid size but bigger text is also possible. with the right face of the cube selected, enter this command:

/agtg Hello World!

as you can see, you don't need to put double quotes "" around your input. However, if you want to generate text with characters which are interpreted by cubescript,
you do have to put double quotes around your input and escape some characters. Characters which mess up up the input are: ^;()[]"
You can escape these characters with a ^ in front. So for example, if you want to generate this string:
this is a string with a ] and a ; but which can still be generated.
you would use:
/agtg "this is a string with a ^] and a ^; but which can still be generated"

These are all the characters which you can generate. I believe they are also all the characters you can type into the game but let me know if I missed any and I will add them.
?1234567890!@#$%^&*()`-=~_+[]\{}|;':^",./<> ßabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZáàäâãåčďéèëêěíìïîñňóòöôõøřšťúùüûůýÿžœæ
ÁÀÄÂÃÅČĎÉÈËÊĚÍÌÏÎÑŇÓÒÖÔÕØŘŠŤÚÙÜÛŮÝŸŽŒÆaбвгдeëжзийклмнoпpcтyфxцчшщъыьэюяґїєAБBГДEËЖЗИЙKЛMHOПPCTУФXЦЧШЩЪЫЬЭЮЯҐЇЄ
tip: you can paste text into the game using clients which use SDL2

font selection:
I've included two fonts in the package. The first font, grubfont, is floating cubes forming the characters of the font. The second font, grubfontbbg (grub font black background),
is the same font but with black cubes around them forming a background. It is generally better to use grubfont to minimalize the wtr of your map.

you can select a font using /agtgfont nameofthefont
so that is one of those two for now:
/agtgfont grubfont
/agtgfont grubfontbbg

you can autocomplete the font selection with tab.

NOTES ON ADDING YOUR OWN FONT
if you want to add your own font, you have to add another folder to your packages folder and use the savebrush command to save each character as a .obr file.
For every character, select it and for example for the letter a, use:
/savebrush yourfontname/a.obr
Use the same filenames as used in grubfont and add your fontname on line 13 of agtg.cfg so agtgfont selection can tab autocomplete it

edit: I seem unable to add the zip file here. Grab the files from github instead: https://github.com/arCABAL/agtg

// arCABAL GRUB Type Generator for Cube 2 Sauerbraten 2017
// Based on cube2_typegen by Nyne. https://github.com/gitnyne/cube2_typegen.
// The font used in this script is part of GNU GRUB, licensed under the GPLv3.
// See the included readme file for more info and how to use.
			
agtgfont =  [if $numargs [selectedfont = $arg1; echo "^f9selected agtg font =^f3"$selectedfont ] [echo "^f9selected agtg font =^f3"$selectedfont]]		

listcomplete agtgfont [

	"grubfont"
	"grubfontbbg"


]; selectedfont = "grubfont"  // by default.


characterlist = [

"?" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "!" "@" "#"			// symbols
"$" "%" "&" "*" "(" ")" "`" "-" "=" "~" "_" "+" "[" "]"
"\" "{" "}" "|" ";" "'" ":" "," "." "/" "" "ß" " "

"a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m"			// lowercase
"n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" 

"A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M"			// uppercase
"N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"

"á" "à" "ä" "â" "ã" "å" "č" "ď" "é" "è" "ë" "ê" "ě"			// diacritics lowercase
"í" "ì" "ï" "î" "ñ" "ň" "ó" "ò" "ö" "ô" "õ" "ø" "ř"
"š" "ť" "ú" "ù" "ü" "û" "ů" "ý" "ÿ" "ž" "œ" "æ" 

"Á" "À" "Ä" "Â" "Ã" "Å" "Č" "Ď" "É" "È" "Ë" "Ê" "Ě"			// diacritics uppercase
"Í" "Ì" "Ï" "Î" "Ñ" "Ň" "Ó" "Ò" "Ö" "Ô" "Õ" "Ø" "Ř"
"Š" "Ť" "Ú" "Ù" "Ü" "Û" "Ů" "Ý" "Ÿ" "Ž" "Œ" "Æ"

"a" "б" "в" "г" "д" "е" "ё" "ж" "з" "и" "й" "к" "л"			// ru lowercasse
"м" "н" "о" "п" "р" "с" "т" "у" "ф" "х" "ц" "ч" "ш"
"щ" "ъ" "ы" "ь" "э" "ю" "я" "ґ" "ї" "є"

"A" "Б" "В" "Г" "Д" "Е" "Ё" "Ж" "З" "И" "Й" "К" "Л"			// ru uppercase
"М" "Н" "О" "П" "Р" "С" "Т" "У" "Ф" "Х" "Ц" "Ч" "Ш"
"Щ" "Ъ" "Ы" "Ь" "Э" "Ю" "Я" "Ґ" "Ї" "Є"

]


// 

characterreplacementlist = [

"questionmark" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "!" "@" "numbersign" "$" "percent" "ampersand" "asterisk" "(" ")" "`" "-"
"=" "tilde" "underscore" "+" "[" "]" "backslash" "openbrace" "closebrace" "verticalbar" ";" "'" "colon" "," "period" "slash"
"lessthan" "morethan" "eszett" "space"


	"a
	"b"
	"c"
	"d"
	"e"
	"f"
	"g"
	"h"
	"i"
	"j"
	"k"
	"l"
	"m"
	"n"
	"o"
	"p"
	"q"
	"r"
	"s"
	"t"
	"u"
	"v"
	"w"
	"x"
	"y"
	"z"

	"A_upper"
	"B_upper"
	"C_upper"
	"D_upper"
	"E_upper"
	"F_upper"
	"G_upper"
	"H_upper"
	"I_upper"
	"J_upper"
	"K_upper"
	"L_upper"
	"M_upper"
	"N_upper"
	"O_upper"
	"P_upper"
	"Q_upper"
	"R_upper"
	"S_upper"
	"T_upper"
	"U_upper"
	"V_upper"
	"W_upper"
	"X_upper"
	"Y_upper"
	"Z_upper"


	"a_acute"
	"a_grave"
	"a_diaeresis"
	"a_circumflex"
	"a_tilde"
	"a_ring"
	"c_caron"
	"d_caron"
	"e_acute"
	"e_grave"
	"e_diaeresis"
	"e_circumflex"
	"e_caron"
	"i_acute"
	"i_grave"
	"i_diaeresis"
	"i_circumflex"
	"n_tilde"
	"n_caron"
	"o_acute"
	"o_grave"
	"o_diaeresis"
	"o_circumflex"
	"o_tilde"
	"o_stroke"
	"r_caron"
	"s_caron"
	"t_caron"
	"u_acute"
	"u_grave"
	"u_diaeresis"
	"u_circumflex"
	"u_ring"
	"y_acute"
	"y_diaeresis"
	"z_caron"
	"oe"
	"ae"

	"A_acute_upper"
	"A_grave_upper"
	"A_diaeresis_upper"
	"A_circumflex_upper"
	"A_tilde_upper"
	"A_ring_upper"
	"C_caron_upper"
	"D_caron_upper"
	"E_acute_upper"
	"E_grave_upper"
	"E_diaeresis_upper"
	"E_circumflex_upper"	
	"E_caron_upper"
	"I_acute_upper"
	"I_grave_upper"
	"I_diaeresis_upper"
	"I_circumflex_upper"
	"N_tilde_upper"
	"N_caron_upper"
	"O_acute_upper"
	"O_grave_upper"
	"O_diaeresis_upper"
	"O_circumflex_upper"
	"O_tilde_upper"
	"O_stroke_upper"
	"R_caron_upper"
	"S_caron_upper"
	"T_caron_upper"
	"U_acute_upper"
	"U_grave_upper"
	"U_diaeresis_upper"
	"U_circumflex_upper"
	"U_ring_upper"
	"Y_acute_upper"
	"Y_diaeresis_upper"
	"Z_caron_upper"
	"OE_upper"
	"AE_upper"


	"ru_01"
	"ru_02"
	"ru_03"
	"ru_04"
	"ru_05"
	"ru_06"
	"ru_07"
	"ru_08"
	"ru_09"
	"ru_10"
	"ru_11"
	"ru_12"
	"ru_13"
	"ru_14"
	"ru_15"
	"ru_16"
	"ru_17"
	"ru_18"
	"ru_19"
	"ru_20"
	"ru_21"
	"ru_22"
	"ru_23"
	"ru_24"
	"ru_25"
	"ru_26"
	"ru_27"
	"ru_28"
	"ru_29"
	"ru_30"
	"ru_31"
	"ru_32"
	"ru_33"
	"ru_34"
	"ru_35"
	"ru_36"

	"RU_01_upper"
	"RU_02_upper"
	"RU_03_upper"
	"RU_04_upper"
	"RU_05_upper"
	"RU_06_upper"
	"RU_07_upper"
	"RU_08_upper"
	"RU_09_upper"
	"RU_10_upper"
	"RU_11_upper"
	"RU_12_upper"
	"RU_13_upper"
	"RU_14_upper"
	"RU_15_upper"
	"RU_16_upper"
	"RU_17_upper"
	"RU_18_upper"
	"RU_19_upper"
	"RU_20_upper"
	"RU_21_upper"
	"RU_22_upper"
	"RU_23_upper"
	"RU_24_upper"
	"RU_25_upper"
	"RU_26_upper"
	"RU_27_upper"
	"RU_28_upper"
	"RU_29_upper"
	"RU_30_upper"
	"RU_31_upper"
	"RU_32_upper"
	"RU_33_upper"
	"RU_34_upper"
	"RU_35_upper"
	"RU_36_upper"

]




uppercasealphabet = [

"A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"

"Á" "À" "Ä" "Â" "Ã" "Å" "Č" "Ď" "Đ" "É" "È" "Ë" "Ê" "Ẽ" "Ě" "Ē" "Í" "Ì" "Ï" "Î" "Ĩ" "Ñ" "Ň"
"Ó" "Ò" "Ô" "Õ" "Ö" "Ø" "Ř" "Š" "Ť" "Ü" "Ú" "Ù" "Ũ" "Û" "Ů" "Ý" "Ÿ" "Ž" "Œ" "Æ"

"A" "Б" "В" "Г" "Д" "Е" "Ё" "Ж" "З" "И" "Й" "К" "Л" "М" "Н" "О" "П" "Р" "С" "Т" "У" "Ф" "Х" "Ц" "Ч" "Ш" "Щ" "Ъ" "Ы" "Ь" "Э" "Ю" "Я" "Ґ" "Ї" "Є"

]

doublequotes = (concatword "^"")
caret = (concatword "^^")

agtg = [									// function declaration
local coninput character characterindex charactername
coninput = (loopconcat i $numargs [concatword $[arg@(+ $i 1)] ""])		// concatenate input arguments into one big string which is then parsed by script to allow input without doublequotes
echo (concatword "^f6agtg " "^f3" $selectedfont ": ^f2" $coninput)		// echo string that will be generated
loop i (strlen $coninput) [     						// iterate over every character in the concatenated input. For every character..
    character = (substr $coninput $i 1)   					// put that character in a variable
    editface -1 1; delcube  							// extrude a cube outwards and move the selection with it, delete cube under selection
    characterindex = (indexof $characterlist $character)  			// get index of that character in character list above
    charactername = (at $characterreplacementlist $characterindex)		// replace the character with the name of the character (because windows filenames cannot include some special characters)

    if (=s $character (concatword "^"")) [					// fix for doublequotes character exception. If the character is a doublequotes..
        charactername = "doublequotes"
    ];

    if (=s $character (concatword "^^")) [					// fix for carot character exception, if the character is a caret..
        charactername = "caret"
    ];

//      if (= $character (strupper $character)) [				// if the character is not an uppercase character (doesn't work in vanilla sauer client)
    if (= (indexof $uppercasealphabet $character) -1) [				// if the character is not an uppercase character
        pastebrush (concatword $selectedfont "/" $charactername) ] [		// paste the *.obr file	
            pastebrush (concatword $selectedfont "/UPPERCASE/" $charactername)	// else paste the UPPERCASE/*.obr file
        ]
    ]

]

// differentiate between upper and lower case for windows
// if (= $letter (strupper $letter)) [echo "letter is uppercase"] [echo "letter is lowercase"] --strupper doesn't work in vanilla sauer client, using uppercasealphabet list lookup instead.
// add diacritic characters áàäâãåčďéèëêěíìïîñňóòôõöřšťüúùûůýÿžßœæ ÁÀÄÂÃÅČĎÉÈËÊĚÍÌÏÎÑŇÓÒÔÕÖŘŠŤÜÚÙÛŮÝŸŽŒÆ
// translation list for every character since a lot of characters can't be the name of a file

// charset =  1234567890`-=~_+[]\{}|;':",./<>?abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZáàäâãåčďđéèëêẽěíìïîĩñňóòôõöřšťüúùũûůýÿžœæÁÀÄÂÃÅČĎĐÉÈËÊĚÍÌÏÎĨÑŇÓÒÔÕÖŘŠŤÜÚÙŨÛŮÝŸŽŒÆß
// AБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ
// aбвгдеёжзийклмнопрстуфхцчшщъыьэюя




25
points
 (3 votes)
User login
Users on Quadropolis
1 guest & no users online
30
points ]
 (3 votes)
Created 2019-05-17 21:51
5 years 31 weeks ago
30
points ]
 (3 votes)
Created 2020-06-13 21:05
4 years 27 weeks ago
20
points ]
 (2 votes)
Created 2021-05-24 00:01
3 years 30 weeks ago
8
points ]
 (1 vote)
Created 2024-06-02 14:26
28 weeks 5 days ago
8
points ]
 (1 vote)
Created 2024-06-02 22:13
28 weeks 5 days ago
vampirefrog
Created 2024-04-11 22:25
36 weeks 1 day ago
vampirefrog
29
points ]
 (4 votes)
Created 2010-05-30 10:00
14 years 29 weeks ago
Gangler
36
points ]
 (4 votes)
Created 2020-10-22 00:50
4 years 8 weeks ago
Zoocata
10
points ]
 (1 vote)
Created 2024-02-11 21:20
44 weeks 5 days ago
vampirefrog
10
points ]
 (1 vote)
Created 2023-07-23 20:02
1 year 21 weeks ago
36
points ]
 (4 votes)
Created 2020-12-10 12:49
4 years 1 week ago
Created 2023-12-12 23:34
1 year 1 week ago
Zoocata
Created 2023-11-27 23:00
1 year 3 weeks ago
20
points ]
 (2 votes)
Created 2023-10-01 15:21
1 year 11 weeks ago
9
points ]
 (1 vote)
Created 2023-06-13 17:54
1 year 27 weeks ago
Zoocata
27
points ]
 (3 votes)
Created 2023-05-05 20:58
1 year 32 weeks ago
Zoocata
18
points ]
 (2 votes)
Created 2023-03-02 01:40
1 year 42 weeks ago
Getridou
Created 2023-01-29 23:27
1 year 46 weeks ago
Created 2023-01-19 19:36
1 year 48 weeks ago
Getridou
Created 2023-01-10 17:10
1 year 49 weeks ago
Who's new
  • ColdIV
  • Aidan
  • Hunk
  • letic86
  • BATMAN