Jump to content

Photo

ghost.zh


  • Please log in to reply
645 replies to this topic

#196 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 21 December 2012 - 09:01 PM

Did the way enemy flickering worked change any? I had it set before the update and it worked fine, but with the new update, all ghost enemies flicker regardless of being hit or not. O_o

#197 Saffith

Saffith

    IPv7 user

  • Members

Posted 21 December 2012 - 09:22 PM

D'oh. Yeah, there was a little flashing bug. I fixed that, but I guess I forgot to recheck flickering. icon_redface.gif
Anyway, simple enough. It's fixed now.

Edit: Nope, I rushed it and screwed it up again. Fantastic.
Now it's fixed. Or you can just fix it in place. update.zh, lines 159-162:
CODE
        // Not flickering
        if((__ghzhData[__GH_GLOBAL_FLAGS]&__GHGF_FLICKER)==0 ||
           (GH_ENEMIES_FLICKER==0 && (ghost->MiscFlags&10000000b)==0) ||
           (GH_ENEMIES_FLICKER!=0 && __Ghost_FlashCounter==0 && (ghost->MiscFlags&10000000b)==0))


Clearly, I should've just made that a separate function, but that'll do for now...

#198 Moosh

Moosh

    The Mush

  • Moderators

Posted 23 December 2012 - 11:59 PM

I'm trying to use GHF_WATER_ONLY and the enemy is going on land anyways. Am I doing something wrong or is the flag bugged?

#199 Saffith

Saffith

    IPv7 user

  • Members

Posted 24 December 2012 - 12:05 AM

I'm not seeing a problem with it. Can you show me what you've got?

#200 Moosh

Moosh

    The Mush

  • Moderators

Posted 24 December 2012 - 12:22 AM

CODE
ffc script Water_Tektite{
    void run(int enemyid){
        npc ghost=Ghost_InitAutoGhost(this, enemyid, GHF_WATER_ONLY|GHF_KNOCKBACK|GHF_REDUCED_KNOCKBACK|GHF_STUN|GHF_CLOCK);
        int combo=ghost->Attributes[10];
        Ghost_Transform(this, ghost, combo, ghost->CSet, 1, 1);
        ghost->OriginalTile=GH_BLANK_TILE;
        while(true){
            Ghost_Waitframes(this, ghost, true, true, 60);
            int angle=Angle(Ghost_X, Ghost_Y, Link->X, Link->Y)+Rand(-90, 90);
            for(int i=0; i<30; i++){
                Ghost_MoveAtAngle(angle, ghost->Step/100, 0);
                Ghost_Waitframe(this, ghost, true, true);
            }
        }
    }
}

Here's the script. Very basic enemy, don't see anything in particular that could have caused it. I know you updated ghost for the final build of 2.5 which I haven't upgraded to for reasons (basically I don't want more than one ZC 2.5 build on my computer if I can help it and so I'm waiting until I finish a couple quests before I update). Could that be my problem? Were there bugs with this flag prior to that update?

#201 Saffith

Saffith

    IPv7 user

  • Members

Posted 24 December 2012 - 12:28 AM

CODE
        npc ghost=Ghost_InitAutoGhost(this, enemyid, GHF_WATER_ONLY|GHF_KNOCKBACK|GHF_REDUCED_KNOCKBACK|GHF_STUN|GHF_CLOCK);

That's the problem. I ran out of bits for flags, so you can't OR them together anymore. You have to do them one by one.

CODE
        npc ghost=Ghost_InitAutoGhost(this, enemyid);
        Ghost_SetFlag(GHF_WATER_ONLY);
        Ghost_SetFlag(GHF_KNOCKBACK);
        Ghost_SetFlag(GHF_REDUCED_KNOCKBACK);
        Ghost_SetFlag(GHF_STUN);
        Ghost_SetFlag(GHF_CLOCK);


#202 Moosh

Moosh

    The Mush

  • Moderators

Posted 24 December 2012 - 12:35 AM

QUOTE(Saffith @ Dec 24 2012, 12:28 AM)  

CODE
        npc ghost=Ghost_InitAutoGhost(this, enemyid, GHF_WATER_ONLY|GHF_KNOCKBACK|GHF_REDUCED_KNOCKBACK|GHF_STUN|GHF_CLOCK);

That's the problem. I ran out of bits for flags, so you can't OR them together anymore. You have to do them one by one.

CODE
        npc ghost=Ghost_InitAutoGhost(this, enemyid);
        Ghost_SetFlag(GHF_WATER_ONLY);
        Ghost_SetFlag(GHF_KNOCKBACK);
        Ghost_SetFlag(GHF_REDUCED_KNOCKBACK);
        Ghost_SetFlag(GHF_STUN);
        Ghost_SetFlag(GHF_CLOCK);


I feel dumb now. By ran out of bits do you mean I can't OR them together at all or that there's a cap or how many I can or together and I exceeded it?

#203 Saffith

Saffith

    IPv7 user

  • Members

Posted 24 December 2012 - 12:39 AM

It depends on the specific flags you use, but, strictly speaking, you shouldn't use any of them that way. The option's only still available for the sake of backward compatibility.

#204 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 24 December 2012 - 07:35 AM

I think any set of flags in ZC can have a maximum of 16 bits, which produces a value of up to 65535. Saffith must have gone over this limit and now we must set them individually because of this.

#205 Moosh

Moosh

    The Mush

  • Moderators

Posted 24 December 2012 - 03:43 PM

Updated ZC, updated ghost, error message, mom's spaghetti.

QUOTE
PASS 1: PARSING
PASS 2: PREPROCESSING
PASS 3: BUILDING SYMBOL TABLES
TMP, LINE 239: ERROR S09: VARIABLE _GHI_IN_USE IS UNDECLARED.
TMP, LINE 239: ERROR S10: FUNCTION GHOST_CLEARATTACHEDFFCS IS UNDECLARED.


Tried importing ghost_legacy to see if that would fix the problem, still returning the same error. What am I doing wrong?

Edited by Moosh, 24 December 2012 - 03:44 PM.


#206 Mero

Mero

    Touch Fluffy Tail

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

Posted 24 December 2012 - 04:25 PM

Did you export ghost_zh and ghost.zh to the same folder as ZQuest?

#207 Moosh

Moosh

    The Mush

  • Moderators

Posted 24 December 2012 - 04:47 PM

Yes I did. I've tried putting ghost.zh in the same folder as the rest and changing some things and it appears it's having trouble importing update.zh.

Edit: D'oh! I see what my problem was. I had modified versions of stuff from the old in my actual script buffer. Well shit.

Edit 2: Okay, the update broke all of my autoghost enemies. All of them. I can't help but feel a little grumpy about that since it appears you went to great lengths to maintain backwards compatibility and I have absolutely no clue what's wrong.

Edit 3: Edited global script and now autoghost enemies are appearing at least, but none of them do anything after spawning nor to they visibly take damage or play any death effects.

Edited by Moosh, 24 December 2012 - 10:24 PM.


#208 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 04 February 2013 - 07:20 PM

Did MoveAtAngle break or is there a certain way to set it up? I ask because when I try to use it, the enemy in question will always move right. O_o

#209 Saffith

Saffith

    IPv7 user

  • Members

Posted 09 February 2013 - 12:07 PM

Sorry. Been failing to keep up with the thread, obviously.

QUOTE(Moosh @ Dec 24 2012, 04:47 PM)  
Edit 3: Edited global script and now autoghost enemies are appearing at least, but none of them do anything after spawning nor to they visibly take damage or play any death effects.

Did you get this worked out?
Were you using an existing save? That's all I can think of, offhand.

QUOTE(SpacemanDan @ Feb 4 2013, 07:20 PM)  
Did MoveAtAngle break or is there a certain way to set it up? I ask because when I try to use it, the enemy in question will always move right. O_o

Degrees/radians issue, probably. It's degrees you want, in this case.
I do wish ZScript were a bit more consistent about that...

#210 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 09 February 2013 - 07:18 PM

I got it working. I believe that was the problem. XD Thanks for the help. icon_smile.gif


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users