Author Topic: Classes (for scripters)  (Read 4396 times)

0 Members and 2 Guests are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Classes (for scripters)
« on: January 07, 2009, 06:35:14 pm »
Script Name: Classes
Script Description Classes for scripters
Author: DorkeyDear
Compile Test: Passed
Core Version: 2.6.3
Hosted by: Soldat Central - http://soldatcentral.com/

Full Description:
Just some way to have methods and variables grouped..
Features:
- regular/static classes
- methods, variables, static methods, static variables
- variables may include other classes, include classes of the same type
- inheritance (support for more than one base types)
A list of functions, variables, and types may be found here




(Size 5.27 KB)
- http://soldatcentral.com/index.php?page=script&f=84 -


** Script hosted by Soldat Central! Please visit the author's script page and Rate this script **
« Last Edit: January 09, 2009, 10:26:53 pm by DorkeyDear »

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: Classes (for scripters)
« Reply #1 on: January 08, 2009, 08:26:21 am »
wow... nice

A bit more comments with the example might help understanding your 'class-system', I'm having quite some trouble figuring it all out.

Anyways, if this works the way i think it does, it just might start up a new soldat scripting experience :)

very very good job.

Come join: EliteCTF
Listen to: My Music

Offline CurryWurst

  • Camper
  • ***
  • Posts: 265
    • Soldat Global Account System
Re: Classes (for scripters)
« Reply #2 on: January 08, 2009, 01:39:19 pm »
Jesus Crist, this script is more than wicked awesome. It revolutionize the whole soldat scripting engine and makes life more comfortable :D
Many thanks for this great advancement!
Soldat Global Account System: #soldat.sgas @ quakenet

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Classes (for scripters)
« Reply #3 on: January 08, 2009, 03:54:40 pm »
First time i heard about this it almost made my brain break... I have no idea how you got this to work and hope it's stable... Waiting for someone to start using this =)

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Classes (for scripters)
« Reply #4 on: January 08, 2009, 06:38:57 pm »
Okay, I modified both classes.pas and example.pas to contain comments. If you still have issues doing it, just contact me (not through the forums please :P)
« Last Edit: January 08, 2009, 06:41:00 pm by DorkeyDear »

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Classes (for scripters)
« Reply #5 on: January 08, 2009, 07:18:04 pm »
I dont know if i get it right (my english's not perfect), correct me if I'm wrong. This script lets you define and use classes, methods, etc like you would normally do in C++/C# or Object Pascal? If so then I must say: great job.

Oh and is there class inheritance possible?
« Last Edit: January 08, 2009, 07:32:47 pm by JotEmI »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Classes (for scripters)
« Reply #6 on: January 08, 2009, 08:36:55 pm »
This script lets you define and use classes, methods, etc like you would normally do in C++/C# or Object Pascal?
Ye, something similar to that..

Oh and is there class inheritance possible?
- base types (support for more than one)
I guess inheritance would be a better word for it.. :P

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Classes (for scripters)
« Reply #7 on: January 08, 2009, 09:07:06 pm »
Well, if one class is based on another class (smth like parent-child relation) then it is called 'inheritance' :)
As I said: exelent job. I'll definitely try it out.

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Classes (for scripters)
« Reply #8 on: January 09, 2009, 07:18:05 am »
that’s one small step for Curt, one giant leap for Scripting side of the Soldat ^^

Im chill like that

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Classes (for scripters)
« Reply #9 on: January 09, 2009, 10:25:23 pm »
I forgot to mention something for when inheriting classes.. The constructor function of the parent class must, or at least should call the newBaseClass function(s) before doing anything.
Code: [Select]
myBaseClassType := newClassType('_myBaseClass', [], [], [], []);
myClassType := newClassTypeB('_myClass', [], [], [], [], [myBaseClassType]);
myClass := newClass(myClassType, []);
Code: [Select]
procedure _myBaseClass(const ClassIndex: TClassIndex; const ArgsIndex: TArgsIndex);
begin
  WriteLn('myBaseClass Constructor');
end;

procedure _myClass(const ClassIndex: TClassIndex; const ArgsIndex: TArgsIndex);
begin
  newBaseClass(ClassIndex, 0, []);
  WriteLn('myClass Constructor');
end;
(untested)