pendranome
New member
I'm working on a game mod and there is a character with a special move than can reflect certain projectiles back in the direction they came from. The problem I'm having is that the projectile will not damage the original parent even if I update the projectile's "candamage" property to include enemies. To be clear, other enemies CAN be hit by the reflected projectile, just not the enemy who actually shot the projectile. Can anyone help me figure out what I would need to do to make a projectile entity "betray" its creator so to speak?
Before anyone brings it up, I found a post that touches on this, but as far as I can tell the code here is doing the same thing my code is. It simply reversed the direction and velocity and then reassigns the "candamage" value.
Not sure why it works here but not in my mod. Maybe it has something to do with the entity's type??? Here's a snippet of the code:
Any help would be greatly appreciated.
Before anyone brings it up, I found a post that touches on this, but as far as I can tell the code here is doing the same thing my code is. It simply reversed the direction and velocity and then reassigns the "candamage" value.
Complete - Aliens Clash
This the 2nd mod I've done within a month, here's the link to download this mod: http://gamejolt.com/games/shooter/aliens-clash/52467/ Just like Rainbow, this mod is shoot'em up and uses 640x480 resolution The mod was created for this GameJolt Jam: http://jams.gamejolt.io/crudegraphicsjam...
www.chronocrash.com
Not sure why it works here but not in my mod. Maybe it has something to do with the entity's type??? Here's a snippet of the code:
C++:
if(getentityproperty(other, "type") == openborconstant("TYPE_SHOT")
|| getentityproperty(other, "type") == 2) {
int direction = getentityproperty(other, "direction");
int xVel = getentityproperty(other, "xdir");
if(direction == 0) {
direction = 1;
} else {
direction = 0;
}
xVel = xVel*-2;
changeopenborvariant("lasthitc", 0);
performattack(self,openborconstant("ANI_FOLLOW11"), 1);
changeentityproperty(other, "parent", self);
//changeentityproperty(other, "hostile", "type_enemy", "type_player", "type_obstacle", "type_npc", "type_shot");
//changeentityproperty(other, "type", openborconstant("TYPE_SHOT"));
changeentityproperty(other, "candamage", openborconstant("type_enemy"), openborconstant("type_player"), openborconstant("type_obstacle"), openborconstant("type_npc"), openborconstant("type_shot"));
//changeentityproperty(other, "projectilehit", "type_enemy", "type_player", "type_obstacle", "type_npc", "type_shot");
changeentityproperty(other, "direction", direction);
changeentityproperty(other, "velocity", xVel, 0, 0);
}
Any help would be greatly appreciated.