Edited by Dragonite, 28 February 2012 - 03:57 PM.
Crow enemy
#1
Posted 28 February 2012 - 03:57 PM
#2
Posted 28 February 2012 - 04:36 PM
If you can i might be able to help you. Otherwise i have no idea what that enemy does.
#3
Posted 28 February 2012 - 04:49 PM
#4
Posted 28 February 2012 - 05:02 PM
const int SFX_FLUTTER=0;
ffc script Crow
{
void run()
{
npc ghost=Ghost_InitWait2(this, NPC_CROW, false, GHF_NO_FALL|GHF_IGNORE_ALL_TERRAIN);
int baseCombo=Ghost_Data;
Ghost_SpawnAnimationPuff(this, ghost);
while(Distance(Link->X, Link->Y, Ghost_X, Ghost_Y)>56)
{
if(Link->X>Ghost_X)
Ghost_Data=baseCombo+1;
else
Ghost_Data=baseCombo;
Ghost_Waitframe(this, ghost, true, true);
}
float idealAngle;
float idealXVel;
float idealYVel;
float xVel=0;
float yVel=0;
Ghost_SetFlag(GHF_KNOCKBACK_4WAY);
Ghost_Data+=2;
Game->PlaySound(SFX_FLUTTER);
for(int i=0; true; i++)
{
if(xVel>0)
Ghost_Data=baseCombo+3;
else
Ghost_Data=baseCombo+2;
Ghost_X+=xVel;
Ghost_Y+=yVel;
Ghost_Waitframe(this, ghost, true, true);
if(i<300)
{
idealAngle=ArcTan(Link->X-Ghost_X, Link->Y-Ghost_Y);
idealXVel=2*RadianCos(idealAngle);
idealYVel=2*RadianSin(idealAngle);
}
if(idealXVel<xVel)
xVel=Max(xVel-0.03, idealXVel);
else
xVel=Min(xVel+0.03, idealXVel);
if(idealYVel<yVel)
yVel=Max(yVel-0.03, idealYVel);
else
yVel=Min(yVel+0.03, idealYVel);
}
}
}
Uses four combos:
1: Standing, facing left
2: Standing, facing right
3: Flying, facing left
4: Flying, facing right
Place the enemy, place the FFC, and set its "Draw Over" and "Run Script at Screen Init" flags.
#5
Posted 28 February 2012 - 05:24 PM
#6
Posted 28 February 2012 - 06:04 PM
Next, place one FFC per crow enemy with the FFC's data set to the standing/facing left combo. Set the FFC's "Draw over" and "Run at screen init" flags and you should be good to go.
#7
Posted 28 February 2012 - 08:33 PM
And when i tried to int ghost_initwait it still said error.
Edited by tox_von, 28 February 2012 - 08:36 PM.
#9
Posted 28 February 2012 - 10:10 PM
Doesnt zc use drawstring not printf from c++? And i also wanted to know how drawstring works.
#10
Posted 28 February 2012 - 10:14 PM
#11
Posted 28 February 2012 - 10:27 PM
1: Standing, facing left
2: Standing, facing right
3: Flying, facing left
4: Flying, facing right
Place the enemy, place the FFC, and set its "Draw Over" and "Run Script at Screen Init" flags.
Where does this need to be done? and what does placing the enemy mean like setting a eg enemy1 or something else.
Edited by tox_von, 28 February 2012 - 10:28 PM.
#12
Posted 28 February 2012 - 11:21 PM
In addition to the FFC, you place the enemy on the screen the same way as a normal one.
#13
Posted 28 February 2012 - 11:37 PM
When i placed the ffc all it did was disappear and placing enemy1 didnt do anything i dont think.
#14
Posted 28 February 2012 - 11:40 PM
I think you have to set the enemy's unique ID to the constant NPC_CROW.
#15
Posted 29 February 2012 - 01:22 AM
is it ghost-> = NPC_CROW?
is that what you mean.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users