Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

What is wrong with this?

12 replies · 3,344 views · Started 17 December 2006

ffc script supermentus


ffc script xoxo
{
void run()
{
npc CreateNPC = 58;
int Rate = 16;
int Weapon = 29;
int HP =30;
}
void Quit()
{
} // end of void run
} // end of ffc script

I read the error code P00 and I don't get it... What is wrong with this script?

... Well, there are two things there that'll keep it from compiling.

npc CreateNPC = 58;

58 isn't an NPC, it's a number. If you want an NPC, you'll need to use Screen->LoadFFC().

    void Quit()
{
} // end of void run

That whole block shouldn't be there. If you mean to call Quit() at the end of the script, you'd just put [font="Courier New"]Quit();[/font] inside the body of run(). That isn't necessary, though, since it'll automatically quit at the end of run().

58 isn't an NPC, it's a number. If you want an NPC, you'll need to use Screen->LoadFFC().
In std.zh, it lists the following:

[font=courier]const int CF_PUSHRIGHTNS = 58;[/font]

Perhaps that's where this has been derived? :shrug:

Whoah, sorry; another question.

If you want an NPC, you'll need to use Screen->LoadFFC().
Does this imply that to "create an NPC," it'll function like any enemy would, with its own four-frame animation style for all four directions? Or would it have to be programmed via ZScript to animate for four frames, switching off between four different combos for its frames, for a total of sixteen movement combos alone, etc?

...

I expect a firm and raised-browed "Yes." ._.' .. whooo boy..

You can't create your own, I'm afraid. You can only load pointers to existing enemies (and guys, if I'm not mistaken).
If you mean enemies created in the upcoming enemy editor... I don't know, really. I imagine at least some of the standard stuff will be handled automatically, but I don't know how it'll all work.

Edit: Actually, come to think of it, there is Screen->CreateNPC(). That'll only let you create instances of existing enemy types, though.

I think what he was after is something along the lines of:

ffc script supermentus
{
void run()
{
npc this1 = Screen->CreateNPC(58);
this1->Rate = 16;
this1->Weapon = 29;
this1->HP = 30;
}
}

... where 58 is supposed to be the constant for one of the Aquamentus types. I think that value and the weapon ID came from b15's std.zh, so it would probably be safer to either import it or just declare the constants yourself before the ffc script.

Also, you would probably want to set this1->X and this1->Y as well, because CreateNPC probably won't put it where an Aquamentus normally goes. Or you could just put an Aquamentus in the screen as Enemy # and modify it by making that first line "npc this1 = Screen->LoadNPC(#)" (as it sounds like you've already discovered).

Wow. I don't know what's scarier - the fact that this type of request (save powering up Darknuts) didn't come up sooner, or that Saffith didn't get this one right of the bat! 😉

erm...
explain to me where "this->" comes from so I don't make this mistake again. Oh and the Aquamentus's location is hardcoded, so there is no need to set a position.

Secondly, it crashes after the defeat of an enemy. How do I fix it so it doesn't?

Creating enemies is pretty bad ass on its own. Gauntlet's enemy generators are now a reality - you can increase the hit points of the fire enemy and have it spit out moblins or something according to a script. Or having a vampire custom boss that flies around and perioidically spits out flocks of bats. Or, better yet, enemies used as projectiles (like ghini 2s for missiles, or bombchus as mines).

Oh, to be in college again and have endless free time to tinker with these things...

Alrighty then, I want an enemy to drop a specific item, like a Boss would drop the heart container, how would I go about doing this?

And say you have a segmented monster, like a Moldorm or Lanmola. How would you edit each segment's health rather than just the head?

That's a pretty good question, I don't know how to make an enemy drop a specific item either. I wonder, if you can make them drop specific items, can you also disallow the dropping of certain items or an array of items to be disallowed? I guess I've never thought of doing anything like that before...

Alrighty then, I want an enemy to drop a specific item, like a Boss would drop the heart container, how would I go about doing this?
Well, you can't, really. You can change the set of items it'll drop to that of another enemy, but nothing drops a Heart Container.
What you can do instead, if I'm not mistaken, is check the enemy's HP every frame and create the item you want when it hits 0.

And say you have a segmented monster, like a Moldorm or Lanmola. How would you edit each segment's health rather than just the head?
... Um, not sure about that. I don't know for certain offhand, but I don't think that's possible. I think all you can do is change the properties of the entire enemy at once.
Try it and see how it works, I guess.

erm...
explain to me where "this->" comes from so I don't make this mistake again. Oh and the Aquamentus's location is hardcoded, so there is no need to set a position.
Basically, you use this when you want to change any of the properties of the FFC itself—its position, acceleration, CSet, flags, and so forth.