Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-09-2008, 02:14 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Class joining bug/undocumented feature

This is the code I am executing:

-whitedragon_system
PHP Code:
new TStaticVar("Movement").join("whitedragon_system_movement");
new 
Movement("NormalMovement").join("whitedragon_system_movement_normal");
this.movement = new NormalMovement().construct(); 
whitedragon_system_movement
PHP Code:
public function construct() {
  echo(
"----------");
  echo(
this.joinedclasses);
  echo(
this.getfunctions());
  for(
this.getfunctions())
    echo(
f SPC f.scope);
  echo(
"----------");
  return 
this;

whitedragon_system_movement_normal
PHP Code:
public function construct() {
  echo(
"movement_normal");
  return 
this;

The code that you see in whitedragon_system_movement is some debugging code to see exactly what functions exist and what is getting over written.

I get the following output:
PHP Code:
----------
whitedragon_system_movement,"",whitedragon_system_movement_normal
loadstring
,geteditvarnames,insertarray,subarray2,addnamedstring,savexmltostring,ignoreevents,loadvarsfromarray,loadini,getdynamicvarnames,savevars,sortdescending,loadvars,loadxml,savelines,cancelevents,getfunctions,copyfrom,getstaticvarnames,sortbyvalue,getvarnames,hasfunction,clearemptyvars,timershow,addarray,leave,loadxmlfromstring,scheduleevent,loadlines,objecttype,settimer,savestring,ignoreevent,loadfolder,addarraymember,destroy,savevarstoarray,join,catchevent,sortascending,getarraymember,trigger,isinclass,savexml,clearvars,construct,construct
loadstring 
public
geteditvarnames public
insertarray public
subarray2 public
addnamedstring public
savexmltostring public
ignoreevents public
loadvarsfromarray public
loadini public
getdynamicvarnames public
savevars public
sortdescending public
loadvars public
loadxml public
savelines public
cancelevents public
getfunctions public
copyfrom public
getstaticvarnames public
sortbyvalue public
getvarnames public
hasfunction public
clearemptyvars public
timershow public
addarray public
leave public
loadxmlfromstring public
scheduleevent public
loadlines public
objecttype public
settimer public
savestring public
ignoreevent public
loadfolder public
addarraymember public
destroy public
savevarstoarray public
join public
catchevent public
sortascending public
getarraymember public
trigger public
isinclass public
savexml public
clearvars public
construct public 
That's handful, so I'll sum it up for you:
  • echo(this.getfunctions()) echos "construct" twice.
  • The loop echos "construct" once.
  • It doesn't finish the block of code (there are no ending dashes echoed).


This behavior is getting so weird, I had no idea what was going on.
Even speculation would be helpful.

Thank you.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.