need suggestions for attachment system

emjlr3

Change can be a good thing
Reaction score
395
i agree with that

id say start with CSData, and if you ever have problems, move to ABC or HSAS, since its "Safer", for all the dumb asses out there

however, you have a lot to learn about vJASS syntax

I would say, out of the manual, read about:

global declaration
libraries and scopes
first half of the structs part, stopping at interfaces

to get you going in the right direction
 

Cohadar

master of fugue
Reaction score
209
id say start with CSData, and if you ever have problems, move to ABC or HSAS, since its "Safer", for all the dumb asses out there

HSAS is not safe, it has same problems as CSData.

Anyways just because ABC is "fool-proof" does not mean that you have to be dumb ass to use it.
I did specifically design ABC with average noob in mind,
but not using ABC will not make you pro,
while using handlevars will effectively make you dumb ass.

So if you want to be 'cool' and 'pro' use CSData,
but if you want to be happy and save yourself time in finding errors use ABC.
 

N-a-z-g-u-l

New Member
Reaction score
30
Just looked at N-a-z-g-u-l's system, it is a shitty subversion of ABC loooooooooooool.

its not copied, i even think i used mine before ABC was out, but its sure i did not know of ABC when i created that system... just to me its easy-to-use... and i know ecactly what it does, and ive stolen nothing, so for me its the best :p i first uploaded mine Jun 29, 2007, i think i dont have created it more than a month earlier... http://www.wc3jass.com/viewtopic.php?t=3336

and vexorian: what do you mean by that? not attaching things to timer objects? i do nothing else... you mean just because of bugs? there are plenty of possibilites to make them safer, CSSafety for example is one, isnt it? i have my own system for that, too :p (i'd be happy if you could explain the problems, perhaps where i published it)

and well, im not forcing anyone to use that, i might not be able to get a realistic view of my own system ;) and: first it could be used to attach things to all handles, but to make it safer i decided to save the timers as timers and not as integers, and thats the result


if anyone is interested in the version i actually use in my maps (this may give compilation errors, i just did not use it till now because im not creating maps, but i would use it for the next map that needs attachments^^)

udg_TBI[__id___] will be the used timer
JASS:
globals
	timer array udg_TBI
	timer array udg_TBIStack
	integer udg_TBIStackN
endglobals

function H2I takes handle h returns integer
	return h
	return 0
endfunction

function CreateTimerById takes nothing returns integer
	local integer i
	local integer c
	if udg_TBIStackN==0 then
		set udg_TBIStack[0]=CreateTimer()
	else
		set udg_TBIStackN=udg_TBIStackN-1
	endif
	set i=H2I(udg_TimersUnused[udg_TBIStackN])
	set c=i-(i/8192)*8192
	set i=c
	loop
		if udg_TBI<i>==null then
			set udg_TBI<i>=udg_TimersUnused[udg_TBIStackN]
			return i
		endif
		set i=i+1
		exitwhen i==8192
	endloop
	set i=0
	loop
		exitwhen i==c
		if udg_TBI<i>==null then
			set udg_TBI<i>=udg_TimersUnused[udg_TBIStackN]
			return i
		endif
		set i=i+1
	endloop
	call BJDebugMsg(&quot;|cffff0000TBI: No free timer slot!|r&quot;)
	return -1
endfunction

function GetExpiredTimerById takes nothing returns integer
	local timer t=GetExpiredTimer()
	local integer i=H2I(t)
	local integer c=i-(i/8192)*8192
	set i=c
	loop
		if udg_TBI<i>==t then
			return i
		endif
		set i=i+1
		exitwhen i==8192
	endloop
	set i=0
	loop
		exitwhen i==c
		if udg_TBI<i>==t then
			return i
		endif
		set i=i+1
	endloop
	call BJDebugMsg(&quot;|cffff0000TBI: Unrecognized expired timer!|r&quot;)
	return -1
endfunction

function DestroyTimerById takes integer Id returns nothing
	call PauseTimer(udg_TBI[Id])
	set udg_TBIStack[udg_TBIStackN]=udg_TBI[Id]
	set udg_TBIStackN=udg_TBIStackN+1
	set udg_TBI[Id]=null
endfunction</i></i></i></i></i></i>



and:

i still dont recommend to use vJass unless you really need it... i had some problems with it deleting forces for example, and it did not help me that much... i even find it too complicated now, even if i probably can understand it, just not write, but for a beginner its a bit too much imo...
1. know the basics of GUI
2. learn jass converting GUI-triggers to Jass, understanding them, and editing
3. reading in forums about whats possible, look at codes and try to understand them
4. compare different attachment systems on your own
5. now youve compared them, you should understand how each of them is to use

btw, what are the problems with CSData / HSAS?
 

Cohadar

master of fugue
Reaction score
209
I did not say you stole anything from ABC.
You just use lame hashing algorithm that looks like the one I used in ABC v2.0 or something.

New ABC is superior to that algorithm in every way possible.
(Witch is only natural because it took me 3 months of experimenting to get it right :D)

btw, what are the problems with CSData / HSAS?
There are a few like:
1. No error/warning reporting.
2. Not type-safe
3. Not leak resistant

But the main problem is that they allow you to attach stuff to units.
Attaching to units is not MUI.
There are ways to make it be MUI but it is complicated and error prone.

I really disagree with your refusing to use vJass,
you also have some false belief that in vJass you have to use structs to make spells, that is not true, you can still make spells in vJass the standard way.

The main advantage of vJass are not structs it is the declaration of globals in code and libraries.
First removes the need for that awful variable editor and udg's,
the second removes the need for map header.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
example, and it did not help me that much... i even find it too complicated now, even if i probably can understand it, just not write, but for a beginner its a bit too much imo...
1. know the basics of GUI
2. learn jass converting GUI-triggers to Jass, understanding them, and editing
3. reading in forums about whats possible, look at codes and try to understand them
4. compare different attachment systems on your own
5. now youve compared them, you should understand how each of them is to use
i know all of these im not a jass noob.....
im only having problem with understand attachment system which seems too complicated for me so that's why i was looking for easy to learn attachment system
 

N-a-z-g-u-l

New Member
Reaction score
30
I did not say you stole anything from ABC.
ok, ive misunderstood that :)

I really disagree with your refusing to use vJass,
you also have some false belief that in vJass you have to use structs to make spells, that is not true, you can still make spells in vJass the standard way.

The main advantage of vJass are not structs it is the declaration of globals in code and libraries.
First removes the need for that awful variable editor and udg's,
the second removes the need for map header.
yes, i gave it a try, but it somehow screwed up my player forces and when i viewed the map in the wc3 list i just had one player slot... maybe i was doing something wrong, but thats the main reason why i dont use it... (btw i use the TEST standalone, but the one in newgen is much better.. at least i believe theres no new standalone version)

im only having problem with understand attachment system which seems too complicated for me so that's why i was looking for easy to learn attachment system
hmm okay, but youve understood what attachment systems are basically used for?
most/all work that you save a handle somewhere, then (or at the same time) save some additional data to it, re-access it later through the handle, and afterwars remove the whole data again... for more specific ones, i'd suggest reading the suggestions given where the systems are published... otherwise ask a bit more specific ;)
http://www.wc3campaigns.net/showthread.php?t=95872 <- heres ABC, which imo is the best system for attaching currently... ( but it requires structs and with mine i know exactly whats behind it, so i use mine :p )

a brief example for structs (there are a lot more possibilities, but thats how i'd start)
JASS:
struct myStructType
    integer a
    integer b
endstruct

function Test takes nothing returns nothing
    local myStructType data = myStructType.create()
    local integer i
    set data.a = 123
    set data.b = 123
    set i = data.a + data.b
    data.destroy() // not 100% sure about this line, if its the correct name for that function, but destroying is needed!
endfunction


for ABC, read the description... then combine both :p basically you have to create a struct type for each place where you want to use the attachment system, then create a struct attached to the handle everytime you call that function, save your data into it, get the struct later and read the data... (i cant go more specific as i dont know the function names etc of ABC)

PS: i dont use vJass / structs, as ive already told, but know how they work, because otherwise i could not understand anything of what other people are posting here^^
 

The_Kingpin

Member (Who are you and why should I care?)
Reaction score
41
But the main problem is that they allow you to attach stuff to units.
Attaching to units is not MUI.
There are ways to make it be MUI but it is complicated and error prone.

What you CAN do with them should never be a problem.
And attaching to units is MUI only if you perform checks on the unit first, not complicated and error prone.
And aren't you the one who made PUI, the system made only for attaching structs to units?

[ontopic]
Anyway, you don't have to learn vJass to use a system written in it, but if you do learn at least the structs part of vJass, you'll only need to store integers and that's it.

And I've never had any problems with NewGen editor, so I wouldn't worry. :)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
thanks for the explanation but i already understand the basic of struct (i think) and i know what attachment system are used for....
im about to learn all the tpes of attachments eventually (the more options the better) but for now i wanna learn the easiest
 

Cohadar

master of fugue
Reaction score
209
What you CAN do with them should never be a problem.
And attaching to units is MUI only if you perform checks on the unit first, not complicated and error prone.
And aren't you the one who made PUI, the system made only for attaching structs to units?

Yes theoretically it should not, but when you spend 5 hours trying to find an error in code you start to appreciate restrictions.

Making unit attachments MUI does not always mean it is enough to check that unit only, there are spells that involve more than one unit (life drain for example) and complexity of checks increases exponentially with number of units involved in spell who need unit attaching.
I made PUI to avoid that problem.

So for triggers, timers and dialogs use ABC
for units use PUI
and you can live happily ever after....
 

Matemeo

New Member
Reaction score
20
i know all of these im not a jass noob.....
im only having problem with understand attachment system which seems too complicated for me so that's why i was looking for easy to learn attachment system

It took me awhile to figure out attachment systems as well, the one that did it for me INSTANTLY it almost seemed, was ABC, just made sense to me :D Also, an example or two always helps
 
Reaction score
333
The wonders of hype.

Just about all (integer) attachment systems do exactly the same thing in different ways. The only difference between ABC and any other, where the user should be concerned, is that ABC forces you to use a different function for each handle-type.
 

Cohadar

master of fugue
Reaction score
209
Just about all (integer) attachment systems do exactly the same thing in different ways. The only difference between ABC and any other, where the user should be concerned, is that ABC forces you to use a different function for each handle-type.

Actually no, that is not even the most important difference.
It would do you good if you actually read what people posted before you reply.
 
Reaction score
333
Actually no, that is not even the most important difference.
It would do you good if you actually read what people posted before you reply.

I read what people post, I simply disagree with them.

Edit: Don't get me wrong though, I don't deny the speed and other advantages. These things do not affect ease of learning, though, and I really can't anything that makes ABC easier to learn compared to something like CSData.
 

Cohadar

master of fugue
Reaction score
209
How about logical function names?

Here is a small test for you.
Write CSData equivalents for these functions:

SetTriggerStructA
GetTriggerStructA
ClearTriggerStructA
 

Cohadar

master of fugue
Reaction score
209
And where is your clear function?
(It exists btw, just is not obvious)
 

Cohadar

master of fugue
Reaction score
209
Very good.
Did you come to any conclusions regarding easiness?

Now, can you tell me the main difference between:
SetCSData(<handle>, 0) and ClearTriggerStructA(<handle>)
(except the obvious difference in number of parameters)
 
Reaction score
333
Very good.
Did you come to any conclusions regarding easiness?

Now, can you tell me the main difference between:
SetCSData(<handle>, 0) and ClearTriggerStructA(<handle>)
(except the obvious difference in number of parameters)

If a new user was asked how he might clear an attachment with CSData, he would probably find it hard to answer. If he was asked how he might set the value of an attachment to 0, he would know almost instantly provided he knows how to use the "Set" function.

"Clear" is itself a misleading term. You can not "clear" an array element, you can only set it to 0, null or some other default value. Having a Clear function in CSData is about as useful as having a SetCSDataToSeven function.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top