how to create your own class?
I'm trying to create some objects to make things easier in a script I'm running for a browser game (not RS). I've found some Delphi guides online for creating classes, records, units, etc. What I need is to create a class. In this case, it will represent a planet in the game (which is space-based). It is in a separate include file (planet.scar) but I cannot get this include file to compile, and I get the same error when I include it in the main script and attempt to run it. In an attempt to eliminate any possible code syntax errors I've commented out all the declared variables/functions and just left the most basic code. Below is literally the entire planet.scar file.
SCAR Code:
type
TPlanet = class
private
//plName : string;
published
//constructor Create();
//procedure Update(TradeHTML : string);
end;
This is the error when I compile. It moves the cursor right after the equal sign (line 2 # 11)
Quote:
Failed when compiling
Line 2: [Error] (2:11): Identifier expected in script D:\Program Files (x86)\SCAR 3.21\includes\Pardus\PardusPlanet.scar
I've even tried copying/pasting the entire "Stringy" example class, located here (http://www.delphibasics.co.uk/Articl...=OOExamplePlus), into a new script file and tried to compile it, getting the same error.
What am I doing wrong?