Moving on into coding...gotta choose between JASS and VJASS

Trithilon-V2

New Member
Reaction score
20
Guyz...i knew this day would come that i have to start learning Jass.
The only reasons is that i have 3 Unreleased systems that could really use functions approach.
For eg. my inventory system :-
Its uses the changing of pages.
But that algorithm is pretty long and complex and is used like in 8-9 triggers.
So i guess its better to have a function and just call it and give it the mode of actions.

Or custom events that i want to make.

So before i go ahead....I want to ask a few things:-
1:- How do Attachment Systems Work? (Making arrays for Stuff is really annoying)
2:- Can i attach "n" number of data and types of data?
3:- Which is the best in terms of Reliability and being Future Proof?

More questions coming soon.
 

Flare

Stops copies me!
Reaction score
662
gotta choose between JASS and VJASS
You don't choose between JASS or vJASS - vJASS is only an extension of JASS and it's not very useful without knowledge of 'normal' JASS, and vJASS is just JASS, with different syntax. If you check the map script, easiest way is probably to make a deliberate mistake such as
JASS:
somerandomletter
//in the middle of nowhere

and you will be able to see the map script from the error window that's displayed - you can see that struct members go from
JASS:
struct Test
  real realMember
endstruct

to
JASS:
real array s_Test_realMember

or something like that

1:- How do Attachment Systems Work? (Making arrays for Stuff is really annoying)
They associate the data-to-be-attached with the handle-to-attach-to's handle index (using H2I) - some of them bring the handle index within normal array bounds through hashing (I think) while other's just do
JASS:
H2I (whichHandle) - 0x100000 //Or whatever the first handle index is

and use the result as the array index for the data


2:- Can i attach "n" number of data and types of data?
Depends on the system you are using - ABC can attach up to 3 integers (for the most part, you're just gonna be using a struct index rather than a 'normal' integer) by default, since it's preset to have 3 Get/Set/Reset functions (A, B and C). As regards other systems, I don't really know

Even though, you shouldn't need to attach anything more than one struct instance to any handle at a time

3:- Which is the best in terms of Reliability and being Future Proof?
Find a system where the author is regularly updating the system - that's probably your best bet as regards reliability (there probably isn't much need for future-proofing, since I doubt Vexorian has any plans of adding stuff which breaks everything else :p)
 

Trithilon-V2

New Member
Reaction score
20
I am doing this especially because if the inventory system.
That damn system has a problem regarding item arrays.
So this might sound stupid but i was thinking if i could do some thing like this....

Set Unit no.[X]/Items/Page [X]/Slot No.[X]/Item = Sword

Atm, what i do is
Attach a unique number to all the units (w/o custom values).
Use that number as a key to generate an address with a formula and access the item array.
 

Flare

Stops copies me!
Reaction score
662
You could index units with custom value (then you can make all custom value-orientated systems work with the indexing rather than their previous method, if there was a different method) and then associate your arrays with the unit's custom value (can't really think of a perfect method off the top of my head)

You could use a 2D array, but the main problem I see there is the fact that you require 3 indexes (unit, page and item numbers)

There's ways and means of doing it, but I'm not sure of them :\
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top