Jump to content

Photo

ghost.zh


  • Please log in to reply
645 replies to this topic

#511 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 13 April 2016 - 07:54 AM

I'm really stuck  :worried:

 

When I import my scripts in a new quest file, it works all fine, but when I import them in my actual quest (one I've been working one a long time) the enemy doesn't move. I got this error every frame in allegro.log:

Global script 2 (Active): Invalid pointer (0) passed to array (don't change the values of your array pointers)

Does any of you know what this means? I'm not even passing anything to an array in the global script directly. Here is my global script:

import "std.zh"
import "ffcscript.zh"
import "string.zh"
import "ghost.zh"

import "NTCCscripts/enemy.z"

global script Active {
    void run(){
	StartGhostZH();
        while(true)
        {
            UpdateGhostZH1();
            BombsScreenShake();
            Waitdraw();
            UpdateGhostZH2();
            Waitframe();
        }
    }
}

And my enemy script, which works perfectly in another quest file, very same scripts:

ffc script Rebonite{
	void run(int enemyId){
        // Initialize
        npc ghost = Ghost_InitAutoGhost(this, enemyId);
        
	//Update loop
        while(true)
        {
            Ghost_MoveTowardLink(4, 3);
            Ghost_Waitframe(this, ghost, true, true);
        }
    }
}

It seems to me this is an outside cause, that has little to do with the scripts I wrote. I think all libraries are fine too (like ghost.zh or std.zh) as they work perfect in another file.

 

So does anyone have a clue what could cause this, a quest related setting or such? I checked the rules already, they don't seem to be the cause.

 

Edit: When searching thoroughly through this thread, I found that this has to do with testing on a saved file in ZC (not Zquest). Oh well, problem fixed I suppose.


Edited by Twilight_Knight, 13 April 2016 - 12:17 PM.


#512 Mani Kanina

Mani Kanina

    Rabbits!

  • Moderators
  • Pronouns:She / Her
  • Location:The Moon

Posted 25 April 2016 - 02:22 PM

So I updated this script recently to the latest version, but I think that broke the Helmasaur script I had running. Is this the case or did I fuck up somewhere else?

#513 Saffith

Saffith

    IPv7 user

  • Members

Posted 25 April 2016 - 04:49 PM

I don't think it should've broken... It uses some internal variables, but I don't think any of them have changed. Other things still work?

#514 Mani Kanina

Mani Kanina

    Rabbits!

  • Moderators
  • Pronouns:She / Her
  • Location:The Moon

Posted 25 April 2016 - 04:58 PM

Hurm, now when I take a look around, no, other autoghosted enemies don't seem to work either. Shit, this is going to be hell to figure out where the issue is since I have spent the last day and a half implementing scripts.

#515 Saffith

Saffith

    IPv7 user

  • Members

Posted 25 April 2016 - 07:40 PM

If you updated from a version older than 2.7, the global script has changed. Otherwise, all I can think of is to start a new save, but you probably know about that already.

#516 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 30 April 2016 - 08:50 PM

Hello,

 

I'm trying to compile my first ghost script but I get the message.

 

"can't open imput file ghost.zh, line 134: error p01 : failure to parse imported file ghost_zh/scripts.z."

 

I don't know what to do.

 

I have ghost.zh and string.zh in the Zelda Classic folder.

The script itself has these at the top.

 

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



#517 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 30 April 2016 - 09:01 PM

Those kinds of errors happen when it can't find the file it's trying to import. File paths are relative to the base ZC directory (the one that contains zquest-w.exe), so make sure you have a folder named "ghost_zh" and that it contains all the files you need to import.

#518 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 30 April 2016 - 09:44 PM

I downloaded the ghost.zh file from the first page of this fourm. I compiled it and put it in my Zelda Classic folder. The folder is called "ghost_zh".

 

Inside that folder is another "ghost_zh" folder, an "AutoGhostReadme", "Ghost", "ghost.zh" and "ghost_legacy.zh".

 

Inside the "ghost_zh" folder is "2.8"

 

Inside the "2.8" folder is "common.zh", "deprecated.zh", drawing.zh", "eweapon.zh", "eweaponDeath.zh", "ewesponMovement.zh", "flags,zh", "golbal,zh", "init,zh", "modification.zh", "movement,zh", "other.zh", "scrips",  and "update,zh".

 

It still doesn't work. I figured ZQuest couldn't find this ghost file, but I simply don't know what else I need to do. You mention "zquest-w.exe", I couldn't find that anywhere in my Zelda Classic folder.

 

Do I need to have my actual script in a specific folder? I use to be able to compile it no matter where the script file was located. I tried to move my actual script file to different locations in my Zelda Classic folder, but it still doesn't work.

 

If you have any pictures/or videos explaining where to put my files, that would work better for me.



#519 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 30 April 2016 - 10:08 PM

Inside that folder is another "ghost_zh" folder, an "AutoGhostReadme", "Ghost", "ghost.zh" and "ghost_legacy.zh".


There's your problem. It is looking for all the files inside a folder named "ghost_zh", but you've got them inside another folder within that one. Here's the full list of files ghost.zh imports:

import "ghost_zh/common.zh"
import "ghost_zh/deprecated.zh"
import "ghost_zh/drawing.zh"
import "ghost_zh/eweapon.zh"
import "ghost_zh/eweaponDeath.zh"
import "ghost_zh/eweaponMovement.zh"
import "ghost_zh/flags.zh"
import "ghost_zh/global.zh"
import "ghost_zh/init.zh"
import "ghost_zh/modification.zh"
import "ghost_zh/movement.zh"
import "ghost_zh/other.zh"
import "ghost_zh/update.zh"

import "ghost_zh/scripts.z"
You need to move all of those so they're inside the first ghost_zh folder, since that's where it's looking for them. It won't find them if they're inside further subfolders. zquest-w.exe is the ZQuest executable and it's going to be in the same place as the Zelda Classic Launcher. Unless you moved around files on purpose, it's there.

#520 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 30 April 2016 - 11:09 PM

Let me show you a video of what I'm doing.

 

https://www.youtube....eature=youtu.be

 

Edit

 

I went back and changed my import "ghost.zh" to import "ghost_zh/ghost.zh" and it still doesn't work.


Edited by Yloh, 30 April 2016 - 11:21 PM.


#521 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 30 April 2016 - 11:27 PM

The file named ghost.zh needs to be in the base directory. That's the folder with ZQuest, ZC, 1st.qst, and all that. The other files that it imports are in that subfolder, and it looks like you've got them in the right place now.

Just to be clear, it doesn't matter where you place your main script file, import commands within that file will always start looking from the folder containing ZQuest.

Edited by Lejes, 30 April 2016 - 11:30 PM.


#522 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 30 April 2016 - 11:45 PM

I moved the file "ghost.zh" to the base directory and I get this error message.

 

"can't open input file ghost.zh, line 152: error p01 : failure to parse imported file ghost_zh/2.8/scripts.z."

 

I'm getting the feeling that I will never be able to figure this out.

 

Edit

 

Maybe I have the wrong ghost.zh file. I got it from the first page of this forum. 


Edited by Yloh, 30 April 2016 - 11:47 PM.


#523 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 01 May 2016 - 12:15 AM

Oh, I see. The new version shifted the directories around a bit. The files it's looking for are all supposed to be in ghost_zh/2.8 now, but the main ghost.zh file should still be placed in the main ZC folder.

#524 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 01 May 2016 - 01:40 AM

Hopefully this video can show you what I may be doing wrong.

 

https://www.youtube....h?v=o_Jy7ZuEEBE

 

"can't open input file ghost.zh, line 152: error p01 : failure to parse imported file ghost_zh/2.8/scripts.z."

 

The "AutoGhostReadme" says I need to extract both ghost.zh and the ghost_zh directory from the zip file and place them in Contents/Resources. Are ghost.zh and ghost_zh separate files? I know I have ghost_zh. ghost.zh is inside ghost_zh, but is that the wrong ghost.zh. Do I need to download a separate file just called ghost.zh? What am I missing?

 

"Extract ghost.zh and the ghost_zh directory from the zip file." "these should go in the same directory as ZC itself." I assume they are both in the same file I downloaded. As you can see from my video, both ghost_zh and ghost.zh are in the same directory as ZC itself. I'm really trying here and I feel really bad not having any success.


Edited by Yloh, 01 May 2016 - 02:13 AM.


#525 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 01 May 2016 - 02:20 AM

https://youtu.be/o_Jy7ZuEEBE?t=123

You've still got the double layered folder issue. You are putting the folder named "ghost_zh" inside of another folder, also named "ghost_zh", because the program you use to unpack the .zip file automatically creates a new directory with a name matching the .zip file. You need to delete that new folder off the file path when you unzip the file, so that the entire contents of the .zip are placed inside your base ZC folder.

Here is what the folder path should look like, with the contents of the ghost_zh folder.

Edited by Lejes, 01 May 2016 - 02:24 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users