dandouglas, on 15 July 2022 - 11:51 PM, said:
The backstory is that, in my mod, the aliens are going to have severe egg allergies so Duke can throw eggs at them, but they don't die straight away.
I've got an RPG-style projectile working nicely, thrown on an arch with a little splash when it lands, but it currently only does damage on impact.
Declare a per-actor gamevar:
gamevar poison 0 2
Also use 65536 as a flag in the workslike of the custom projectile. See PROJECTILE_RADIUS_PICNUM in this list: https://wiki.eduke32...efineprojectile
Now let's say that your projectile is named EGGPROJ
You want every enemy to run some additional code when hit by a weapon. A simple example would be
ifwasweapon EGGPROJ add poison 150Again, that goes *inside* the ifhitweapon code block.
Finally, you also need to add code to each enemy to process the poison damage. I would define a state and then have each enemy call the state when alive and before it calls ifhitweapon. Here's an example of what the state might look like.
defstate newmoncode
ifg poison 0
{
sub poison 1
ifrnd 64
ife sprite[].htextra -1
{
seta[].htextra 1
seta[].htowner player[].i
seta[].htpicnum KNEE
// spawn some custom actor here that looks like puke or poison smoke or something
}
}
ends

Help
Duke4.net
DNF #1
Duke 3D #1


