hechelion
Member
Hi.
I have a strange problem.
I have an enemy and a weapon, the weapon is set to fall when you hit an enemy.
if in a stage01.txt, I spawn the enemy with:
Everything work great, The enemy spawn with the weapon, and drop it when he is hit.
*******************************************
Now, I need invoke the enemy from a script, so. I try the next code:
The enemy spawn, but without the weapon, is like the line "setspawnentry("weapon", "WeaponA");" was ignored by the engine.
*******************************************
I try change the property weapon after the spawn with:
Now, the enemy spawn with the weapon, but when he is hit, change from weapon animation to normal animation (no-weapon) but don't drop the weapon.
*******************************************
I try with "weapnum" instead of "weapon", but it was worse, the enemy appeared without the weapon.
What am I doing wrong?
What is the correct way to summon an enemy with a weapon from one script?
Thank you very much in advance and excuse my English.
I have a strange problem.
I have an enemy and a weapon, the weapon is set to fall when you hit an enemy.
if in a stage01.txt, I spawn the enemy with:
Code:
spawn EnemyA
weapon WeaponA
flip 0
coords 600 240 0
at 0
Everything work great, The enemy spawn with the weapon, and drop it when he is hit.
*******************************************
Now, I need invoke the enemy from a script, so. I try the next code:
Code:
@script
clearspawnentry();
setspawnentry("name", "EnemyA");
setspawnentry("weapon", "WeaponA");
setspawnentry("coords", 600,410,0);
spawn();
@end_script
The enemy spawn, but without the weapon, is like the line "setspawnentry("weapon", "WeaponA");" was ignored by the engine.
*******************************************
I try change the property weapon after the spawn with:
Code:
@script
clearspawnentry();
setspawnentry("name", "EnemyA");
//setspawnentry("weapon", "WeaponA");
setspawnentry("coords", 600,410,0);
void vSpawn = spawn();
changeentityproperty(vSpawn, "weapon", 3); //WeaponA = weapon index 3
@end_script
*******************************************
I try with "weapnum" instead of "weapon", but it was worse, the enemy appeared without the weapon.
What am I doing wrong?
What is the correct way to summon an enemy with a weapon from one script?
Thank you very much in advance and excuse my English.