Jump to content

Photo

ghost.zh


  • Please log in to reply
645 replies to this topic

#301 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 01 August 2013 - 09:23 AM

I have a few questions regarding Ghost, as I am finally getting into using it, and I wanted to point out some oddities:
 
Oddities first, i noted that Ghosted enemies co not obey the Kill All Enemies and Clock class items. They are not frozen when a clock is used, and they do not die when a Kill All Enemies is used. Is there a way to fix this?
 
I also have been requested to make a floating enemy (no movement) that explodes (dealing damage) on death.
 
I need some basic explanation of this function:
Ghost_Explode(this, ghost);
 
Does this only create an explosion image, or doe it deal damage by default?
 
How do I implement effects on enemy death? I expect I need a while, or an if statement concrning the ghosted enemy HP, such as:
 
[code[
if ghost HP < 0{
 //Do this
}
[/code] 

I know there is no tutorial yet, but some explanation with examples would be very helpful to us non-C people.
 
If anyone could toss some good examples of simple ghosted enemies at me (not bosses, or huge scripts, but merely ghosted versions of basic enemies) I would appreciate it greatly. I need to learn how to control the simple functions before I try to make bigger monsters.

 

Maybe this is the time to request a tutorial thread, that explains how to make simple enemies, implement drop-sets, death effects, and the like... A basic enemy, that obeys the movement in the enemy editor, and uses some ghosted effects would be the place to start to help people like myself, who want to add attacks and special drops or special SFXor death effects to enemies without scripting their movement entirely; then move on to scripted movement, and more complex tasks.

 

Is anyone willing to make such a guide, or provide some well-documented scripts for these kinds of enemies from which someone like myself may make a guide? (I am a technical writer by profession, and if I understand something, I can explain to others in human-readable terms.)


  • Avaro and coolgamer012345 like this

#302 Saffith

Saffith

    IPv7 user

  • Members

Posted 13 August 2013 - 01:43 PM

Oddities first, i noted that Ghosted enemies co not obey the Kill All Enemies and Clock class items. They are not frozen when a clock is used, and they do not die when a Kill All Enemies is used. Is there a way to fix this?

If clocks don't work, I would guess your clock doesn't have GhostZHClockScript set as its pickup script.
I don't know why Kill All Enemies wouldn't work, though. It's working for me, so I don't know what the problem might be.
 

I need some basic explanation of this function:
Ghost_Explode(this, ghost);

Ghost_Explode() shouldn't be used anymore; it's been replaced by Ghost_DeathAnimation(). But the explosions it creates have collision detection disabled, so that's not what you want.

Currently, you'd do something like this with it:
bool stillAlive=Ghost_Waitframe(this, ghost, false, false);
if(!stillAlive)
{
    Ghost_DeathAnimation(this, ghost, anim);
    Quit();
}
You could do this instead:
bool stillAlive=Ghost_Waitframe(this, ghost, true, false);
if(!stillAlive)
{
    eweapon explosion=Screen->CreateEWeapon(EW_BOMBBLAST);
    // Etc.
    Quit();
}


#303 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 17 August 2013 - 10:15 PM

I'm using Ghost_InitWait2 with a Gleeok since Autoghosting segmented enemies tend to cause problems,. Also I problems I have now is that the controller for Gleeok's is what is ghosted and also the first neck segment. I want to use it's body as the collision box for movement. Any ideas Saffith on how to work around this predicament I'm having? Second, if a gleeok head get's disembodied at the edge of the screen it doesn't move around; not sure if that's caused by the No Flying Enemies combos though or an actual bug. Finally is it possible to set Ghost_CSet to use a ESP palette somehow, I know autoghost npcs can. But I'm not sure how I do it.

 

Thanks again for all your hard work on this Saffith, and let's all love Lain btw. :tard:


Edited by LordVolcanon, 17 August 2013 - 10:15 PM.


#304 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 19 August 2013 - 12:13 PM

Is there a simple way to set collision detection on a ghopsted enemy to false?
 
Should I just set void Ghost_SetHitOffsets to 0,, or -1 or something odd, or is there a way to turn off collisions completely?
 
I tried the suggested method to cause an enemy to explode on death, but to no avail. This is what i did... Can anyone find the error?
 




I have the FFC flags set to: d0 = 9, D1 = 10. It should use sprite 9 for the explosion, and deal 10 damage. Do I need to hard-code these values?

I tried this next... Now, the enemy appears, and then immediately vanishes, and an explosion happens elsewhere on the screen. The explosion doesn't appear where the enemy was, nor does it wait for Link to kill it.

This is the flowchart as it stands:
1>Link appears on screen.
2>Enemy appears.
3>Enemy vanishes.
4>Explosion appears on screen, but not where enemy was.

I am aiming for:

1>Link appears on screen.
2>Enemy appears on screen.
3> Link kills enemy.
4> Enemy causes explosion where enemy died.

I must be missing something big here; the present script is below:
 


I also tried to encapsulate another set of if and else if statements in a while(true) loop, but it caused ZC to crash:



Will this work at all, and if so, do I need to place:

Ghost_Waitframe(this, ghost, true, true);

...inside the while loop?

 

Aside from the explosion I am trying to find a way to allow Limk to touch an enemy without having any effects of being hurt:

 

No bounce, no hurt sound, no flicker, etc.. I have enemies set to 0-damage when touched, and I want touching the enemy to be safe, but other possible effects that do damage (such as shooting, or exploding when broken).

 

I thought that closing off its collDetection (making it false) may work, but I also think that would make it impossible to use weapons on it. Is there a way to make a ghosted enemy something that Link can destroy, but one that also does not hurt Link (or cause any of the effects that being hurt normally causes) when touched?


Edited by ZoriaRPG, 19 August 2013 - 01:50 PM.


#305 grayswandir

grayswandir

    semi-genius

  • Members

Posted 19 August 2013 - 01:36 PM

Ghost relies completely on the built-in collision detection. So to turn collision detection off, you just do

ghost->CollDetection = false;

 

I'm pretty sure you want Ghost_InitCreate before any calls to Ghost_Waitframe.

 

You have no Waitframe in your while loop, so it will run forever. I like to do:

while (Ghost_Waitframe(this, ghost, true, false)) {
  // Enemy Code ...
  }
// Enemy died, cleanup code goes here.


#306 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 19 August 2013 - 01:57 PM

With:
 

ghost->CollDetection = false;

 
Will Link still be able to destroy enemies?

Regarding:

while (Ghost_Waitframe(this, ghost, true, false)) {
  // Enemy Code ...
  }
// Enemy died, cleanup code goes here.
 

 
I presume that with this, I am calling a function as long as the ghost is alive, so when the waitframe is called, the loop ends and the remainder of the code (outside the loop) is executed?
 
I tried this; the same problem... The enemy appears, then vanishes, causing an explosion in the top-left corner of the screen, whereas the enemy FFC is on the bottom-right.


 
I set ghost->CollDetection = false, however touching the ghosted enemy still causes Link to flash, bounce back, and moan in pain. Link is also able to destroy the enemy. I don't think that it did a thing.
 
Here is the code for the simpler (non-exploding) enemy. I want Link to be able to touch it without any effects of being hurt, but I don't see any obvious way to do this.


Edited by ZoriaRPG, 19 August 2013 - 02:19 PM.


#307 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 19 August 2013 - 07:01 PM

Hey I was just wondering but does a enemy actually need ghost.zh to be scripted?



#308 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 19 August 2013 - 07:12 PM

No, it doesn't, but ghost.zh makes it A LOT easier. It's the difference between trying to build a house with nothing but a saw and a forest and trying to build a house with lots of precut lumber.

Zoria, why not just make your own Waitframe function? Put your death stuff all in that function, and you won't have to deal with that while loop you have. Regarding the enemy death, I know Ghost_Explode somehow handles everything, so you might wanna look at that to see how Saffith did it.

#309 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 19 August 2013 - 07:14 PM

Ok, Thanks for answering russ.



#310 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 20 August 2013 - 12:18 PM

I added this to other.zh as suggested (which is merely a tiny variation of Ghost_Explode) that adds damage. I don't know if Saffith would want to include it in the next version; I also don't know if there is an easy way to set this damage (or duration) as an argument to pass from the FFC to this command.



I still need a way to make Link able to touch a ghosted enemy without being hurt (i.e. Link is not flashing, bounced back, and groaning.)

Any chance of a No_hurtFX command in the future? Is this even possible?

 

I also note that any exploding death enemy leaves no drops. Is that because of this (in Ghost_Explode)?

Ghost_ClearCombos();

 

Is there a way to circumvent this?


Edited by ZoriaRPG, 20 August 2013 - 12:54 PM.


#311 kurt91

kurt91

    Follower of Destiny

  • Members
  • Real Name:Kurtis
  • Location:Eastern Washington University

Posted 22 August 2013 - 04:31 AM

I took a look at the files in this to try and figure out how it works, and I'm completely lost.

 

What is the difference between Ghost_TileWidth/Ghost_TileHeight and the normal TileWidth/TileHeight? Does using the ghost version improve compatibility with the default movement patterns in the Enemy Editor or anything? I'm asking because I'm just now realizing that the FFC BigEnemy script seems to completely fall apart regarding firing weapons (Spawn locations for eweapons are the edges of the top-left tile of the enemy sprite instead of the whole thing) and any of the 4-Frame 4_direction animations (Up/Down animations work. Left/Right and any firing animations do not), and I was hoping that there was a solution somewhere in this.



#312 David

David

    Fallen leaves... adorn my night.

  • Administrators
  • Real Name:David
  • Pronouns:He / Him

Posted 22 August 2013 - 05:49 AM

Ya, I think that's what it does, for compatibility. As for your script, I don't know; just wait for a person whose better at scripting.

#313 Moosh

Moosh

    The Mush

  • Moderators

Posted 17 November 2013 - 02:59 PM

I just updated my ghost.zh to the newest version after discovering that EWM_DRIFT only seemed to only push bullets up instead of the specified direction. After the update it still appears to be broken. This has happened with multiple scripts and apparently Evan has had the problem too, so I'm pretty sure it's not just a silly mistake on my end...



#314 Saffith

Saffith

    IPv7 user

  • Members

Posted 18 November 2013 - 12:38 PM

Yep. Stupid mistake, easy to fix. In eweapon_movement.zh, change the first line of __UpdateEWMDrift() to:
int dir=wpn->Misc[__EWI_MOVEMENT_ARG];


#315 Saffith

Saffith

    IPv7 user

  • Members

Posted 21 November 2013 - 11:14 AM

Finally, another update. It's mostly internal changes and some bug fixes, but there's some new stuff.
This will break existing save files.
  • Added Ghost_FloaterWalk(), the movement type used by peahats and keese
  • Added EWF_ROTATE_360
  • Added settings to change how big an enemy must be to use large shadows
  • Added an option to use scripted shadows rather than built-in ones when possible
  • Added new Ghost_Waitframe() variants to simplify usage; you can now leave out quitOnDeath and clearOnDeath (they'll both be true) or specify a death animation
  • The global script functions have been consolidated into three; you'll need to update the global script, but it should never be necessary for future updates



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users