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.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top