Jump to content

Photo

ghost.zh


  • Please log in to reply
645 replies to this topic

#226 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Location:Toxicville , Simcity

Posted 20 February 2013 - 07:06 PM

this is the most simple form of a boss ghost example you'll find i just learnt how to use it all it does is go up and down and it has all the lines you need to know.

all you need to do is set enemy 177 up and maybe have misc 11 and 12 as 1. also hp and damage can be set.

CODE
import "std.zh"
import "string.zh"
import "ghost.zh"

ffc script ghost
{
    void run()
    {
       npc ghost;
       ghost=Ghost_InitAutoGhost(this, 177);
       Ghost_SpawnAnimationPuff(this, ghost);
       int frame = 0;
       int a= 0;
       while(true)
       {
       Screen->DrawInteger(7, 56, 56, FONT_Z1,  0, -1, -1, -1, a, 0, 128);
       frame++;
       if (frame == 100) a = a +1;
       if (a == 2) a = 0;
       if (frame = 100) frame = 0;
       Ghost_Move(a, 1, 1);        
       Ghost_Waitframe(this, ghost, true, true);
       }
    }
}

Edited by tox_von, 20 February 2013 - 07:08 PM.


#227 Saffith

Saffith

    IPv7 user

  • Members

Posted 20 February 2013 - 07:24 PM

QUOTE(Anthus @ Feb 20 2013, 02:15 PM)  
And I didn't realize the code was suppose to generate 7 copes. But either way, the last two go away when the last knight is killed.

Two reasons for that, if you're wondering. One, it's a lot easier to script that way; one copy keeps track of which knights are alive and which phase of the battle you're in, while the rest just handle their own movement. Two, ZC thinks you've beaten them all when the placed enemy dies, so it needs to hang around until the rest are gone.

QUOTE
I was also wondering how you make a different ghost.zh file for another quest for future reference.

Just make a copy of it in a subdirectory and change the import to myQuest\ghost.zh. The main file is the only one that needs copied and modified for different quests.


QUOTE(tox_von @ Feb 20 2013, 07:06 PM)  
all you need to do is set enemy 177 up and maybe have misc 11 and 12 as 1. also hp and damage can be set.

Again, take the enemy ID as an argument.

CODE
    void run(int enemyID)
// ...
       ghost=Ghost_InitAutoGhost(this, enemyID);


#228 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Location:Toxicville , Simcity

Posted 20 February 2013 - 08:01 PM

i find it easier to directly type it so i can see it in the code and whats being set.

#229 Anthus

Anthus

    anthus

  • Contributors
  • Real Name:Antbus
  • Location:Ohio

Posted 21 February 2013 - 12:55 AM

QUOTE(Saffith @ Feb 20 2013, 07:24 PM)  

Two reasons for that, if you're wondering. One, it's a lot easier to script that way; one copy keeps track of which knights are alive and which phase of the battle you're in, while the rest just handle their own movement. Two, ZC thinks you've beaten them all when the placed enemy dies, so it needs to hang around until the rest are gone.
Just make a copy of it in a subdirectory and change the import to myQuest\ghost.zh. The main file is the only one that needs copied and modified for different quests.


Okay, so just move a copy of ghost.zh to another folder, and import it from there. So I'm assuming to has to be called "ghost.zh"? You can't have two in the same directory, with one named "Ghost2.zh?" right?

#230 Saffith

Saffith

    IPv7 user

  • Members

Posted 21 February 2013 - 12:58 AM

Sure, renaming it is fine, too.

#231 Anthus

Anthus

    anthus

  • Contributors
  • Real Name:Antbus
  • Location:Ohio

Posted 25 February 2013 - 04:05 PM

QUOTE(Saffith @ Feb 21 2013, 12:58 AM)  

Sure, renaming it is fine, too.


Okay, that makes it easy.

Also, I recolored the GB Popo for Classic:

IPB Image

Anyone can use these. icon_smile.gif

#232 Saffith

Saffith

    IPv7 user

  • Members

Posted 26 February 2013 - 11:33 PM

Another update. This will invalidate existing saved games. (Generally the case, but I thought I'd start mentioning it.)
There's a particularly high chance of new bugs this time, so be ready for that.
  • It's finally possible to read and change ghosted enemies' properties from other scripts using the functions GetEnemyProperty() and SetEnemyProperty().
  • SetEWeaponMovement() now takes another argument. Some similar weapon movement types have been merged with the differing functionality now controlled by the second argument.
  • The movement functions have been rewritten to be more accurate and faster.
  • The FireEWeapon functions can now take -1 for the sprite and sound arguments to use defaults for the weapon type.
  • 2x2 shadows are now used for enemies 3x3 and larger. (Only applies if GH_FAKE_Z or GHF_FAKE_Z is used)
  • Added GHF_STATIC_SHADOW for enemies whose shadows should never animate. (Only applies if GH_FAKE_Z or GHF_FAKE_Z is used)


#233 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 01 March 2013 - 12:51 PM

Ooh, sounds fancy. I'll definitely update soon. icon_smile.gif

Thanks again for all the work you put into this. It's really super appreciated.

#234 Mero

Mero

    Touch Fluffy Tail

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

Posted 21 March 2013 - 09:40 AM

1. Is it possible to create dummy weapons with the EW_FIRE or EW_FIRETRAIL type yet?
2. Is it possible to read and write to the ghost variables of another enemy?
3. For big shadows, is it possible to set the enemy size at which big enemies are used?
4. What stuff for the next update are you working on?

#235 Saffith

Saffith

    IPv7 user

  • Members

Posted 21 March 2013 - 11:36 AM

QUOTE(LordVolcanon @ Mar 21 2013, 10:40 AM)  
1. Is it possible to create dummy weapons with the EW_FIRE or EW_FIRETRAIL type yet?

Hm, I forgot that would be an issue. I'll try and work something out.
QUOTE
2. Is it possible to read and write to the ghost variables of another enemy?

Yes.
QUOTE
3. For big shadows, is it possible to set the enemy size at which big enemies are used?

It's not, but I can add that.
QUOTE
4. What stuff for the next update are you working on?

Mostly simple stuff; I don't have any huge plans for the near future. I was hoping I could remove some of the redundant eweapon code. I want to make it easier to use death animations (you should just be able to pass it to Ghost_Waitframe), and I'd like to add at least one new one. Probably a few other little things.

#236 Mero

Mero

    Touch Fluffy Tail

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

Posted 22 March 2013 - 01:56 PM

Well for the dummy weapon bug, you should be able to increment step, and then maintain it's position. EW_FIRE decrements by one each frame IIRC. May not work for EW_FIRETRAIL though.
Also will a death effect activate when eweapon->DeadState is set to WDS_DEAD by the engine such as a rock hitting a combo.

Edited by LordVolcanon, 22 March 2013 - 02:21 PM.


#237 Saffith

Saffith

    IPv7 user

  • Members

Posted 23 March 2013 - 08:44 AM

No, that can't be detected so easily. The rock is just removed without its DeadState ever being visibly changed.

#238 Mero

Mero

    Touch Fluffy Tail

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

Posted 25 March 2013 - 08:47 PM

QUOTE(Saffith @ Mar 23 2013, 07:44 AM)  

No, that can't be detected so easily. The rock is just removed without its DeadState ever being visibly changed.


Just how are eweapons normally removed anyways. It's not delete is it. Cause then it's impossible to check.

#239 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 25 March 2013 - 09:15 PM

This is a bit of a methods question: how would I go about having an enemy that respects combo solidity and relevant No Enemies flags while clipping through Link without dealing or taking damage and knockback? I can take care of taking damage with Ghost_SetAllDefenses(ghost, NPCDT_IGNORE), but I can't figure out a good way for the enemy not to cause knockback on Link. Setting ghost->CollDetection to false results in clipping through combos and flags, and I've also tried reducing the hitbox size. Any advice?

edit:

I guess I could do something like this:

CODE
ghost->CollDetection = true;
if (canMove)
     move
ghost->CollDetection = false;
Ghost_Waitframe()


It may not be the most elegant solution, though. I'm curious if I'm just missing a really obvious ghost flag or something.

#240 Mero

Mero

    Touch Fluffy Tail

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

Posted 25 March 2013 - 09:42 PM

npc type none should work.
Try that.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users