|
|
|
|
| JASS Resources Find JASS code snippets and functions here or write your own and post it on the Submissions sub-forum. |
 |
|
01-04-2012, 10:11 PM
|
#31 (permalink)
|
|
Newb
Join Date: Oct 2011
Posts: 167
|
Quote:
Originally Posted by Nestharus
Well, it'll be awhile before I look over everything and apply whatever needs to be applied, k?
|
Is this still in a usable state? I'm thinking of switching from T32 to CTL =)
|
|
|
01-04-2012, 11:09 PM
|
#32 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
This is still in a usable state yes, and the debated updated doesn't break backwards compatibility.
|
|
|
01-05-2012, 02:10 PM
|
#33 (permalink)
|
|
Invasion in Duskwood
Join Date: Aug 2009
Posts: 1,116
|
Well, I honestly don't get why this overwrites "create" and "destroy" methods, and not "allocate"/"deallocate". Like 15 of my systems are based on the public version of those methods, I think I don't have to tell how painful it would be to edit the whole map. Well, if you add a "CTLP" (Constant Timer Loop Public") or "CTLX" module that's based on allocate and deallocate, and not on create and destroy, I might change a few systems; even tho' the API looks horrible and the code is like a plate of spaghetti, the extra speed I can gain (if I can... I'm not sure) might be useful.
|
|
|
01-06-2012, 03:18 AM
|
#34 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
Use of create and destroy can be changed by modifying your own map to include a modified version of your resources or a modified version of this resource to fix the problem.
The API looks ugly at first but you get used to it and it actually is more readable once you are used to it. Though the updates I proposed will make the resource more user-friendly by cutting the number of required implementations in half.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
01-06-2012, 03:29 PM
|
#35 (permalink)
|
|
Invasion in Duskwood
Join Date: Aug 2009
Posts: 1,116
|
Well, I don't really like modifying other peoples' resources, but I think I'll do it again till Nes decides to make the change I suggested.
|
|
|
01-06-2012, 03:53 PM
|
#36 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,755
|
Quote:
|
Well, I don't really like modifying other peoples' resources
|
It's perfectly fine for ANY resource ^.^
I modified Bribe's ArrowKeyEvent and optimized it for Single-player :D (For a map I'm working on)
|
|
|
01-08-2012, 02:10 AM
|
#37 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
Exactly mag. If a resource does something you do not want, and you know how to modify it to fit your own map, feel free to do so.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
01-08-2012, 04:08 PM
|
#38 (permalink)
|
|
Newb
Join Date: Oct 2011
Posts: 167
|
Should I not use 2d arrays with CTL?
or make another integer within the struct?
struct 'number' seems to be provided by CTL... so i might go over 8191 with some of my variables
|
|
|
01-08-2012, 04:41 PM
|
#39 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,755
|
You can use 2D fake arrays:
twoDarray[index1 * sizeSlot2 + index2]
You'd have max indices of [8191/(sizeSlot2 + 1)] and [sizeSlot2 - 1]
|
|
|
01-08-2012, 04:59 PM
|
#40 (permalink)
|
|
Newb
Join Date: Oct 2011
Posts: 167
|
Quote:
Originally Posted by Magtheridon96
You can use 2D fake arrays:
twoDarray[index1 * sizeSlot2 + index2]
You'd have max indices of [8191/(sizeSlot2 + 1)] and [sizeSlot2 - 1]
|
I don't understand you. If I do something like this
unit[this * 100 + index]
I wouldn't be able to use it once I have like 80 instances of CTL running
I usually use 2d arrays with using struct as first index but in this case
I was wondering if I should make an extra integer variable and use it as index, and if it's worth doing so because I would have to recycle those indexes and that would make an array inside an array
(or use CT32 i guess)
|
|
|
01-08-2012, 06:22 PM
|
#41 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,755
|
Quote:
I don't understand you. If I do something like this
unit[this * 100 + index]
I wouldn't be able to use it once I have like 80 instances of CTL running
|
Yes, that's true. (Unfortunately :/)
You could use a Table for the fake 2D array instead.
A Table would be fine unless you need to lookup a lot of data from it inside some loop that runs ~23000 times :P
|
|
|
01-08-2012, 06:41 PM
|
#42 (permalink)
|
|
Newb
Join Date: Oct 2011
Posts: 167
|
Quote:
Originally Posted by Magtheridon96
Yes, that's true. (Unfortunately :/)
You could use a Table for the fake 2D array instead.
A Table would be fine unless you need to lookup a lot of data from it inside some loop that runs ~23000 times :P
|
I would probably use T32 if i have to use Table.. i thought hashtable was very slow
|
|
|
01-08-2012, 06:44 PM
|
#43 (permalink)
|
|
Invasion in Duskwood
Join Date: Aug 2009
Posts: 1,116
|
You should use dynamic arrays.
|
|
|
01-08-2012, 08:09 PM
|
#44 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,755
|
You can go with my idea:
unit[index1 * 100 + index2]
Besides, when are you going to have more than 80 instances running with CTL?
(Unless it's a UnitIndexStruct)
If it is a UnitIndexStruct, a Table would be fine. (They aren't that slow)
|
|
|
01-08-2012, 08:18 PM
|
#45 (permalink)
|
|
Beware the Ides of March
Join Date: Jun 2011
Posts: 248
|
With LinkedListModule the array dynamism is perfect (variable array sizes, just insert nodes into a list)
__________________
Check out my TD
Originally Posted by GetTriggerUnit-
" There should be a section in World Editor designated to Nestharus."
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 12:30 PM.
|