Script character question(s)


(Flippy) #1

Hey,
This is for my ETScript program.
I’m creating an automatic tab-indent system that will:

  • Remember previous tabs (so if you enter, you will still be on the same distance from the edge)
  • Tab automatically after a “{”
  • Un-tab (lol) automatically after a “}”

Then, I was wondering if you ever need more than 2 ‘tabs’.

For example, is it possible to have this:

scriptname
{
   trigger ...
   {
       someotherthing
       { 
          //bla
        }
    }
}

I didn’t think it was but you can never be sure…


Question 2,

Are they { and } characters used in any other way in ET scripting (for maps)?


(S14Y3R) #2

the indents will never go beyond:

scriptname
{
      trigger
      {
            yadda yadda
      }
}

…and the brackets are only ever used for syntax.


(Flippy) #3

Ok then there are no problems :slight_smile:
I don’t want the brackets to indent when you use them for something else obviously… that’s why I asked.


(murka) #4

but when you announce a text with brackets, won’t that fiddle with your program? just curious.


(Flippy) #5

Yep, I thought of that aswell today, so there is indeed a way you might need to use the { } without the automatic tabbing.
I made an option now to have [ and ] type { and } without tabbing now.
So now you can have both :slight_smile:


(ailmanki) #6
//
// Map: Atlantic Seawall Battery
// BSP: battery
// Thu Aug 21 23:18:19 PDT 2003 - autospawns fixed for ETPro by bani
// rain - Tue Sep 23 20:17:48 EDT 2003 - even more autospawn fixing
// bani - Mon Mar  1 00:38:32 PST 2004 - falling death on hatch fixed
// bani - Wed Jan 14 02:21:18 PST 2004 - competition battery
// Harlekin - Sat Feb 3 2007 Anti spawnkill roofs
game_manager
{
	spawn
	{
		//bani
		//this creates the 'dynamitable' hint icon
		create
		{
			scriptName "backdoor"
			classname "func_explosive"
			targetname "backdoor"
			origin "4608 -4594 1024"
			mins "-63 -10 0"
			maxs "63 10 128"
			spawnflags 1	// EXPLOSIVE_START_INVIS(1)
			eflags 65536	// EF_FAKEBMODEL
			svflags 1	// SVF_NOCLIENT
		}
.......

from battery etpro mapscript, if you want to support that too… lol brackets go deeper

edit: and } might be used for ^}coloring… not sure, but this is totally unneeded…