Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Joining players to classes (https://forums.graalonline.com/forums/showthread.php?t=64441)

jake13jake 02-28-2006 10:05 PM

Joining players to classes
 
One quick question, if you used a this.var in a player joined class, would the script that called the player.function() be referred to as this?

I'll test it later, but gtg. If ne1 can answer, thx.

Skyld 02-28-2006 10:27 PM

I'm not sure I understand the question, but in a player-joined class, this. effectively becomes the player's object.

jake13jake 02-28-2006 11:26 PM

Quote:

Originally Posted by Skyld
I'm not sure I understand the question, but in a player-joined class, this. effectively becomes the player's object.

Well then why keep referring to the player as player in the player-joined class?

Skyld 02-28-2006 11:39 PM

Quote:

Originally Posted by jake13jake
Well then why keep referring to the player as player in the player-joined class?

Good question.

jake13jake 02-28-2006 11:56 PM

So I'm guessing you have to pass the calling object as a parameter?

Admins 03-01-2006 12:57 AM

Yes you would need to pass the calling object

ApothiX 03-01-2006 03:12 PM

Quote:

Originally Posted by jake13jake
Well then why keep referring to the player as player in the player-joined class?

It's a matter of preference. I use 'player.' in player-joined classes because it's easier to tell what I'm modifying than if everything was just 'this.'


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

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