Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-27-2011, 05:34 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
gui lister

Hey guys, i tried around with the GuiPopUpMenuCtrl(" ") and got two questions. First:

I placed the following into a NPC:
PHP Code:
function onCreated() {
  
this.join("test1");
}
//#CLIENTSIDE
function onCreated() {
  
this.bla1 "bla";
  
this.bla2 "bla";

and this is a part of the class "test1":
PHP Code:
new GuiPopUpMenuCtrl("test1_List") {
  
width 130;
  
height 20;
  
10;
  
77;
  
cleararrows();   
  
addrow(0,this.bla1);
  
addrow(1,this.bla2);
  
sort();
  
setSelectedRow(0);

So when I make it that way, it won´t say the this.bla1 or this.bla2. How could I make it that it will say that?

Seccond question:
I figured out, how to make it listing the player.weapons.
PHP Code:
for (temp.weapon player.weapons) {
        if (! 
weapon.name.starts("-")) {
          
addRow(0weapon.name);
        }
      } 
But how could I make it list like when I got a flag called:
clientr.test = 1,2,3,4
That it will list the clientr.test?
Reply With Quote
  #2  
Old 02-27-2011, 07:18 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Well "this.bla1" won't work because this. will be referring to the test1_List, so you have to use thiso instead.

Quote:
Originally Posted by fowlplay4 View Post
No, only in the sections where you try to set GUI text to "this." values.

Reason: this. when used in the scope of another object refers to that object, so you have to get the values from the origin "thiso." object.

If you look at the output you'll see what's going on.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.example "Hello World!";
  new 
GuiWindowCtrl("Example") {
    
0;
    
0;
    
width height 200;

    
// Check F2 Logs for Output
    
echo("this.name: " this.name " this.example: " this.example);
    echo(
"thiso.name: " thiso.name " thiso.example: " thiso.example);

    
text thiso.example;
  }

If clientr.test is how you say it is, than it is an array and you can easily use a for each loop like this...

PHP Code:
clientr.test = {1234};
for (
temp.valueclientr.test) {
  echo(
temp.value); // echos: 1, 2, 3, 4

A quick guide for arrays: http://forums.graalonline.com/forums...21&postcount=4
__________________
Quote:
Reply With Quote
  #3  
Old 02-27-2011, 01:15 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Thx man I´ll try it out
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:28 PM.


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