Jump to content

Photo

ghost.zh


  • Please log in to reply
645 replies to this topic

#166 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 13 October 2012 - 05:06 AM

The problem with that is that some enemies will still go about their usual business while Link is holding up an item, which could cause some possible strange thing. Though I could probably add a check to see if Link is holding stuff up, and if he is to not run majority of the script that handles movement and the like. No big deal though. But it's like I said - I'd probably missed something obvious. icon_razz.gif

Thanks! icon_smile.gif

#167 LinktheMaster

LinktheMaster

    Hey Listen, Kid

  • Members
  • Real Name:Matt
  • Location:United States

Posted 13 October 2012 - 10:02 AM

If I may make a request, Saffith, if you go through the effort of adding that, could you maybe make a global variable that freezes all of the ghosted enemies as well? And I haven't tested it, but you probably need something for ghosted weapons, too.

#168 Saffith

Saffith

    IPv7 user

  • Members

Posted 14 October 2012 - 09:25 AM

Sure, shouldn't be hard to add something like that.

#169 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 09 November 2012 - 10:34 PM

Out of curiosity, how simple would it be for someone to add extra functionality to ghost.zh? For example, if I wanted to add a flag to eweapons that have them accelerate, or make new type of 'bullet explosions'. Would it be something you'd rather people not do?

I 'unno. Just curious. :3

#170 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 09 November 2012 - 11:33 PM

QUOTE(SpacemanDan @ Nov 9 2012, 08:34 PM) View Post

Out of curiosity, how simple would it be for someone to add extra functionality to ghost.zh? For example, if I wanted to add a flag to eweapons that have them accelerate, or make new type of 'bullet explosions'. Would it be something you'd rather people not do?

I 'unno. Just curious. :3


Don't mean to threadjack, but a while ago (april-may?) I started on a little "particle.zh" file. Explosions would be very easy. Would there be any demand for something like this?

#171 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 09 November 2012 - 11:51 PM

What does particle.zh do, mainly? I'd probably be interested in it.

#172 Saffith

Saffith

    IPv7 user

  • Members

Posted 10 November 2012 - 03:20 PM

QUOTE(SpacemanDan @ Nov 9 2012, 10:34 PM) View Post
Out of curiosity, how simple would it be for someone to add extra functionality to ghost.zh? For example, if I wanted to add a flag to eweapons that have them accelerate, or make new type of 'bullet explosions'. Would it be something you'd rather people not do?

I don't object at all, but ZScript doesn't make it easy to do something like that. No preprocessor, no virtual functions, no function pointers, nothing...
EWeapon stuff shouldn't be too hard; mostly, you'd need a function that replaces UpdateEWeapons. Anything to do with the enemy itself would probably require a patch. But, actually, I think the easiest way to add functionality would be to write a separate script for it and have the enemy run a copy.


#173 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 10 November 2012 - 04:08 PM

I guess 'bullet explosions' wasn't quite the right wording. My bad. ): I meant like how some of the death effects for eweapons cause more bullets to spawn in their place. One thing I'd actually like to try is having bullets that explode into bullets that...get this...explode into even more bullets! icon_biggrin.gif Though I do have a script that runs after the weapons die that does effectively the same thing, I was just looking for a way to avoid using too many extra scripts (which means more FFCs) or something. I dunno if that makes any sense though. :S Either way, I'll toy with it and see what I can do. Thanks! icon_smile.gif

#174 Saffith

Saffith

    IPv7 user

  • Members

Posted 10 November 2012 - 04:48 PM

Don't forget the prototype-based death effects. You can use those recursively.
You could also do something like this:

CODE
void UpdateEWeaponsMod()
{
    if(Link->Action==LA_HOLD1LAND || Link->Action==LA_HOLD2LAND ||
       Link->Action==LA_HOLD1WATER || Link->Action==LA_HOLD2WATER)
        return;
    
    eweapon wpn;

    for(int i=Screen->NumEWeapons(); i>0; i--)
    {
        wpn=Screen->LoadEWeapon(i);
        
        if((wpn->Misc[__EWI_FLAGS]&__EWFI_IS_GHZH_EWPN)==0 ||
           (wpn->Misc[__EWI_FLAGS]&__EWFI_DUMMY)!=0)
            continue;

        UpdateEWeapon(wpn);

        if((wpn->Misc[__EWI_FLAGS]&__EWFI_DEAD)==0 && wpn->Misc[0]>0)
        {
            DoMoreStuff(wpn);
            wpn->Misc[0]=0;
        }
    }
}

Then just use EWD_VANISH and put your own stuff in Misc[0].
I say you shouldn't use the __ constants, but a simple function like that should be easy to update as needed.

#175 Saffith

Saffith

    IPv7 user

  • Members

Posted 23 November 2012 - 12:37 AM

Does anyone use the multi-FFC stuff at all? Looking at it again, I'm not too happy with it. If no one's using it, I may just remove it, at least until I can come up with something better.

#176 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 23 November 2012 - 01:14 AM

I don't think I've used it any unfortunately. :S What was the gist of it could do?

#177 Saffith

Saffith

    IPv7 user

  • Members

Posted 23 November 2012 - 01:47 AM

It was meant to make enemies made of multiple FFCs, like Iflyte in the demo, easier. It does most of the handling for additional FFCs automatically. Finds unused FFCs to commandeer, positions and colors them correctly, etc. Looking at it now, though, I think it's more trouble than it's worth to set up, and the next update would require modifying any scripts using it. And now it's proving pretty difficult to update.
I think a better solution would be to provide a combo drawing function that you could use similarly to Screen->FastCombo().
Well, except that doesn't work so well with stunned or exploding enemies... Maybe just a simplfied version of the current system.

Edit: Okay, I think I've got it worked out. The new system will be limited to a fixed number of additional combos, currently four. That's probably still more than anyone will actually use, but that shouldn't be a problem.

#178 Saffith

Saffith

    IPv7 user

  • Members

Posted 25 November 2012 - 11:50 PM

QUOTE(LinktheMaster @ Oct 13 2012, 10:02 AM) View Post
If I may make a request, Saffith, if you go through the effort of adding that, could you maybe make a global variable that freezes all of the ghosted enemies as well? And I haven't tested it, but you probably need something for ghosted weapons, too.

I'm guessing you're just talking about suspending scripts, not also blocking built-in behavior, yeah?

#179 Saffith

Saffith

    IPv7 user

  • Members

Posted 09 December 2012 - 06:16 PM

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.

#180 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 09 December 2012 - 08:32 PM

Ooh, fancy. I'll give the new update a whirl in the very near future. Thanks for that! icon_smile.gif

EDIT: Question. If I make an e/lweapon through regular means (not using ghost.zh functions) and set those weapon's misc values, will I have problems or does ghost.zh only affect eweapons it created?

Basically, I want to make an eweapon and change a number in its misc values as a bit of an indicator for other things in the script. I can probably write up a work-around, but it'd be easier to use the misc values.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users