User Tag List

Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 42

Thread: ghost.zh - A header file for ghosted enemy scripts

  1. #11
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    I was thinking about adding something like that at one point, but I couldn't come up with anything I liked. The idea being that you might not want the hitbox to match the enemy's appearance, which ended up as SetOffsets() instead. Do you have a different purpose in mind?

    Another possibility is that it could acknowledge the npc->DrawOffset variables and position the FFC where the enemy would normally be drawn. What do you think of that?

    Edit: Actually, come to think of it, could you just use the npc->HitOffsets?

  2. #12
    I shall exalt myself over all Armagedddon Games bigjoe's Avatar
    Join Date
    Apr 2000
    Age
    39
    Posts
    5,618
    Mentioned
    87 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,570
    Level
    24
    vBActivity - Bars
    Lv. Percent
    93.02%
    I think I've found a pretty reasonable workaround.. but what I was trying to do was make the FFC follow a position relative to the NPC. The collision would still be the same as the FFC, just the position would be different. This is to make a bigger enemy that behaves exactly like the small one(but has the larger collision)

    My workaround will use two separate npcs.

  3. #13
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    Updated.

    • All ffc->Misc[] data has been moved to npc->Misc[]. Any scripts accessing these directly or using GotHit() will have to be updated.
    • npc->Misc[GHI_BASE_CSET] is no longer needed; npc->CSet is used instead.
    • Added SetCSet() and RevertCSet().
    • GhostInitWait2() has changed; the argument specifying which enemy to use is no longer needed. Instead, it finds the first one that's not already in use by another script. The old version of the function is deprecated, and the obsolete argument is ignored.
    • Added flags to make enemies ignore solid combos, water, and pits.
    • npc->TileWidth and npc->TileHeight are now set by the Init functions and Transform(), so shadows should be drawn in the right place in beta 18 and up.
    • Added DrawSpawnAnimation(), which lets you show the enemy spawning graphic that gets cut off by the Init functions.
    • If GH_BLANK_TILE is set and the enemy used has a frame rate of 0 (or 256, since ZC changes 0 to 256), the enemy's tile will be set to a clear one automatically. This way, you can give the enemy a visible tile so it shows up in the enemy panel in ZQuest's large mode.
    • Added an internal EWeapon flag that marks the weapon as having been spawned by ghost.zh. This allows other scripts to use all but one element of eweapon->Misc[] without causing confusion.
    • Reworked SpawnNPC() to increase the minimum distance from Link.
    • ghost_zh_readme.txt has been renamed ghost.txt to match other header files' documentation.


    Edit: Sorry, quick update. I screwed up the arguments to SetCSet() and RevertCSet(). They worked, but they were inconsistent with other functions, and I'm trying to avoid that. Anyway, it's fixed now.

  4. #14
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    All right, big update. Complete overhaul, in fact. Here are the biggest changes this version:

    Most enemy properties are now handled by global variables. There are only two standard Waitframe functions, Ghost_Waitframe and Ghost_Waitframe2. There's also a Ghost_WaitframeLight, but that'll generally be used only when the enemy is inactive. A lot of things that used to require a function can now be done just be setting one of the global variables. You can, for instance, set Ghost_HP to set the enemy's HP, set Ghost_CSet to change its CSet, or set Ghost_Data to change its combo, even if GHF_4WAY is set.

    There are two major new eweapon death options. First, you can create a dummy eweapon with whatever properties you like, including its own scripted movement, and have an eweapon spawn copies of it on death. Second, you can set up an FFC to run a script where the eweapon died, so you can do whatever you like there.

    Finally, the biggest new addition, AutoGhost. With appropriately written enemy scripts, the global script can set up FFCs automatically when enemies appear. That means scripted enemies can be used as easily as built-in ones, with no manual FFC setup at all. This requires at least RC2.

    This version is not backward compatible with existing scripts. However, there is a separate file, ghost_legacy.zh, included for this purpose.

    Also, thanks to Blaman/SpacemanDan for putting up with me through this. I know I can get a bit impatient at times. :p

    ghost.zh
    Demo quest and sample scripts
    AutoGhost enemies
    AutoGhost setup demo video
    Last edited by Saffith; 08-16-2011 at 12:16 PM.

  5. #15
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    Another update.
    • Added script versions of some of ZC's built-in movement functions
    • Added EWM_DRIFT and EWM_DRIFT_WAIT
    • The hitbox adjustments made by Ghost_SetHitOffsets() are now taken into account by Ghost_CanMove()


    Edit: Quickly followed by a bugfix update. :p
    Last edited by Saffith; 08-16-2011 at 12:16 PM.

  6. #16
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,458
    Level
    12
    vBActivity - Bars
    Lv. Percent
    93.1%
    I recommend this be stickied.

    EDIT:

    I found a... well, an oddity let's say.
    When using Ghost_CanMove with the diagonal directions, it's possible to get wrong results.
    The reason is that it simply composes the two other directions. For example, say you're doing this:

    Ghost_CanMove(DIR_LEFTUP,1,0);

    The result will be essentially (Ghost_CanMove(DIR_LEFT,1,0) && Ghost_CanMove(DIR_UP,1,0));
    However, if the enemy found itself in a scenario like this:

    |X|
    ___ *

    Then both LEFT and UP are true, but LEFTUP is not.

    Thus, oddity.
    Last edited by Imzogelmo; 08-30-2011 at 05:21 PM.

  7. #17
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    Blargh. All right, shouldn't be hard to fix.

  8. #18
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    A long overdue update.

    - Finally added handling for sideview screens
    - Improved movement functions a bit (in particular, 4-way walking should work much better now)
    - Added GHF_FULL_TILE_MOVEMENT, which makes the enemy consider a combo completely solid if any quadrant of it is
    - Various bug fixes


    I'm still only so happy with the movement functions. I was thinking about rewriting them completely, but that's proven rather tricky, so it'll have to wait for the next version.
    There's no handling yet for the No Ground Enemies combo and flag. I might just have GHF_NO_FALL control that, or maybe it could depend on the enemy type being Other (Floating). Any other ideas?

  9. #19
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    Another update.

    • 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.

  10. #20
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    Updated.

    • For the sake of maintainability, ghost.zh has been split into multiple files. You still only need to import ghost.zh itself; it imports all the others.
    • Drawing has been moved to the global script, so enemies won't disappear when the screen freezes.
    • The multi-FFC functions have been replaced. I kind of hate to do that, but they sucked, and no one was using them, anyway.
    • Directions 8-15 should be handled correctly now.
    • Ghost_Explode has been replaced by Ghost_DeathAnimation. This will allow scripts in which the animation is determined by a misc. attribute to support new animations as they're added.
    • Added functions to suspend and resume ghost.zh scripts.
    • Added functions to find random spawn points.
    • Added functions to simplify reading attributes.
    • Shadows can now be animated.
    • The "Is Flashing" and "Is Flickering" enemy flags work now.


    Global scripts will need updated. See the "global" section of ghost.txt or ghost_zh/scripts.zh for the current set of functions.

    I was going to redo movement this time, but it's taking longer than I expected. I'll be sure to get that next time.

Thread Information

Users Browsing this Thread

There are currently 4 users browsing this thread. (0 members and 4 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social