Code: Select all
String bc = (bloodcolor & 0xffffff)
Moderator: GZDoom Developers
Code: Select all
String bc = (bloodcolor & 0xffffff)
Code: Select all
Class C : Actor
{
Color P1;
Default
{
+NOINTERACTION
}
States
{
Spawn:
TNT1 A 1;
TNT1 A 0
{
A_CheckProximity("Null","PlayerPawn",32767,1,CPXF_SETTARGET|CPXF_ANCESTOR);
if (target)
{
P1 = target.bloodcolor;
for (int i = 0; i < 50; i += 2)
{
A_SpawnParticle(P1,SPF_RELATIVE|SPF_FULLBRIGHT,35,10,0,0,0,i);
}
}
}
Stop;
}
}
Why? D:Note: Due to how ZScript is processed, it is possible to name a file which conflicts with other mods or the internal files. I.e. ZScript/Const.txt will prevent the game loading as this file is already defined internally. To avoid such conflicts, it is recommended to have another subfolder or have the ZScript folder name changed
Could there be some way to externalize actor names as strings? I kinda like being able to have actors named whatever for ACS. Not really important, of course.Actor names must be valid identifiers (i.e. be composed of only letters, numbers, and underscores; and must start with a letter or underscore). Most notably, this means that actor names may no longer begin with a number.
Some warnings such as missing actors are treated as errors. All actors must be defined.
Marrub wrote: Is there any way to do cross-mod compatibility with this, without resorting to the usual usage of DECORATE or ACS?
Code: Select all
string classname = "UnknownClass";
class<Actor> cls = classname;
Wait, so it has to be UnknownClass? Or is that supposed to be replaced with the actor? If the latter, how should the check be done?Graf Zahl wrote:If you want to use a class you are not sure it is present you can do
That prevents compile time conversion, but of couse you are responsible for checking that the class exists if you want to use it.Code: Select all
string classname = "UnknownClass"; class<Actor> cls = classname;
Edward-san wrote:How about preprocessor-style '#if Engine == zdoom ... #else ... #endif', which would allow inserting engine-specific code (and then solve also the problem for mods)?
Code: Select all
// [BC] Tell clients to spawn the tracers.
if (( NETWORK_GetState( ) == NETSTATE_SERVER ) && ( spray ))
SERVERCOMMANDS_SpawnThing( spray );