Jump to content

Photo

multiple global scripts?

global scripts

  • Please log in to reply
4 replies to this topic

#1 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 21 September 2016 - 05:59 PM

does any body know the easiest way to combine multiple global scripts?

 

I have both a gb style power bracelet and gb style chests but they both seem to use global script slots.

I'm trying to put together a gameboy template for me to use, but scripts alway error out because there can only be one global script at a time.



#2 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 21 September 2016 - 08:30 PM

EDIT: I missed the part about global scripts. Read judasrising's answer, or this one, instead.

 

You need to import them all in one file.

 

Here's the easiest way to do that: Make a new master script file, and put import statements pointing to all of the scripts you're using. Then import that master file and compile it.

 

Example:

import "std.zh"
 
import "scripts/powerBracelet.z"
import "scripts/gbChest.z"

(Substituting your own actual filenames)


Edited by MoscowModder, 29 September 2016 - 05:14 PM.


#3 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 21 September 2016 - 10:01 PM

so there can be multiple global script declarations as long as they all get compiled at the same time?



#4 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 22 September 2016 - 06:09 AM

so there can be multiple global script declarations as long as they all get compiled at the same time?

and the global part could look like this.

 

global script Slot_2{
    void run(){
        holding_block = 0;
        StartGhostZH();
        Tango_Start();
        //Setup_IceCombos(); //Setup variables for ice combos.
        //int oldscreen = Game->GetCurScreen(); //Variable that stores Game->GetCurScreen() the previous frame.
        while(true){
            StepSound();
            deathAnimations();
            Shovel();
            PowerBracelet();
            Tango_Update1();
            if ( SHOP_DARK_WHEN_CLOSED ) FFC_ShopDarkness(); //Manages shop darkness.
            UpdateGhostZH1();
            
            //int cmb;
            //lweapon lw;
            //if(Screen->NumLWeapons() > 0){
                //for(int i=1; i<=Screen->NumLWeapons(); i++){
                    //lw = Screen->LoadLWeapon(i);
                    //if (lw->ID == 20){
                        //cmb = ComboAt(lw->X, lw->Y);
                        //if (Screen->ComboT[cmb] == 42 && (Screen->ComboF[cmb] == 100 || Screen->ComboI[cmb] == 100)){
                            //Screen->ComboD[cmb] += 1;
                        //}
                        //break;
                    //}
                //}
            //}
            
            Waitdraw();
            //Update_IceCombos(oldscreen);
            //oldscreen = Game->GetCurScreen();
            Tango_Update2();
            UpdateGhostZH2();
            Waitframe();
            ScreenChange_Update();
      Pot_Script();
        }
    }
}



#5 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 18 October 2016 - 03:32 PM

judasrising

do you why my these two scripts are not compiling?

Spoiler
Spoiler

Edited by Shadowblitz16, 18 October 2016 - 03:32 PM.




Also tagged with one or more of these keywords: global, scripts

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users