type npc
candamage player enemy obstacle
The entity in that example only attacks players, enemies and obstacles, not NPCs and those not included.candamage {type1} {type2} ...
- Optional.
- Specifies what types this entity can hit (very similar to hostile, but determines what entity may hit, not what it will intentionally target).
- Available types are enemy, player, npc, obstacle, shot and you can use as many as you need. If you don't want entity to hit anything, just set 'none' here.
- Be aware if you use this setting, you must provide all types you wish this entity to be able to hit. That is to say, an enemy with ‘candamage npc obstacle’ will be able to hit npc and obstacle types, not players.
hostile {type1} {type2} ...
- Optional.
- Specifies what types an AI controlled entity will attack and what entities a projectile with the chase subtype will seek (this does not determine what the entity can hit, only what it will intentionally attack).
- Accepted types are enemy, player, npc, obstacle, shot and you can use as many as you need. If you want entity to be hostile to nothing, just set 'none' here.
- Be aware if you use this setting, you must provide all types you wish this entity to be hostile towards. That is to say, an enemy with ‘hostile npc obstacle’ will only attack npc and obstacle types, not players.
- Also 'stealth' feature below affect if the entity will target certain other entities or not.
hostile enemy player obstacle
However, they are not actually an enemy and the game will not need them to defeated before moving on.
Any example of this?
void main()
{
void vSelf = getlocalvar("self");
changeentityproperty(vSelf, "type", 2048);
changeentityproperty(vSelf, "hostile", openborconstant("TYPE_ENEMY") + openborconstant("TYPE_PLAYER") + openborconstant("TYPE_NPC") + 4096 );
changeentityproperty(vSelf, "candamage", openborconstant("TYPE_ENEMY") + 4096 + openborconstant("TYPE_PLAYER") + openborconstant("TYPE_OBSTACLE") + openborconstant("TYPE_NPC") );
changeentityproperty(vSelf, "projectilehit", openborconstant("TYPE_ENEMY") + 4096 + openborconstant("TYPE_PLAYER") + openborconstant("TYPE_OBSTACLE") + openborconstant("TYPE_NPC"));
}
void main()
{
void vSelf = getlocalvar("self");
changeentityproperty(vSelf, "type", 2048);
}