Explaining this error

10/13/2011 22:03 HerpDerpNigga#1
what does this error means, could anyone explain me what actually means?
thanks!
[Only registered and activated users can see links. Click Here To Register...]

I want to add the bless effect, so when you upgrade your bless to -1 to show Aegis1 effect, -3 to show Aegis2 effect, -5 to show Aegis3 effect and -7 to show Aegis4 effect.

I do like this...
Code:
_String str = new _String(true);
                                                        str.TextsCount = 1;
                                                        str.Type = _String.Effect;
                                                        str.Texts.Add("Aegis4");
                                                        [COLOR="Red"][B]Entity.Owner.Screen.SendScreen(str, true);[/B][/COLOR]
But the problem is at the highlighted code...where the effect to be send, idk how to make it send to everyone, cause it gives me that error I posted above.
10/13/2011 23:16 pro4never#2
You need to reference an instance of an object...


Entity is what your actual class is called. You need to refer to the ACTUAL PERSON DOIGN THE UPGRADING.


for example... what does the method start with? Where is this? I assume somewhere in your npc use scripting?


Top should be something along the lines of...


public static void HandleNpc(Entity user, ushort npcID, byte linkBack)

However your source handles it... you want user instead of Entity (or however you handle it)


Non static objects ALWAYS need to have a specific object referred to before use. It's like saying "fill up 'car' with gas". It needs to know what car you're talking about... your car? all cars that have ever existed?.... WHAT?!


<Pointless rant>

And this is another reason why naming conventions are useful.... local variables shouldn't be starting with a cap... as far as I'm aware (I could be off base with a few of these...) naming conventions in general are...

Local variable: Start with lower case letter separating words with _ or using camel caps
Eg: int variableName;

Private variable: Start with an underscore and lower case letter. Separate words with _ or use camel caps
Eg: private int _variableName;

Public variables: Start with cap letter, separate words with _ or use camel caps
Eg: public int VariableName;

Constant variables: All letters capitalized. Separate words with _
Eg: public const int VARIABLE_NAME;


I'm sure I've missed some but those are the common naming conventions... being consistent helps make keeping track of things easier (IE: what entity am I referring to?... the one that was passed into this method, am I referring to some constant value?... etc)