Quote:
|
Originally Posted by Skyld
Can you think of a need to change the current system?
PHP Code:
public function myFunction()
{
return true;
}
PHP Code:
objectName.myFunction();
|
Where does the object name come from? Say I have 2 npc's in a level. I want to call a function on one from the other. Currently you can do this with triggeractions.
Quote:
Yes, you can.
PHP Code:
myVar = new TStaticVar();
myWindow = new GuiWindowCtrl("myWindow");
|
Yes but I want to my create my own classes. (Just a simple example. I dont really need to do anything like this but it would make gscript more flexible.)
PHP Code:
class myClass {
someVar = "something";
someVar2;
public function myClass(a,b) {
this.someVar = a;
this.someVar2 = b;
}
public function stringRepresentation() {
return this.someVar @ this.someVar2;
}
}
PHP Code:
myVar = new myClass("One", "Two");
myVar2 = new myClass("Three","Four");
player.chat = myVar.stringRepresntation();
say2(myVar2.stringRepresentation());