Jump to content

Photo

Help with Newbie Boss Script


  • Please log in to reply
7 replies to this topic

#1 Octorockoncrack

Octorockoncrack

    Crystal Warrior

  • Members
  • Real Name:Tyler
  • Location:walking The Path

Posted 12 April 2018 - 03:59 PM

Ive been fiddling around with this for a couple hours now.

 

Im trying to import the Newbie Boss script into my quest, but its conflicting with the Pegasus Boots script that I also got from the database.

 

The Boots script has this note in it:

 

"If you have an existing global script, just add ScrollFix(); the top of the while loop and PegasusBoots(); below that, but before the Waitdraw(); and Waitframe(); . And remove, or comment this global script out."

 

So my global script is set up like this:

import "std.zh"     // only need this once
import "ghost.zh"
import "laser.zh"
import "ffcscript.zh"
import "DialogueBox.zh"

global script GhostZHActiveScript
{
    void run()
    {
        StartGhostZH();
        Scrollfix();
        PegasusBoots();
        
        while(true)
        {
            UpdateGhostZH1();
            Waitdraw();
            UpdateGhostZH2();
            Waitframe();
        }
    }
}

When I try to add this into ZQ, I end up getting this error:

 

TMP, Line 7, Error S06: Duplicate script with name GhostZHActiveScript already exists.

 

The top line of the global script is the only time that "GhostZHActiveScript" appears in my script file, so I have no idea whats going on. Instructions say its a simple change, but after a few hours, it appears to be anything but that.


Edited by Octorockoncrack, 12 April 2018 - 05:15 PM.


#2 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 12 April 2018 - 05:48 PM

Rename your global script in the main file here.



#3 Octorockoncrack

Octorockoncrack

    Crystal Warrior

  • Members
  • Real Name:Tyler
  • Location:walking The Path

Posted 12 April 2018 - 06:02 PM

I had tried that before, but I did it again just to double check.

 

Now I am getting multiple errors for init.zh and global.zh . The errors are telling me that functions Printif and atoi are undeclared

 

Update: I attempted to use Moosh's global script combine tool, but I still get the same errors about the Printif and Atoi functions being undeclared in init.zh and global.zh


Edited by Octorockoncrack, 12 April 2018 - 06:27 PM.


#4 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 12 April 2018 - 06:51 PM

Okay, so a couple of problems here.

First off, ghost.zh requires string.zh. It's included with ZC, but you still have to import it. The second big problem is that Scrollfix() and PegasusBoots() are both in the wrong place. They need to be BELOW the while(true){ line. If you care to know why, here's the quick explanation:

The way a global script works, it starts when the quest is loaded, runs any functions before the while(true) line once, then, every frame, runs every function inside the while(true) loop. So anything you want to happen every frame needs to go inside that loop. Waitdraw() is a special marker. Anything that happens before that will get drawn to the screen that frame (drawing, and that just means ZC rendering EVERYTHING, combos, sprites, etc) happens during Waitdraw().

Since, presumably, you want Scrollfix() and PegasusBoots() running every frame, and you do want them drawing when they're running, you need to move them down into the loop, but before Waitdraw(). So doing that, renaming the global like you already did, and adding string.zh, the script file should look like this:
 
import "std.zh"     // only need this once
import "string.zh"
import "ghost.zh"
import "laser.zh"
import "ffcscript.zh"
import "DialogueBox.zh"

global script slot2
{
    void run()
    {
        StartGhostZH();
        
        while(true)
        {
		Scrollfix();
		PegasusBoots();
		UpdateGhostZH1();
		Waitdraw();
		UpdateGhostZH2();
		Waitframe();
        }
    }
}


#5 Octorockoncrack

Octorockoncrack

    Crystal Warrior

  • Members
  • Real Name:Tyler
  • Location:walking The Path

Posted 12 April 2018 - 07:16 PM

Okay, I followed what you said, but im getting one more error saying that Scrollfix(); is undeclared. Is there another file that Im forgetting to import, like the string.zh?

 

And by the way, that makes a lot more sense to me when its broken down like that. Thanks for taking the time to explain it to me! 



#6 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 12 April 2018 - 09:54 PM

Did you also import the pegasus boots script or have it in the same file as the global script? If neither, that could be the issue.


Edited by Dimentio, 12 April 2018 - 09:54 PM.


#7 Octorockoncrack

Octorockoncrack

    Crystal Warrior

  • Members
  • Real Name:Tyler
  • Location:walking The Path

Posted 13 April 2018 - 10:37 AM

If by that, youre asking if I already have the code for the boots in my .z file, then yes. 

 

I can also clearly see the function for Scrollfix(); so Im not sure why Im getting this issue. Does the Scrollfix(); need to be at the top of the script?

 

Since the error doesnt seem to just be in the global script anymore, heres a link to the script file I am using::

https://drive.google...EwNee2FL4ykhLK4



#8 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 13 April 2018 - 11:12 AM

The F isn't capitalized in your global.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users