MODULE : AGSH v0.908 - Object-oriented programming

Started by Monsieur OUXX, Fri 22/12/2006 21:16:33

Previous topic - Next topic

Monsieur OUXX

Module : AGSH
Latest version : 0.908
Latest Phase : Phase 1
AGS version : 2.72

What is this module for?
Abstract of the presentation page:

QuoteAGSH is a (set of) modules for the Point'n'click games engine « AGS » (http://www.adventuregamestudio.co.uk/ ).

The nature of AGSH is plural  :

   * Lowest layer : META-LANGUAGE, adding some new features to the native script language of AGS
   * Middle layer : FRAMEWORK offering complex data structures, event handling, etc.
   * Upper layer : MODULES (converted from famous AGS modules) designed to be integrated in an elegant and homogenous way to any game.

If it's not clear for you what the module does, read the highlights of every version new features.
Versions:
0.901
0.908


How to use it? Read the manual
Download it :
- Click the download link on the  presentation page.
- If it's broken : download here
It comes as a RAR file containing a game which modules contain AGSH



2010/06/24
The module is currently being hugely refactored. I'll update the thread when it's done.
 

monkey0506

Feel free to rename this module to AGShack. That's right...A-G-Shack. Love shack. AGLoveshack. :P

How the hell are you gonna go and do that anyway?...I demand to see this module. Now. So hurry up. 8)

Gregjazz

You geniuses, you. :)

So many good modules coming out lately...

Monsieur OUXX

#3
AGSH VERSION 0.901



New features

- Everything (this is the first version  ;))



New features highlight
In it's current state, here is what you can do with it. These things are not allowed by AGS native script : ( AGSH pseudo code, written the AGS way)
Code: ags

struct MyStructA {
    int aMember = 12; //(1.) members initialization with default value;
    static int aStaticMember = 23; //(2.) static members with (3.) default value;
}

struct MyStructB extends MyStructA { //(4.) inheritance is allowed by AGS but will be enhanced
    MyStructA innerStruct = null; //(5.) this member has a custom-class type
    MyStructA innerStruct2 = new MyStructA (); //idem, plus (6.) initialization value
}


void MyFunction(MyStructB objectParameter) //(7.) an object as parameter (allows in/out parameters)
   ...
}






FAQ :
- There are only few features; this module is much less interesting than expected
The project is divided into several phases. Version 0.901 is the first one reaching Phase 1 goals: classes definition and inheritance of members. Phase 2 will add definition of methods within the classes and phase 3 will add a garbage collector. Other phases will follow, adding the framework.

- what can I do with such an unfinished module?
Try to define some classes and to extend them from built-in class "Object". Test the system.

WARNING : AGSH is implemented only until module "AGSH_TypingSystem"; all following modules MUST NOT be used, except for initializing the system ( i.e. calling AGSH.Initialize() and AGSH_Core.Initialize() )
 

Monsieur OUXX

#4
AGSH VERSION 0.908



New features

- base classes "Int2", "String2", "Vector2"
- comparators
- search by comparison within vectors



New features highlight

Now, when you create a class, one line of code is enough to define a comparator for this class.
When a class has a comparator; it allows to search instances of this class in vectors without having to iterate by yourself through the elements of this vector. Just call the AGSH_Vector.FindObject method and you're done.



FAQ :
none

WARNING : AGSH is implemented only until module "AGSH_Core"; all following modules MUST NOT be used, except for initializing the system ( i.e. calling AGSH.Initialize() and AGSH_Core.Initialize() )
 

Construed

I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

monkey0506

If you would read the first post you would find that there is not a current version of the module available because the author is revising it.

May I ask though what were you intending to do with this module?

Construed

I just wanted to try diffrent programming methods.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

monkey0506

This would not prevent you from having to learn AGS scripting. It was just designed to simulate a second language within the AGS script. So essentially you'd have to learn two languages to take advantage of the methods this module offered. I don't think that it would be very helpful to a scripting beginner.

Construed

I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Dualnames

I do have the link for that. If you want it let me know.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Monsieur OUXX

I discourage the use of it as it is now. (that's why everything is striken through -- I've been refactoring it so much it has nothing to do with what it was when I first posted)

That early version is a pile of crap, and I don't even remember if it works (I think someone reported that the version I released was missing some macros, that I had removed by mistake when stripping the module down to the bare minimum)

If you really feel like using it, let me know : I'll reload it, see if it works, and give you some guidelines.
 

Construed

Ah, I see.
My wife is getting into oop.
I'd be glad to get a copy of your past work, if your new version doesnt pertain to oop.

I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

monkey0506

I think you're still not understanding what this module does, but it's up to you if you want to try and make sense of it I guess.

AGS is already partially object-oriented. That's why you can do things like cEgo.AddInventory and cNPC.ChangeRoom. Not every function and property in AGS is object-oriented, but that is still not what this module does.

You can create custom structures of which you can create individual instances, as well as arrays of instances. Every instance of your structure is, by definition, object-oriented. You can have normal variables, pointers to built-in AGS types, and functions in custom structures. You also have access specifiers such as protected and writeprotected which apply to both functions and properties, and the static access specifier which applies to functions.

What this module does do is it attempts to simulate other features of common OOP languages. Particularly AGS does not allow pointers to custom structs, or instances of custom structs within other custom struct types. Also you cannot use custom struct types as parameters to functions.

This module does not allow you to do any of this natively.

What it does is it provides methods by which you can simulate this type of behavior. Doing this in native AGS code is not a user friendly way of scripting, more-so for a user who constantly has to ask questions about AGS scripting.

Using this module does not abstain you from having to learn AGS scripting; it actually requires a much, much better understanding of it than you have, as indicated by the threads you have started.

But if you insist that you want to use it, don't say you weren't warned.

Monsieur OUXX

#14
the OOP never got to be fully implemented. In its most advanced version, AGSH was offering dymanic allocation/disallocation of structures, using some sort of POINTERS system.

That's the main diffrenciator with its "challengers": Pointers.

I don't think you're interested in pointers.
Maybe you should have a look at the "Luags" plugin instead?


Quote from: monkey_05_06 on Thu 17/02/2011 17:17:43
Doing this in native AGS code is not a user friendly way of scripting
HEY! Eventually it was going to be  :=
 

monkey0506

I was just trying to drive the point home that this module was never intended to, and in none of its incarnations ever did, preclude knowledge of the AGS scripting language.

The impression that I have gotten from GrimReap's inquiry is that he was trying to find a way to by-pass learning the AGS scripting language, which short of using AGS 2.72-, is not presently possible if you're planning on using AGS.

I always somewhat enjoyed seeing what you were attempting to accomplish with this, but at the same time, I recognized the limitations that the current engine imposed on you, and thereby what the module usage actually entailed. Hopefully in the near future the engine will be open-sourced so we can deal with these types of things more efficiently. :)

SMF spam blocked by CleanTalk