Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-31-2008, 12:20 PM
Pimmeh Pimmeh is offline
Rgesitreed Uesr
Pimmeh's Avatar
Join Date: May 2007
Location: Utrecht, the Netherlands
Posts: 1,586
Pimmeh has a spectacular aura about
Send a message via AIM to Pimmeh Send a message via MSN to Pimmeh
function onActionRConline ()

Why isnt this command in existance?
I always wanted an RC startup message seperated from the player one!
Can someone tell me a way how to do this?
__________________
Oh, Death,
No wealth, no ruin, no silver, no gold
Nothing satisfies me but your soul
Reply With Quote
  #2  
Old 03-31-2008, 02:47 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Check if the player.level.name is NULL when somebody logs on (do that serverside, in the Control-NPC or w/e). If thats the case, its an RC.
Reply With Quote
  #3  
Old 03-31-2008, 06:06 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
onActionPlayerOnline doesn't work for RCs I am fairly certain--you'd have to make a loop
__________________
Reply With Quote
  #4  
Old 03-31-2008, 07:14 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Hm, not sure. It's done on Era somehow, but I'm too lazy to check right now D:
Reply With Quote
  #5  
Old 03-31-2008, 07:35 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Crow View Post
Hm, not sure. It's done on Era somehow, but I'm too lazy to check right now D:
It's a 1-3 second loop in a DBNPC that checks allplayers

PHP Code:
function onCreated() {
  
onTimeout();
}

function 
onTimeout() {
  for (
temp.playerallplayers) {
    if (
temp.player.head != "tig-rchead2.png" && temp.player.level.name == NULL) {
      
temp.player.head "tig-rchead2.png";
      
this.onRCLogin(temp.player.link());
    }
  }
  
setTimer(2);
}

function 
onRCLogin(pl) {
  
pl.sendpm("Hello new RC.");

__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #6  
Old 03-31-2008, 07:48 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Tigairius View Post
It's a 1-3 second loop in a DBNPC that checks allplayers

PHP Code:
function onCreated() {
  
onTimeout();
}

function 
onTimeout() {
  for (
temp.playerallplayers) {
    if (
temp.player.head != "tig-rchead2.png" && temp.player.level.name == NULL) {
      
temp.player.head "tig-rchead2.png";
      
this.onRCLogin(temp.player.link());
    }
  }
  
setTimer(2);
}

function 
onRCLogin(pl) {
  
pl.sendpm("Hello new RC.");

Ah ;D
Reply With Quote
  #7  
Old 04-01-2008, 12:18 AM
Rapidwolve24 Rapidwolve24 is offline
North*
Join Date: Oct 2007
Location: Massachusetts
Posts: 178
Rapidwolve24 is on a distinguished road
Send a message via AIM to Rapidwolve24 Send a message via MSN to Rapidwolve24
Quote:
Originally Posted by Tigairius View Post
It's a 1-3 second loop in a DBNPC that checks allplayers

PHP Code:
function onCreated() {
  
onTimeout();
}

function 
onTimeout() {
  for (
temp.playerallplayers) {
    if (
temp.player.head != "tig-rchead2.png" && temp.player.level.name == NULL) {
      
temp.player.head "tig-rchead2.png";
      
this.onRCLogin(temp.player.link());
    }
  }
  
setTimer(2);
}

function 
onRCLogin(pl) {
  
pl.sendpm("Hello new RC.");

What the hell is link()?
Reply With Quote
  #8  
Old 04-01-2008, 12:33 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Rapidwolve24 View Post
What the hell is link()?
object.link() - It's basically the account name.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #9  
Old 04-01-2008, 01:30 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Tigairius View Post
object.link() - It's basically the account name.
Good guess, it actually makes a pointer to a variable, i.e., linking two variables to the same address.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #10  
Old 04-01-2008, 01:39 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Tolnaftate2004 View Post
Good guess, it actually makes a pointer to a variable, i.e., linking two variables to the same address.
Thanks.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #11  
Old 04-01-2008, 02:13 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
variable.link() does nothing except returning the variable's value.

Instead of sending temp.player.link() you would just send temp.player as that is an object. And object variables are pointers.
__________________
Reply With Quote
  #12  
Old 04-01-2008, 09:43 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Inverness View Post
variable.link() does nothing except returning the variable's value..
Internally speaking, obj.link() returns a pointer which is referenced later instead of being sent through the callstack as a plain value. It doesn't have a great amount of use in GScript, but it doesn't just return the variable's value.
Reply With Quote
  #13  
Old 04-01-2008, 11:01 AM
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
obj.link() can be used to pass huge arrays to functions without copying the array (by default it's copying the variable except it's already a link to an object). Also the called function can modify the original array that way.
Reply With Quote
  #14  
Old 04-01-2008, 01:00 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Ugh, I'd really like it if you would DOCUMENT these things -.-
__________________
Reply With Quote
  #15  
Old 04-01-2008, 02:01 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
I've already told you this one year ago http://forums.graalonline.com/forums...ad.php?t=71633
Reply With Quote
  #16  
Old 04-01-2008, 04:02 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
I'm all for a super leet wiki entry called "Uber Rox0r functions people dont know **** about" that lists stuff like that ;D
Reply With Quote
  #17  
Old 04-01-2008, 11:08 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
Quote:
Originally Posted by Stefan View Post
I've already told you this one year ago http://forums.graalonline.com/forums...ad.php?t=71633
LOL
__________________
Reply With Quote
  #18  
Old 04-02-2008, 12:13 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Stefan View Post
I've already told you this one year ago http://forums.graalonline.com/forums...ad.php?t=71633
I don't think I understood quite what you meant at the time , so I forgot.

But I would still like it if you documented this stuff

Was wondering why it is only working with arrays and not strings or numbers? I've just realized how this could be very useful but don't want to wrap data in an array.

And after thinking about it a bit more I'm wondering if you could let it be used anywhere even outside of functions?
__________________
Reply With Quote
  #19  
Old 04-02-2008, 02:12 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Inverness View Post
I don't think I understood quite what you meant at the time , so I forgot.

But I would still like it if you documented this stuff

Was wondering why it is only working with arrays and not strings or numbers? I've just realized how this could be very useful but don't want to wrap data in an array.

And after thinking about it a bit more I'm wondering if you could let it be used anywhere even outside of functions?
I doubt it only works with arrays, but arrays are a good example to show how efficient this can be. Instead of copying the whole (sometimes big) array, you can point to it and dont waste such huge amounts of memory and you can change it without the need to send the changes back.
Reply With Quote
  #20  
Old 04-03-2008, 05:59 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Inverness View Post
I don't think I understood quite what you meant at the time , so I forgot.

But I would still like it if you documented this stuff

Was wondering why it is only working with arrays and not strings or numbers? I've just realized how this could be very useful but don't want to wrap data in an array.

And after thinking about it a bit more I'm wondering if you could let it be used anywhere even outside of functions?
In almost all cases for GS2, an array is simply a string.
__________________
Do it with a DON!
Reply With Quote
  #21  
Old 04-04-2008, 12:14 AM
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
Quote:
Originally Posted by zokemon View Post
In almost all cases for GS2, an array is simply a string.
PHP Code:
function onCreated() {
  
temp.string "rawr,";
  echo(
string.type());

rawr, 3
__________________
Reply With Quote
  #22  
Old 04-04-2008, 12:55 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Well why don't you jackasses try it for yourselves instead of trying to tell me how I don't know what I'm talking about. Using link() to send an array pointer as a function parameter works fine but you cannot treat that array pointer as a string.
__________________

Last edited by Inverness; 04-04-2008 at 01:22 AM..
Reply With Quote
  #23  
Old 04-04-2008, 03:48 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
Quote:
Originally Posted by Inverness View Post
Well why don't you jackasses try it for yourselves instead of trying to tell me how I don't know what I'm talking about. Using link() to send an array pointer as a function parameter works fine but you cannot treat that array pointer as a string.
I've tried, but I didn't get it to work
__________________
Reply With Quote
  #24  
Old 04-04-2008, 10:52 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
PHP Code:
//WORKS
function onCreated() {
  
temp.= {"lol pancake"};
  
this.addto(temp.v.link(), "o.o");
}
function 
addto(var, val) {
  var[
0] @= val;
}
// DOES NOT WORK
function onCreated() {
  
temp."lol pancake";
  
this.addto(temp.v.link(), "o.o");
}
function 
addto(var, val) {
  var @= 
val;

__________________
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 08:02 PM.


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