dantedevil
Well-known member
I have an entity called "Zangief0", then this enemy spawn "Zangief".
I want "Zangief" spawn the entity "bosser2" when dies.
So I try to convert this in a zangief.c:
Here my try but not work:
Log error:
I want "Zangief" spawn the entity "bosser2" when dies.
So I try to convert this in a zangief.c:
Code:
name Bosser2
type none
anim idle
@script
if(frame==1){
void vEntity; //Target entity placeholder.
int iEntity; //Entity enumeration holder.
int iType; //Entity type.
int iHP; //Entity HP
int iMax = openborvariant("ent_max"); //Entity count.
//Enumerate and loop through entity collection.
for(iEntity=0; iEntity<iMax; iEntity++){
vEntity = getentity(iEntity); //Get target entity from current loop.
iType = getentityproperty(vEntity, "type"); //Get target type.
iHP = getentityproperty(vEntity, "health"); //Get target health
//Enemy type?
if (iType == openborconstant("TYPE_ENEMY") && iHP > 0){
damageentity(vEntity, vEntity, 2000, 1, openborconstant("ATK_NORMAL60"));
}
}
changeopenborvariant("slowmotion", 1);
setindexedvar("Dead", 1);
}
if(frame==2){
void self = getlocalvar("self");
changeopenborvariant("slowmotion", 0);
killentity(self);
}
@end_script
loop 1
delay 1
offset 1 1
frame data/chars/misc/empty.png
delay 200 # slowmotion effect will be active for 2 seconds
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
Here my try but not work:
Code:
void main()
{
void vEntity; //Target entity placeholder.
int iEntity; //Entity enumeration holder.
int iType; //Entity type.
int iHP; //Entity HP
int iMax = openborvariant("ent_max"); //Entity count.
//Enumerate and loop through entity collection.
for(iEntity=0; iEntity<iMax; iEntity++){
vEntity = getentity(iEntity); //Get target entity from current loop.
iType = getentityproperty(vEntity, "type"); //Get target type.
iHP = getentityproperty(vEntity, "health"); //Get target health
//Enemy type?
if (iType == openborconstant("TYPE_ENEMY") && iHP > 0){
damageentity(vEntity, vEntity, 2000, 1, openborconstant("ATK_NORMAL60"));
}
}
changeopenborvariant("slowmotion", 1);
setindexedvar("Dead", 1);
}
}
Log error:
Code:
Script error: data/chars/zangief/zangief.c, line 23: Invalid external declaration '}' (in production 'external_decl')
}
^
**************** Done *****************
Failed to parse script file: 'data/chars/zangief/zangief.c'!