Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-01-2008, 11:30 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
Need help with weird Bug...

Hi,

so after some Bugs that I could pass by with VarHandles(e.g. not being able to set temp. vars, or maybe this. vars too ), and some others I reached something unfixable for me, atleast I tried many things

If i comments out the for with /* */ it works, If i don't comments it out the Array will be Echoes as "0", for some reason even before the for...

PHP Code:
function onCreated()
  {
  
TestC null;
  
TestC = new TStaticVar();
  
TestC.mainHandle this;
  
TestC.testArr = { { 1}, { 2}, { 3} };
  
TestC.testingFunc1 = function()
    {
    
TestP.testingFunc2TestC.testArr );
    };
  
TestP null;
  
TestP = new TStaticVar();
  
TestP.testingFunc2 = function( testArr )
    {
    
TestC.mainHandle.trigger"EchoR""arrive:" testArr );
    
VarHandle null;
    for( 
VarHandle.ty 0VarHandle.ty 5VarHandle.ty++ )
      {
      
TestC.mainHandle.trigger"EchoR""pre " VarHandle.ty " : " testArr );
      
//VarHandle.ttempp = testArr[ VarHandle.ty ]; Doesnt even work without this...
      
TestC.mainHandle.trigger"EchoR""post " VarHandle.ty " : " testArr );
      }  
    
TestC.mainHandle.trigger"EchoR", { testArr } );
    };
  
TestC.testingFunc1();
  }

function 
onEchoR()
  {
  echo( 
params] );
  } 
__________________
Reply With Quote
  #2  
Old 01-01-2008, 03:26 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
TestC.mainHandle.trigger"EchoR""pre " VarHandle.ty " : " testArr ); 
Hmm, shouldn't 'testArr' be 'TestC.testArr'?

NVM: If you change it to TestC.testArr you get output, but I see that it doesn't recieve the params, right?

Edit2: Ok, that's the wierdest thing I've seen for a long time:

PHP Code:
function onCreated() {
  
TestC null;
  
TestC = new TStaticVar();
  
TestC.mainHandle this;
  
TestC.testArr = { { 1}, { 2}, { 3} };
  
  
TestC.testingFunc1 = function() {
    
temp.arr TestC.testArr;
    
TestC.mainHandle.trigger"EchoR""arr: "arr " - type: " arr.type());
    
TestP.testingFunc2(arr);
  };
  
TestP.testingFunc2 = function(arr2) {
    
TestC.mainHandle.trigger("EchoR""arr2: "arr2 " - type2: " arr2.type());
    
    
TestC.mainHandle.trigger("EchoR""arrive:" arr2);
    
    
//TestC.mainHandle.trigger("EchoR", "pre: " @ arr2); 
    
    
TestC.mainHandle.trigger("EchoR", {arr2});
  };
  
TestC.testingFunc1();
}
function 
onEchoR(str) {
  echo(
str);

That works, but, if you remove the '//' in the scirpt, it won't!
__________________

Last edited by Chompy; 01-01-2008 at 03:48 PM..
Reply With Quote
  #3  
Old 01-01-2008, 05:15 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Weird error...
__________________
Reply With Quote
  #4  
Old 01-01-2008, 05:21 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
The funny thing is that when i tried that at clientside the variable got stuck, so even if i commented out the line, the variable kept being 0, even after restarting graal and for next test i had to use another varname xD
__________________
Reply With Quote
  #5  
Old 01-02-2008, 12:46 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Hmmm there seems to be an optimization problem with inline-functions, the temp variable is removed / moved outside the inline-function.
Reply With Quote
  #6  
Old 01-02-2008, 06:33 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
Quote:
Originally Posted by Stefan View Post
Hmmm there seems to be an optimization problem with inline-functions, the temp variable is removed / moved outside the inline-function.
uh, well can you fix it in next version or something?
__________________
Reply With Quote
  #7  
Old 01-02-2008, 08:22 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Ok uploaded a new npcserver version.
Reply With Quote
  #8  
Old 01-02-2008, 08:38 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
Quote:
Originally Posted by Stefan View Post
Ok uploaded a new npcserver version.
well i dont know if that fixes the problem clientsided, since it seems to happen there too xD
__________________
Reply With Quote
Reply


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 11:40 AM.


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