paulo.bender
Member
Hello again, fellow developers!
I'm making a new move for one of my characters: a healing orb spell.
Upon casting, the character spawns a healing orb that restores 20 HP upon contact.
Instead of dealing with complicated attack types for such effect, i decided to simply make the char to spawn an item with subtype touch... But it isn't working at all. The orb doesn't detect any touching, and just floats there ad infinitum
Here's the object spawning script that I'm using (even with changes related to items)
Here's the healing orb file:
(the SFX_HEAL are just particles, ignore them)
I'm making a new move for one of my characters: a healing orb spell.
Upon casting, the character spawns a healing orb that restores 20 HP upon contact.
Instead of dealing with complicated attack types for such effect, i decided to simply make the char to spawn an item with subtype touch... But it isn't working at all. The orb doesn't detect any touching, and just floats there ad infinitum
Here's the object spawning script that I'm using (even with changes related to items)
Code:
void spawnentity(void cName, void cAni, float fX, float fY, float fZ, float vX, float vY, float vZ)
{
void self = getlocalvar("self"); //get calling entity.
void Child; //Spawned child entity.
void ChildType;
int pDirection = getentityproperty(self, "direction"); //parent's facing direction.
int pPal = getentityproperty(self, "map"); //parent's pallette.
clearspawnentry(); //Clear current spawn entity.
setspawnentry("name", cName); //Set spawn entity by it's name.
if (pDirection ==0) //is parent facing left?
{
fX = -fX;
vX = -vX; //Reverse x Direction to match facing.
}
fX = fX + getentityproperty(self, "x");
fY = fY + getentityproperty(self, "a");
fZ = fZ + getentityproperty(self, "Z");
Child = spawn(); //Spawn child entity.
ChildType = getentityproperty(Child, "type");
if (ChildType != "TYPE_ITEM")
{
changeentityproperty(Child, "parent", self); //Set child's parent.
changeentityproperty(Child, "owner", self); //Set child's owner.
}
changeentityproperty(Child, "position", fX,fZ,fY); //Set spawn location.
changeentityproperty(Child, "direction", pDirection); //Inherit Parent's facing direction.
changeentityproperty(Child, "velocity", vX, vZ, vY); //Set child velocity.
changeentityproperty(Child, "map", pPal); //Set child pallette.
performattack(Child, openborconstant(cAni), 1); //Perform set animation.
return Child;
}
Here's the healing orb file:
(the SFX_HEAL are just particles, ignore them)
Code:
name HealOrb
health 20
type item
subtype touch
antigravity 100
gfxshadow 1
nolife 1
alpha 5
animationscript data/scripts/items_animationscript.c
anim idle
loop 1 5
offset 7 7
delay 3
drawmethod scale 0.2 0.2
frame data/items/healorb/healorb_00.png
drawmethod scale 0.4 0.4
frame data/items/healorb/healorb_00.png
drawmethod scale 0.6 0.6
frame data/items/healorb/healorb_00.png
drawmethod scale 0.8 0.8
frame data/items/healorb/healorb_00.png
nodrawmethod
frame data/items/healorb/healorb_00.png
itembox 0 0 16 16
bbox 0 0 16 16
@cmd spawnentity "SFX_Heal" "ANI_FOLLOW11" 0 0 0 0 0 0
frame data/items/healorb/healorb_00.png
frame data/items/healorb/healorb_00.png
@cmd spawnentity "SFX_Heal" "ANI_FOLLOW11" 0 0 0 0 0 0
frame data/items/healorb/healorb_00.png
frame data/items/healorb/healorb_00.png
@cmd spawnentity "SFX_Heal" "ANI_FOLLOW11" 0 0 0 0 0 0
frame data/items/healorb/healorb_00.png
frame data/items/healorb/healorb_00.png
@cmd spawnentity "SFX_Heal" "ANI_FOLLOW11" 0 0 0 0 0 0
frame data/items/healorb/healorb_00.png
frame data/items/healorb/healorb_00.png
@cmd spawnentity "SFX_Heal" "ANI_FOLLOW11" 0 0 0 0 0 0
frame data/items/healorb/healorb_01.png