HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Reinventing Jass

06-14-2005, 08:40 AM#1
linuxdog
I find it frustrating that so many triggers must be written with such inefficiency. Some of the most important triggers in any map you can point out rely on 1, 2 or even 3 nested for loops, making time complexity a huge issue when executing these triggers. What frustrates me is that the For Loops are completely uneeded if blizzard had correctly built a object orientated script vs. the semi-object orientated script there is now.

To make things more effecient I have been thinking of ways to reinvent the basic JASS functions to become useful methods that can be called on objects in the MAP. Yes that means I would want every unit, every timer, every anything to have a set of optional parameters that can be passed when they are constructed or when they are pseudo-constructed after the initialization process. That also means that every object should have "GET" methods and "SET" methods to get stored parameters and change them when need be.

So far I have been unsuccesful and I am looking for ideas.
06-14-2005, 11:48 AM#2
Zoxc
If you want to do something like this. You can make a script editor, thats converts the functions to script-jass. For Ex.

Code:
 
class Test

public integer Hi

function Create takes nothing returns nothing
set This.Hi = 5
endfunction

endclass

function a takes nothing returns nothing
local Test testclass
set testclass = testclass.Create()
set testclass.Hi = 6
endfunction


Gets like this:

Code:
 

function _Test_Create takes integer _Hi returns nothing
set _Hi = 5
endfunction

function a takes nothing returns nothing
local integer testclass_Hi
set testclass =  _Test_Create(testclass_Hi)
set testclass_Hi = 6
endfunction


Maybe this well give you some ideas.
The problem is that this will not change jass, it will just slow it down. And its very important that the app check what parameters each function use of the class so it dont pass all varibles in the class, but just those witch are needed.
06-14-2005, 03:12 PM#3
Vexorian
Quote:
Originally Posted by linuxdog
I find it frustrating that so many triggers must be written with such inefficiency. Some of the most important triggers in any map you can point out rely on 1, 2 or even 3 nested for loops, making time complexity a huge issue when executing these triggers. What frustrates me is that the For Loops are completely uneeded if blizzard had correctly built a object orientated script vs. the semi-object orientated script there is now.

To make things more effecient I have been thinking of ways to reinvent the basic JASS functions to become useful methods that can be called on objects in the MAP. Yes that means I would want every unit, every timer, every anything to have a set of optional parameters that can be passed when they are constructed or when they are pseudo-constructed after the initialization process. That also means that every object should have "GET" methods and "SET" methods to get stored parameters and change them when need be.

So far I have been unsuccesful and I am looking for ideas.
Are you the same guy of that post in the forum?

This post would have been great 2 years ago, but now on 2005?

We use gamecache to simulate OOP it works pretty well, with Handle Variables and that stuff, you should check weaaddar's bag DT4 thing too for object oriented stuff.

AIAndy made an incredible system for classes, you can create classes and that stuff
06-17-2005, 09:24 PM#4
weaaddar
Its a nice idea but its been done to death. The systems already in existence (mine), ussually swap clock cycles for memory. I know my system is a huge memory hog vs its not as object oriented cousin. (Dt4a A4 vs Dt4a old busted style), of course by huge memory hog i mean like 500 or so more kb.