Scripting:DH-ACC Differences

A brief tutorial on the differences between DH-ACC and ACS
In ACS, your code blocks are not terminated by a semicolon, only commands and functions. In DH-ACC, ALL code blocks are terminated by a semicolon. ACS: Script 1 (VOID) { if(a != b) 	{ DoThis; 	} 	else 	{ DoThat; } } DH-ACC: __extscript "ACS" void ThisScript ( void ) { 	if(a != b) 	{ 		DoThis; 	} 	else 	{ 		DoThat; 	};                     // the above is a single code block }; As you can see, scripts also define a return type, as they can now be called as functions: DH-ACC: __extscript "ACS" str ReturnThis ( void ) { 	return "This"; }; __extscript "ACS" void LetsReturnThis ( void ) enter { 	Log("%s", ReturnThis); }; Also notice that the format for output strings is now C-style: ACS: HudMessage(s:"You have ", i:NumberOfBombs, s:" bombs"; HUDMSG_PLAIN, 0, 0, 0, 0, 0); DH-ACC: HudMessage("You have %i bombs", NumberOfBombs, HUDMSG_PLAIN, 0, 0, 0, 0, 0);

In ACS, all variables are the same cast type, a 32bit unsigned int, which is then read as the cast is required. In DH-ACC, all cast types are strict, and you will not be able to compile with incorrect cast type references. DH-ACC also includes the fixed cast. ACS: int StringInt = "This Makes No Sense"; Log(s:StringInt); DH-ACC str String = "This Makes Sense"; Log("%s", String); Because of this, if you are converting any existing ACS you need to understand how fixed point values are read differently. ACS: Script 1 ENTER {    int x = 0.75; Log(i:x);		// produces "49152" } DH-ACC: __extscript "ACS" void LogOnEnter ( void ) __enter { 	fixed x = 0.75; int y = 32; Log("%i", x);	// produces 0 - decimals are truncated Log("%k", y);  // produces "32" };