Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-30-2006, 07:58 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
returning objects

PHP Code:
//#CLIENTSIDE
function onCreated()
  {
  echo(
"ll3");
  
this.counter 0;
  }
public function 
adminMsgamsg )
  {
  echo(
"ll4");
  
this.amsg amsg.tokenize("\b");
  
this.awindow _createWindowthis.amsg.size() );
  echo(
"l2: " this.awindow.text);
  
this.awindow.visible true;
  
GUIContainer.addControlthis.awindow );
  }
function 
_createWindowalines )
  {
  
this.windowname "AdminMsg_Window_" this.counter;
  
this.alines alines;
  ( @ 
this.windowname ) = new GuiWindowCtrl();
  
with( ( @ this.windowname ) )
    {
    
visible false;
    
profile "GuiBlueWindowProfile";
    
width 300;
    
height thiso.alines 16 25;
    
screenwidth width 2;
    
screenheight height 2;
    
canClose true;
    
onclosequery=true;
    
thiso.catcheventthis"onCloseQuery""onCloseWindow" );
    
canMinimize canResize canMaximize false;
    
text "Admin Message";
    
canMove true;
    }
  
this.counter++;
  echo( 
"l: " this.windowname );
  echo( 
"l1" @ ( @ this.windowname ).text );
  return ( ( @ 
this.windowname ) );
  }
function 
onCloseWindow()
  {
  
player.chat params[0].text;
  } 
it should return the window object but for some reason it doesnt o.o
output:
Quote:
ll3
ll4
l: AdminMsg_Window_0
l1Admin Message
l2:
Reply With Quote
  #2  
Old 10-05-2006, 01:46 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
well inside
PHP Code:
with( ( @ this.windowname ) )
    { 
you are using an variable that I can't see you have setted
thiso.alines, I only see this.alines, well, thats only for the height
and for ----v
PHP Code:
( @ this.windowname ) = new GuiWindowCtrl(); 
you could just use
PHP Code:
this.windowname = new GuiWindowCtrl(); 


and:
PHP Code:
this.awindow _createWindowthis.amsg.size() );
echo(
"l2: " this.awindow.text); 
why do this.awindow.text after?
this.awindow is just "AdminMsg_Window_0"
like text, not like an object

and correct me if I am wrong
__________________
Reply With Quote
  #3  
Old 10-05-2006, 02:43 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
[QUOTE=Chompy;1226271]well inside
PHP Code:
with( ( @ this.windowname ) )
    { 
you are using an variable that I can't see you have setted
thiso.alines, I only see this.alines, well, thats only for the height
and for ----v
PHP Code:
( @ this.windowname ) = new GuiWindowCtrl(); 
you could just use
PHP Code:
this.windowname = new GuiWindowCtrl(); 


and:
PHP Code:
this.awindow _createWindowthis.amsg.size() );
echo(
"l2: " this.awindow.text); 
why do this.awindow.text after?
this.awindow is just "AdminMsg_Window_0"
like text, not like an object
Quote:
and correct me if I am wrong
k i will

first
Quote:
PHP Code:
with( ( @ this.windowname ) )
    { 
you are using an variable that I can't see you have setted
thiso.alines, I only see this.alines, well, thats only for the height
if you would use this.alines within a with it would refer to the object thats it in now, that would be e.g. AdminMsg_Window_0.alines
but thiso is for global access afaik you can use thiso.alines after you have set this.alines

Quote:
PHP Code:
( @ this.windowname ) = new GuiWindowCtrl(); 
you could just use
PHP Code:
this.windowname = new GuiWindowCtrl(); 
this would set this.windowname to the newly created GuiWindowCtrl
but e.g.
this.windowname = "bleh";
this.( @ windowname ) = new GuiWindowCtrl();
wouldt set the variable this.bleh to a new GuiWindowCtrl

:P well i fixed some things and now it works lol
Reply With Quote
  #4  
Old 10-05-2006, 02:47 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
__________________
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 10:28 AM.


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