Jump to content

Photo

Help Combining Two Global Scripts


  • Please log in to reply
7 replies to this topic

#1 Mibbitable

Mibbitable

    Junior

  • Members

Posted 28 October 2017 - 04:52 PM

Hello, I need help with this. I have no idea how to do this because they are both to be set to active.

import "std.zh"

const int CR_HP_DISPLAY = 7;//set current life mirror to script 1, can be modified if needed
const int CR_MAX_HP_DISPLAY = 8;//Set max life mirror counter to script 2, can be modified if needed
const int CR_MP_DISPLAY = 9;//set current magic mirror to script 3, can be modified if needed
const int CR_MAX_MP_DISPLAY = 10;//set current magic max mirror counter to script 4, can be modified if needed

//create 4 counters on passive subscreen using script 1, 2, 3, and 4 (or chosen slots) where desired

global script Active
{
   void run()
   {
      while(true)
      {
//section may also contain other global script stuff as normal
         UpdateDisplayCounters();
         Waitdraw();
         Waitframe();
      }
   }
}

void UpdateDisplayCounters()
{
     Game->Counter[CR_HP_DISPLAY] = Link->HP;
     Game->Counter[CR_MAX_HP_DISPLAY] = Link->MaxHP;
     Game->Counter[CR_MP_DISPLAY] = Link->MP;
     Game->Counter[CR_MAX_MP_DISPLAY] = Link->MaxMP;
}

And then this one

 

https://www.purezc.n...exp#entry981729

 

(very top post)

 

Please help me!!!!!  :gonk:



#2 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 28 October 2017 - 05:04 PM

https://www.purezc.n...opic=72983&st=0

 

;o



#3 Mibbitable

Mibbitable

    Junior

  • Members

Posted 28 October 2017 - 06:13 PM

It seems to have not worked for me.



#4 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 29 October 2017 - 09:04 AM

global script active{
    void run(){
    Game->MCounter[CR_LEVEL] = 20;
Game->MCounter[CR_XP] = 211500;
    Game->Counter[CR_STAT_BODY] = 10;
Game->MCounter[CR_STAT_BODY] = 100;
    Game->Counter[CR_STAT_MUSC] = 10;
Game->MCounter[CR_STAT_MUSC] = 100;
    Game->Counter[CR_STAT_MIND] = 10;
Game->MCounter[CR_STAT_MIND] = 100;
    Game->Counter[CR_STAT_MYST] = 10;
Game->MCounter[CR_STAT_MYST] = 100;   
    Game->Counter[CR_STAT_INFL] = 10;
Game->MCounter[CR_STAT_INFL] = 100;   
    Game->Counter[CR_STAT_LUCK] = 10;
Game->MCounter[CR_STAT_LUCK] = 100;
   
    while (true) {
        Game->Counter[CR_HP] = Link->HP;
        Game->Counter[CR_MP] = Link->MP;
        Game->Counter[CR_HP_MAX] = Link->MaxHP;
        Game->Counter[CR_MP_MAX] = Link->MaxMP;
       
        if ( Game->Counter[CR_XP] > 9999 && Game->Counter[CR_XP_10K] > 98 ) {
        Game->MCounter[CR_XP] = 9999;
        }
       
        if ( Game->Counter[CR_XP] > 9999 && Game->Counter[CR_XP_10K] > 98 && Game->Counter[CR_XP] > 9999 ) {
        Game->Counter[CR_XP] = 9999 ;
        }
       
        //UpdateEWeapons();
        //CleanUpGhostFFCs(); // Only needed if __GH_USE_DRAWCOMBO is 0
        //UpdateLWeapons();
        //UpdateLastItem();
        //if (Link->PressB) {LastItemUsed = GetEquipmentB();}
        //if (Link->PressA) {LastItemUsed = GetEquipmentA();}
 
UpdateDisplayCounters();

        Waitdraw();
        XP();
        //AutoGhost();
        //DrawGhostFFCs();
        //lastScreen = Game->GetCurDMapScreen(); //Update last screen/DMap
        //lastDMap = Game->GetCurDMap();
        Waitframe();
        }
    }
}

These are the 2 active globals combined. What exactly is your problem though?

 

I think the XP system script looks needlessly complicated to me.


Edited by Avataro, 29 October 2017 - 09:04 AM.


#5 Mibbitable

Mibbitable

    Junior

  • Members

Posted 29 October 2017 - 02:37 PM

Now they both work as 1? Like, just how they would separated? And I guess I just didn't do it right somehow.


PASS 1: PARSING

LINE 27: SYNTAX ERROR, UNEXPECTED IMPORT, ON TOKEN IMPORT

FATAL ERROR P00: CAN'T OPEN OR PARSE INPUT FILE!

 

That's what happened when I tried to compile it.


Edited by Mibbitable, 29 October 2017 - 02:33 PM.


#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 29 October 2017 - 08:03 PM

global script active{
    void run(){
    Game->MCounter[CR_LEVEL] = 20;
Game->MCounter[CR_XP] = 211500;
    Game->Counter[CR_STAT_BODY] = 10;
Game->MCounter[CR_STAT_BODY] = 100;
    Game->Counter[CR_STAT_MUSC] = 10;
Game->MCounter[CR_STAT_MUSC] = 100;
    Game->Counter[CR_STAT_MIND] = 10;
Game->MCounter[CR_STAT_MIND] = 100;
    Game->Counter[CR_STAT_MYST] = 10;
Game->MCounter[CR_STAT_MYST] = 100;   
    Game->Counter[CR_STAT_INFL] = 10;
Game->MCounter[CR_STAT_INFL] = 100;   
    Game->Counter[CR_STAT_LUCK] = 10;
Game->MCounter[CR_STAT_LUCK] = 100;
   
    while (true) {
        Game->Counter[CR_HP] = Link->HP;
        Game->Counter[CR_MP] = Link->MP;
        Game->Counter[CR_HP_MAX] = Link->MaxHP;
        Game->Counter[CR_MP_MAX] = Link->MaxMP;
       
        if ( Game->Counter[CR_XP] > 9999 && Game->Counter[CR_XP_10K] > 98 ) {
        Game->MCounter[CR_XP] = 9999;
        }
       
        if ( Game->Counter[CR_XP] > 9999 && Game->Counter[CR_XP_10K] > 98 && Game->Counter[CR_XP] > 9999 ) {
        Game->Counter[CR_XP] = 9999 ;
        }
       
        //UpdateEWeapons();
        //CleanUpGhostFFCs(); // Only needed if __GH_USE_DRAWCOMBO is 0
        //UpdateLWeapons();
        //UpdateLastItem();
        //if (Link->PressB) {LastItemUsed = GetEquipmentB();}
        //if (Link->PressA) {LastItemUsed = GetEquipmentA();}
 
UpdateDisplayCounters();

        Waitdraw();
        XP();
        //AutoGhost();
        //DrawGhostFFCs();
        //lastScreen = Game->GetCurDMapScreen(); //Update last screen/DMap
        //lastDMap = Game->GetCurDMap();
        Waitframe();
        }
    }
}
These are the 2 active globals combined. What exactly is your problem though?
 
I think the XP system script looks needlessly complicated to me.

People are still using this?!

I know that I have posted updates that are far cleaner. In fact, if this is what you want, you would be better-off taking the script directly from LoE. It already does both things, and it has the subscreen set up for the XP and other counters.

The active script setting the stats was for debug purposes. That is something that you will want to remove.

#7 Mibbitable

Mibbitable

    Junior

  • Members

Posted 05 November 2017 - 07:33 PM

So if I take it from that, would it be easy to find those two scripts? Because that is all I need. Or if you would like to help, could you send me them? I would much appreciate, cause I wouldn't even know where to begin looking. 



#8 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 09 November 2017 - 04:10 AM

So if I take it from that, would it be easy to find those two scripts? Because that is all I need. Or if you would like to help, could you send me them? I would much appreciate, cause I wouldn't even know where to begin looking.

https://github.com/ZoriaRPG/RPG_zh

This is the modern version of the code. (Use 'master', as the other builds are experimental.

You will likely find far more here, than you either want, or need for your objective. Once I have my laptop back in working order, I might extract the key comonents for you. I put RPG.zh on ice, until I have 2.54 done, as I will be migrating it to require 2.54 features.

At present, I'm treading water, on micro-devices.

Edited by ZoriaRPG, 09 November 2017 - 04:14 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users