ghost.zh
#121
Posted 01 May 2012 - 10:27 AM
#122
Posted 01 May 2012 - 12:28 PM
#123
Posted 01 May 2012 - 09:20 PM
Try this out, see if it tells you anything helpful.
The plot thickens...The hitbox never moves but Link still gets hurt by some invisible entity...
Edit: Well this is embarrassing. I've isolated the cause of the hitbox problem. It was a duplicate of the boss enemy that I still had onscreen from a previous version of the script.
OK, so I think I've found a bug. I think I killed a boss offscreen and Zelda Classic didn't like that at all and crashed.
The message I got when I checked allegro.log was:
Invalid value (0) passed to 'Screen->LoadItem'
Pasted about a few hundred times.
Not sure if this is a bug with ghost.zh, my script, or RC3 in general.
Edited by Moosh, 01 May 2012 - 01:52 PM.
#124
Posted 01 May 2012 - 09:32 PM
#125
Posted 01 May 2012 - 09:43 PM
On closer inspection, it seems that the crash has to do with creating a new enemy at the same time as enemies->item is triggered...
Edited by Moosh, 02 May 2012 - 08:59 AM.
#126
Posted 02 May 2012 - 11:20 AM
Replacing while(n->isValid()==true) with while(Ghost_HP>0) should fix that.
#127
Posted 03 May 2012 - 02:17 PM
This will allow you to treat this as a pointer of type ghost, whose variables and functions are a mix of those defined in ghost.zh and those of ffcs and npcs. The converter will modify the code as necessary to compile and run in ZC.
For example:
{
void run(int enemyID)
{
this->InitAutoGhost(enemyID);
while(true)
{
this->MoveTowardLink(this->Step/100, 2);
DemoWaitframe(this);
}
}
void DemoWaitframe(ghost this)
{
if(this->Attributes[0]>0)
{
if(Link->InputA)
this->CollDetection=false;
else
this->CollDetection=true;
}
this->Waitframe(true, true);
}
}
The converter is written in JavaScript and should work in any modern browser. Paste your script, click "Convert," copy the output.
Bear in mind, this is a hastily thrown together demo, not a finished product. It's certainly usable, but I'm not prepared to guarantee it will work perfectly, even if I didn't make any mistakes in writing it. Also, it has the limitation that your ghost pointer must be named this. Any other name will be ignored.
#128
Posted 03 May 2012 - 10:29 PM
I have a suggestion for autoghost... some scripts don't use combos in place of enemy graphics, and it's kind of a pain to go find GH_INVISIBLE_COMBO to put in the enemy's attribute 11. What if we could just put -1 there, and the autoghost global script set it to the invisible combo for us? That would be pretty easy, wouldn't it?
#129
Posted 10 May 2012 - 03:14 PM
So, I haven't accounted for the no ground/jumping/flying enemy combo and flags yet, and I'm trying to decide how to do that. I'm thinking of adding GHF_FLYING_ENEMY, which will make the enemy be blocked by the flying enemy blocker; otherwise, it would be blocked by the ground or jumping enemy blockers depending on whether Ghost_Z>0. Of course, that won't affect any existing flying enemy scripts, but that's not too awful. Does anyone have a better idea?
Relatedly, does anyone see a problem with making Ghost_CanMove over pits and water true whenever Ghost_Z>0?
#130
Posted 16 May 2012 - 11:24 AM
#131
Posted 16 May 2012 - 11:35 AM
#132
Posted 20 May 2012 - 03:29 PM
- There's now built-in support for multi-FFC enemies like Iflyte.
- It's now possible to use Screen->DrawCombo rather than making the FFC itself visible. There are three advantages to this:
- Enemies will correctly be drawn above layers 2 and 4 rather than 1 and 3 (currently, FFCs do appear above layers 2 and 4, but that's a bug).
- Enemies disappear when the screen is scrolling.
- Multi-FFC enemies don't actually require multiple FFCs.
- Enemy blocking combos and flags are now respected.
- Added GHF_FLYING_ENEMY, which controls whether ground/jumping or flying enemy blockers are checked.
- Ghost_CanMove and Ghost_CanMovePixel now take an optional argument indicating whether the enemy is in the air; this defaults to Ghost_Z>0.
- Added flags to restrict an enemies movement to water, including or excluding shallow water.
- Added a setting to make all Z-axis movement actually use the Y axis.
- Added a setting to make enemies flicker instead of flash.
- You can now use an alternate number (-1 by default) instead of GH_INVISIBLE_COMBO to make enemies use the invisible combo.
- GHF_ flags can no longer be ORed together; they must be set individually. Unfortunate, but it can't be helped; I ran out of bits.
- Ghost_SetFlags and the init functions with a flags argument are deprecated.
- Ghost_WaitframeLight now takes ffc and npc arguments. The old version is deprecated and may not work correctly with existing scripts if DrawCombo is enabled.
#133
Posted 20 May 2012 - 06:06 PM
edit: I see what you did there now, in ghost_waitframe. ..That makes me sad.
I would also like to replace the global script with a ffc version, like "ffc script manual_ghost", or "this_screen_has_ghosted_enemies". Is this doable, or is there clean-up logic that needs to execute that would prevent this? (The main reason is I need to control which scripts on which screens will have control over object properties.)
edit2: ninja edit fail.
#134
Posted 20 May 2012 - 07:47 PM
Hey, I'm the one who has to keep track of it all.
Sure. This should be all you need:
{
void run()
{
while(true)
{
AutoGhost();
Waitframe();
}
}
}
The only downside is that that'll be before Waitdraw, which means you'll see the first frame of the built-in enemy's spawn animation.
#135
Posted 22 May 2012 - 10:18 AM
You can easily fix it yourself rather than download it again: add a Waitframe on line 4354.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users


