Need help with script errors

roma000

New member
I have error VE220 in my script, what does this mean? And how do you fix it? On the trainz online wiki there is no about this problem. And with VE197 if you can please.
 
In trainz 12 no error but in 19 has.
There is code:


include "kzp_playerdata.gs"
include "kzp_admbrowser.gs"
include "kzp_vehiclesetbrowser.gs"
include "kzp_partsshopbrowser.gs"


class kzp_GuiHandler
{
public kzp_AdmBrowser qdBrowser = null;
public kzp_VehicleSettingsBrowser vsBrowser = null;
public kzp_PartsShopBrowser psBrowser = null;


public void openPartsShop(kzp_playerData main)
{
if (psBrowser)
{
psBrowser.mainBrowser = null;
}
if (!psBrowser)
{
psBrowser = new kzp_PartsShopBrowser() ;
psBrowser.Init(main);
psBrowser.DisplayBrowser("HELLOPAGE") ;
} ;
psBrowser.RestoreWindow();
psBrowser.RefreshDisplayHTML();
psBrowser.mainBrowser.SetWindowSize(800, 460);
psBrowser.SetBrowserVisible(true);
}

public void openAdminGUI(kzp_playerData main)
{
if (qdBrowser)
{
qdBrowser.mainBrowser = null;
}
if (!qdBrowser)
{
qdBrowser = new kzp_AdmBrowser() ;
qdBrowser.Init(main);
qdBrowser.DisplayBrowser("HELLOPAGE") ;
} ;
qdBrowser.RestoreWindow();
qdBrowser.RefreshDisplayHTML();
qdBrowser.mainBrowser.SetWindowSize(800, 460);
qdBrowser.SetBrowserVisible(true);
}

public void openVehicleGUI(kzp_playerData main, kzp_playerClass player)
{
if (vsBrowser)
{
vsBrowser.mainBrowser = null;
}
if (!vsBrowser)
{
vsBrowser = new kzp_VehicleSettingsBrowser();
vsBrowser.Init(main, player);
vsBrowser.DisplayBrowser("HELLOPAGE") ;
} ;
vsBrowser.RestoreWindow();
vsBrowser.RefreshDisplayHTML();
vsBrowser.mainBrowser.SetWindowSize(800, 460);
vsBrowser.SetBrowserVisible(true);
}
};
 
VE220: kzp_playerdata.gs(2120) : Class Library and Library causes cyclic derivation, line 2120.

And VE220 what causes... at 2120 is normal this is end with };
 
you use } ; often
should maybe be on the last line only, as it ends the script

check in
kzp_playerdata.gs, if you include kzp_GuiHandler by accident
then there is a cycle
 
Last edited:
edited in my own compact style, can't test cause then you need all parts

include "kzp_playerdata.gs" include "kzp_admbrowser.gs"
include "kzp_vehiclesetbrowser.gs" include "kzp_partsshopbrowser.gs"


class kzp_GuiHandler {
public kzp_AdmBrowser qdBrowser = null;
public kzp_VehicleSettingsBrowser vsBrowser = null;
public kzp_PartsShopBrowser psBrowser = null;


public void openPartsShop(kzp_playerData main) {
if (psBrowser) {psBrowser.mainBrowser = null;}
if (!psBrowser) {
psBrowser = new kzp_PartsShopBrowser();
psBrowser.Init(main);
psBrowser.DisplayBrowser("HELLOPAGE");
}
psBrowser.RestoreWindow();
psBrowser.RefreshDisplayHTML();
psBrowser.mainBrowser.SetWindowSize(800, 460);
psBrowser.SetBrowserVisible(true);
}


public void openAdminGUI(kzp_playerData main) {
if (qdBrowser) {qdBrowser.mainBrowser = null;}
if (!qdBrowser) {
qdBrowser = new kzp_AdmBrowser();
qdBrowser.Init(main);
qdBrowser.DisplayBrowser("HELLOPAGE");
}
qdBrowser.RestoreWindow();
qdBrowser.RefreshDisplayHTML();
qdBrowser.mainBrowser.SetWindowSize(800, 460);
qdBrowser.SetBrowserVisible(true);
}


public void openVehicleGUI(kzp_playerData main, kzp_playerClass player) {
if (vsBrowser) {vsBrowser.mainBrowser = null;}
if (!vsBrowser) {
vsBrowser = new kzp_VehicleSettingsBrowser();
vsBrowser.Init(main, player);
vsBrowser.DisplayBrowser("HELLOPAGE");
}
vsBrowser.RestoreWindow();
vsBrowser.RefreshDisplayHTML();
vsBrowser.mainBrowser.SetWindowSize(800, 460);
vsBrowser.SetBrowserVisible(true);
}
};
 
Back
Top