Thanks!
ghost.zh
#166
Posted 13 October 2012 - 05:06 AM
Thanks!
#167
Posted 13 October 2012 - 10:02 AM
#168
Posted 14 October 2012 - 09:25 AM
#169
Posted 09 November 2012 - 10:34 PM
I 'unno. Just curious. :3
#170
Posted 09 November 2012 - 11:33 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
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
Posted 09 November 2012 - 11:51 PM
#172
Posted 10 November 2012 - 03:20 PM
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
Posted 10 November 2012 - 04:08 PM
#174
Posted 10 November 2012 - 04:48 PM
You could also do something like this:
{
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
Posted 23 November 2012 - 12:37 AM
#176
Posted 23 November 2012 - 01:14 AM
#177
Posted 23 November 2012 - 01:47 AM
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
Posted 25 November 2012 - 11:50 PM
I'm guessing you're just talking about suspending scripts, not also blocking built-in behavior, yeah?
#179
Posted 09 December 2012 - 06:16 PM
- 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
Posted 09 December 2012 - 08:32 PM
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


