Jump to content

Photo

ghost.zh


  • Please log in to reply
645 replies to this topic

#601 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 January 2017 - 04:25 PM

In being handed a quest and a large script set to work on, by another member, I have run aground on this function:

 

Ghost_DeathAnimationPuff(ffc, npc)

 

It does not appear to be in any of the ghost.zh sets that I have, through 2.8. Is it a standard ghost function, or something custom that I will need to fix? It sounds like a custom waitframe to me, but I'm uncertain.



#602 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 13 January 2017 - 03:43 PM

@Saffith you there? I still need to know how to turn of the enemy's shadow at set it position to the combo found by FindSpawnPoint()


Edited by Shadowblitz16, 13 January 2017 - 03:43 PM.


#603 Saffith

Saffith

    IPv7 user

  • Members

Posted 13 January 2017 - 05:36 PM

@Saffith how do I turn the ghost's shadow off so I can manually draw it?

I'm not sure you can, come to think of it. You could just set the shadows to use blank tiles. I don't think there's another way to do it at the moment.
 

also how do I set the ghosted npc's position to a combo found by FindSpawnPoint()?
it looks like it returns a combos 1d position but I don't know how to convert the npc's 2d position to 1d.

Ghost_X=ComboX(pos);
Ghost_Y=ComboY(pos);

Ghost_DeathAnimationPuff(ffc, npc)
 
It does not appear to be in any of the ghost.zh sets that I have, through 2.8. Is it a standard ghost function, or something custom that I will need to fix? It sounds like a custom waitframe to me, but I'm uncertain.

That's not one of mine.

#604 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 13 January 2017 - 09:53 PM

ok thankyou saffith



#605 Alucard648

Alucard648

    Wizard

  • Members
  • Location:castle Dracula

Posted 04 June 2017 - 10:33 PM

Got a bug report: the header does not clean up no longer used FFC`s (like defeated ghosed enemies) properly, only set FFC`s combo to 0. If another script will use this FFC, it will inherit it`s settings (like velocity and flags) and fail to work properly.



#606 ywkls

ywkls

    Master

  • Members

Posted 04 June 2017 - 11:55 PM

Got a bug report: the header does not clean up no longer used FFC`s (like defeated ghosed enemies) properly, only set FFC`s combo to 0. If another script will use this FFC, it will inherit it`s settings (like velocity and flags) and fail to work properly.

I'm not sure if that's a product of ghost.zh or ffcscript.zh myself since I had a similar issue myself where items which were launching ffcs retained some aspects of previously used scripts.

 

I don't know that Saffith has issued a fixed version of the ffcscript.zh issue yet or not, but the function which gave me grief was RunFFCScript and RunFFCScriptOrQuit. I just added some lines to reset the values which weren't already blanked by it and my problems vanished.

 

If ghost.zh uses a different function, then it's definitely a bug.



#607 Alucard648

Alucard648

    Wizard

  • Members
  • Location:castle Dracula

Posted 05 June 2017 - 08:37 AM

If ghost.zh uses a different function, then it's definitely a bug.

Checked the code that handles ClearOnDeath flag. Just sets FFC`s combo to 0 and nothing else.



#608 Saffith

Saffith

    IPv7 user

  • Members

Posted 08 June 2017 - 03:23 PM

I don't know that I'd consider that a bug, exactly, but I suppose it's at least unexpected. Easy enough to change.

#609 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 09 June 2017 - 01:15 PM

Checked the code that handles ClearOnDeath flag. Just sets FFC`s combo to 0 and nothing else.

 

Bear in mind that ffc->Link cannot be sterilised once set in 2.5. That is a genuine programme bug, so be careful when setting it in any of your ffc headers.


  • Alucard648 likes this

#610 ywkls

ywkls

    Master

  • Members

Posted 22 June 2017 - 02:12 PM

So... I have a question probably related to the internal mechanics of ghost.zh (and since I don't really understand all of them, I decided to ask here).

 

Why is it that sometimes when I change the settings for an ffc script that runs an enemy it works perfectly fine and others I have to reload a fresh save to get it to function correctly?

 

From what I understand regarding save files, this should either always or never be happening. The circumstances under which it occurs are rather inconsistent and hard to predict, so I can't really give an example. And I don't know if anyone else has run into this issue before, either.



#611 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 22 June 2017 - 02:52 PM

"Settings" for an ffc script? What settings for example?



#612 ywkls

ywkls

    Master

  • Members

Posted 22 June 2017 - 10:16 PM

"Settings" for an ffc script? What settings for example?

What commands that are included inside the ffc script, the order of those commands and so forth.

 

Sometimes after I write an ffc script and load it into a slot, it doesn't run at all when the selected enemy is onscreen unless I'm starting from a new game. Most of the time, it works just fine; but every once in a while, it doesn't.

 

In other cases, I have things which control the enemy's appearance; size, and so for which I alter and are control from within the ffc script but when loading the game to test, remain unchanged.


Edited by ywkls, 22 June 2017 - 10:16 PM.


#613 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 23 June 2017 - 01:14 PM

//Terminate an FFC, and set all its properties to 0.
void EndFFC(int ffc_id){
    ffc f = Screen->LoadFFC(ffc_id);
    f->Data = 0;
    f->Script = 0;
    f->CSet = 0;
    f->Delay = 0;
    f->X = 0;
    f->Y = 0;
    f->Vx = 0;
    f->Vy = 0;
    f->Ax = 0;
    f->Ay = 0;
    for ( int q = 0; q <= 10; q++ ) f->Flags[q] = false;
    f->TileWidth = 0;
    f->TileHeight = 0;
    f->EffectWidth = 0;
    f->EffectHeight = 0;
    f->Link = 0;
    for ( int q = 0; q < 15; q++ ) f->Misc[q] = 0;
}


//Terminate an FFC, and set all its properties to 0.
void EndFFC(ffc f){
    f->Data = 0;
    f->Script = 0;
    f->CSet = 0;
    f->Delay = 0;
    f->X = 0;
    f->Y = 0;
    f->Vx = 0;
    f->Vy = 0;
    f->Ax = 0;
    f->Ay = 0;
    for ( int q = 0; q <= 10; q++ ) f->Flags[q] = false;
    f->TileWidth = 0;
    f->TileHeight = 0;
    f->EffectWidth = 0;
    f->EffectHeight = 0;
    f->Link = 0;
    for ( int q = 0; q < 15; q++ ) f->Misc[q] = 0;
}

These are what I put in the std.zh stuff for 2.6.


Edited by ZoriaRPG, 23 June 2017 - 01:14 PM.


#614 Saffith

Saffith

    IPv7 user

  • Members

Posted 23 June 2017 - 03:00 PM

Sometimes after I write an ffc script and load it into a slot, it doesn't run at all when the selected enemy is onscreen unless I'm starting from a new game. Most of the time, it works just fine; but every once in a while, it doesn't.
 
In other cases, I have things which control the enemy's appearance; size, and so for which I alter and are control from within the ffc script but when loading the game to test, remain unchanged.

Strange, those aren't things that should require a new game. I wouldn't rule out some global variable weirdness, but usually that's a lot worse. Maybe there's some interaction with other scripts somehow?
 

These are what I put in the std.zh stuff for 2.6.

It's missing Misc[15]. But unless the handling's changed since 2.50.2, you can actually skip that, since Misc[] is cleared whenever Script is set.
And don't forget that it'll fail if an FFC calls it on itself, because it can't set its own script. It should probably call Quit() in that case.

#615 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 23 June 2017 - 03:14 PM

Strange, those aren't things that should require a new game. I wouldn't rule out some global variable weirdness, but usually that's a lot worse. Maybe there's some interaction with other scripts somehow?
 
It's missing Misc[15]. But unless the handling's changed since 2.50.2, you can actually skip that, since Misc[] is cleared whenever Script is set.
And don't forget that it'll fail if an FFC calls it on itself, because it can't set its own script. It should probably call Quit() in that case.

 

(emphasis, mine)

 

What is the reason for this? I was not aware that this does not work, and I've been doing this->Script = 0 for years.

 

FFSCRIPT in ZASM does not seem to preclude setting the script on a this pointer.

 

tmpscr->ffscript[ri->ffcref] = vbound(value/10000, 0, scripts.ffscripts.size()-1);

 

Is it because tmpscr->initialized[ri->ffcref]  is set false?

 

P.S. The reason that these functions never call Quit() is to safeguard against quitting global active scripts. I fixed the lack of <=.


Edited by ZoriaRPG, 23 June 2017 - 03:43 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users