Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Class troubles... (https://forums.graalonline.com/forums/showthread.php?t=79765)

Stryke 05-18-2008 01:24 AM

Class troubles...
 
This is in my weapon script, a Shovel.
PHP Code:

temp.putnpc2(temp.xx,temp.yy,"join shovel_misc1;");
with(findNPC(temp.i))this.owner player.account

shovel_misc1 Class:
PHP Code:

function onCreated() {
  
setshape(1,32,32);
}
//#CLIENTSIDE
function onCreated() {
  
setshape(1,32,32);
  
showimg(666,"block.png",x,y);
  
message(this.owner);


Anyone know it won't display the message.
I've also tried:

with(temp.i)this.owner = player.account;
temp.i.owner = player.account;

cbk1994 05-18-2008 02:07 AM

You're setting this.owner serverside to it. I suggest setting an attr, so that you can access it clientside as well.

Chompy 05-18-2008 02:10 AM

hmm, why the use of findnpc()?

PHP Code:

temp.putnpc2(temp.xx,temp.yy,"join shovel_misc1;");
// putnpc2 returns an oject, so 'temp.i' will point to the npc/object that was placed at x,y

with(temp.ithis.owner playero.account

and you probably have to use an attr to make the info accessable as Chris said

PHP Code:

temp.putnpc2(xxyy"");
temp.i.join("shovel_misc1");
temp.i.attr[30] = player.account

and in shovel_misc1:
PHP Code:

function onCreated() {
  echo(
this.attr[30]);
}

//#CLIENTSIDE
function onCreated() {
  
message(this.attr[30]);


or something like that

Stryke 05-18-2008 02:21 AM

Shovel:
PHP Code:

temp.putnpc2(temp.xx,temp.yy,"");
temp.i.join("shovel_misc1");
temp.i.attr[30] = player.account

Class shovel_misc1:
PHP Code:

function onCreated() {
  
setshape(1,32,32);
}

//#CLIENTSIDE
function onCreated() {
  
setshape(1,32,32);
  
showimg(666,"block.png",x,y);
  echo(
this.attr[30]);


It still doesn't work.. meh...

Chompy 05-18-2008 03:17 AM

hmm, checked if it sets attr[30]? (echo(temp.i.attr[30]);)

and, tried something like echo("hello"); in the onCreated event in the shovel_misc1 class?

cbk1994 05-18-2008 03:22 AM

Quote:

Originally Posted by Stryke (Post 1391339)
Shovel:
PHP Code:

temp.putnpc2(temp.xx,temp.yy,"");
temp.i.join("shovel_misc1");
temp.i.attr[30] = player.account

Class shovel_misc1:
PHP Code:

function onCreated() {
  
setshape(1,32,32);
}

//#CLIENTSIDE
function onCreated() {
  
setshape(1,32,32);
  
showimg(666,"block.png",x,y);
  echo(
this.attr[30]);


It still doesn't work.. meh...

Why are you showing an image with an index of 666?

Chompy 05-18-2008 03:25 AM

Quote:

Originally Posted by cbk1994 (Post 1391343)
Why are you showing an image with an index of 666?

lmao, weird use of number I must say xD

Stryke 05-18-2008 08:40 AM

Solved, changed the image number to 665.
Actually, just displayed the text on the serverside seeing as attr's don't work.

xXziroXx 05-18-2008 03:28 PM

Quote:

Originally Posted by Stryke (Post 1391359)
Solved, changed the image number to 665.
Actually, just displayed the text on the serverside seeing as attr's don't work.

Judging from the amounts of threads created by you the last week, I'd say you're the one that doesn't "work". Instead of not listening to our advice, how about you go read up on the wiki a little more? :\

[email protected] 05-18-2008 03:45 PM

Quote:

Originally Posted by xXziroXx (Post 1391387)
Judging from the amounts of threads created by you the last week, I'd say you're the one that doesn't "work". Instead of not listening to our advice, how about you go read up on the wiki a little more? :\

he's learning, isn't this forum based upon asking for help anyway?
Ignore Ziro, the ScrIpt0r, he's just failed at life.

cbk1994 05-18-2008 04:21 PM

Quote:

Originally Posted by Stryke (Post 1391359)
Solved, changed the image number to 665.
Actually, just displayed the text on the serverside seeing as attr's don't work.

Ah, I knew changing the index would fix it ;)
Quote:

Originally Posted by xXziroXx (Post 1391387)
Judging from the amounts of threads created by you the last week, I'd say you're the one that doesn't "work". Instead of not listening to our advice, how about you go read up on the wiki a little more? :\

He's a decent scripter, but I agree he does cry for help a bit much instead of trying to solve it himself.
Quote:

Originally Posted by [email protected] (Post 1391390)
Ignore Ziro, the ScrIpt0r, he's just failed at life.

Yes, especially coming from the guy pretending to be a girl :rolleyes:

[email protected] 05-18-2008 04:32 PM

Quote:

Originally Posted by cbk1994 (Post 1391396)
Yes, especially coming from the guy pretending to be a girl :rolleyes:

yes, because that's how you fail in life apparantly. o_O

cbk1994 05-18-2008 05:13 PM

Quote:

Originally Posted by [email protected] (Post 1391402)
yes, because that's how you fail in life apparantly. o_O

Kinda sorta.

DustyPorViva 05-18-2008 06:34 PM

I suggest getting buddy buddy with a scripter or two so you can comfortably ask them for help via another means. It feels a lot better than asking for a solution to every problem on the forum.

Robin 05-18-2008 06:39 PM

Personally I don't mind him asking for help on every single problem.

What I do mind however, is the fact he deletes his threads afterwards. What about leaving them there for others?

cbk1994 05-18-2008 07:36 PM

I agree, Skyld should undelete them :/

xXziroXx 05-18-2008 11:53 PM

I don't have a problem with him making a billion of threads, I do however have a problem when he's not listening to the advise given and then says it doesn't work.

cbk1994 05-19-2008 12:01 AM

Quote:

Originally Posted by xXziroXx (Post 1391464)
I don't have a problem with him making a billion of threads, I do however have a problem when he's not listening to the advise given and then says it doesn't work.

What are you talking about? He obviously knows better than us :)

He posts to give us a challenge, while he is the supreme scripter ;)

[email protected] 05-19-2008 08:30 AM

Quote:

Originally Posted by cbk1994 (Post 1391466)
What are you talking about? He obviously knows better than us :)

He posts to give us a challenge, while he is the supreme scripter ;)

were you always this arrogant?:confused::confused:

Tigairius 05-19-2008 08:49 AM

Quote:

Originally Posted by Robin (Post 1391419)
Personally I don't mind him asking for help on every single problem.

What I do mind however, is the fact he deletes his threads afterwards. What about leaving them there for others?

I already complained about him doing that after he closed the other two that say "SOLVED," and I don't think he does that anymore.

cbk1994 05-20-2008 01:05 AM

Quote:

Originally Posted by [email protected] (Post 1391530)
were you always this arrogant?:confused::confused:

Yes. :)


All times are GMT +2. The time now is 02:07 PM.

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