- Code: Select all • Expand view
String bc = (bloodcolor & 0xffffff)
Or is there something else?
Moderator: GZDoom Developers
String bc = (bloodcolor & 0xffffff)
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;
}
}
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
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?
string classname = "UnknownClass";
class<Actor> cls = classname;
Graf Zahl wrote:If you want to use a class you are not sure it is present you can do
- Code: Select all • Expand view
string classname = "UnknownClass";
class<Actor> cls = classname;
That prevents compile time conversion, but of couse you are responsible for checking that the class exists if you want to use it.
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)?
// [BC] Tell clients to spawn the tracers.
if (( NETWORK_GetState( ) == NETSTATE_SERVER ) && ( spray ))
SERVERCOMMANDS_SpawnThing( spray );
Users browsing this forum: No registered users and 3 guests