wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > - Submit a resource -
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-22-2011, 08:43 PM   #61
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by BBQ
In such case, the solution is simple: improve and maintain Zinc instead of vJass. It's better anyway.

Also, those loops don't make stuff as easier as you claim they do.
Agree, coding for so long in this game has made us used to write our stuff with the loop - endloop style. So adding it won't make any difference in the jass community.

I hope you've enjoyed this hard work.
moyack is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-22-2011, 08:51 PM   #62
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

I knew my work was a waste of time the moment I started it,
considering number of people who actually do jass these days.

But I also think new loops make no difference only to people who are not coding jass any more, but I did not make it for them did I.

And I know I personally will never write a single loop/exitwhen/endloop in my life,
and for that reason only it was worth doing it.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 12-22-2011, 09:11 PM   #63
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

I always considered TESH not supporting delimited comments as a feature, not a bug. I tend to put documentation into regular comments while putting code examples into multiline comments, thus keeping proper syntax highlighting on the example code which makes it more readable than if it were all green.
__________________
Anitarf is offline   Reply With Quote
Old 12-22-2011, 09:48 PM   #64
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Oh fuck, conflicting interests.

EDIT:
Does anyone know how to create a grimext plugin?
The more I think about it the more I realize using C preprocessor is a great idea.
We can just make it be another menu in WE.
It would run before jasshelper.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 12-22-2011 at 10:18 PM.
cohadar is offline   Reply With Quote
Old 12-24-2011, 05:08 PM   #65
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Added C preprocessor.
It was unbelievably hard to do, had to spend another 8 hours in refactoring.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 12-24-2011, 06:55 PM   #66
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

Quote:
Originally Posted by moyack
Agree, coding for so long in this game has made us used to write our stuff with the loop - endloop style. So adding it won't make any difference in the jass community.

I hope you've enjoyed this hard work.
Don't use the pronoun "us". Not when this is related to a community of users.You're only speaking about yourself and BBQ. Don't make it sound like you're speaking on behalf of everybody.

The only reason I say that is because I beg to differ. Those loops are in permanently, right? Because I am going to switch over. VB Studio showed me several things in the last six months making me think how nice it'd be to code like that in vJass.

Obviously, vJass isn't for everybody. ZINC is the same way, so stop making the damned statement that "this is better than that". Considering that the world doesn't have a one-and-only universal coding language-- It's hella annoying how any programmer can act so narrow minded. Computers have a universal coding language comprised of boolean statements, but that'd take eons for any sane person to learn. I've met many programmers and software engineers whom will all say that which language used depends on how the work needs to be done. This is no different, so I'd appreciate it if we stopped treating this like it is different.

If we need JassHelper to support multiple languages like what cohader is doing so more people will feel comfortable coding instead of having to learn an adapted language, then I'd say that he has not wasted his time at all. He is doing us a favor for doing the work no one else wants to do.
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.

Last edited by Ignitedstar : 12-24-2011 at 07:04 PM.
Ignitedstar is offline   Reply With Quote
Old 12-24-2011, 10:41 PM   #67
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Ignitedstar
Don't use the pronoun "us". Not when this is related to a community of users.You're only speaking about yourself and BBQ. Don't make it sound like you're speaking on behalf of everybody.
Please don't put this as a big deal, if cohadar's work helps you with your coding activity, then that's fine. Besides, your inclusion to this group depends on how long have you been coding in jass and how much you've been used to the language.
moyack is offline   Reply With Quote
Old 12-25-2011, 02:11 AM   #68
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

One thing you need to know about me is: No matter how much you're liked by everyone else, I treat everyone exactly the same. No, I don't treat people like dipshit-- quite the opposite, actually. I get very analytical when people start talking. Or making posts. The moment I think that conversations are no longer being taken seriously and with respect to all audiences because of the contradictions in their statement, I reflect that unto the conversation in full force.

It is a big deal because when I argue, I take my time writing and proofreading very carefully. If I'm going to communicate with writing, I'm going to do a good job making sure my message is clear. Much less can be said about other people who just don't care. When I wrote, "Don't make it sound like you're speaking on behalf of everybody," someone who was paying attention to my main point would know what I was referring to since I keep talking about "we".

We are obviously not talking about the same "we". I made that very clear in the first post. If it's not a big deal, it seems ironic to me that you would bother talking about it.
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.

Last edited by Ignitedstar : 12-25-2011 at 02:28 AM.
Ignitedstar is offline   Reply With Quote
Old 12-25-2011, 03:47 AM   #69
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Ignitedstar
We are obviously not talking about the same "we". I made that very clear in the first post. If it's not a big deal, it seems ironic to me that you would bother talking about it.
I just want to be polite and answer your post. That's all. I propose to keep this thread free of discussions which will tend to be offtopic. Merry Christmas and good celebrations for you and yours.
moyack is offline   Reply With Quote
Old 12-25-2011, 08:39 AM   #70
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

New Version.

Table implemented with new Macros: (just an example how to use #bigdef #endbigdef)
Collapse JASS:
library Table
//***************************************************************
//* Table object 3.0
//* ------------
//*
//*   set t=Table.create() - instanceates a new table object
//*   call t.destroy()     - destroys it
//*   t[1234567]           - Get value for key 1234567
//*                          (zero if not assigned previously)
//*   set t[12341]=32      - Assigning it.
//*   call t.flush(12341)  - Flushes the stored value, so it
//*                          doesn't use any more memory
//*   t.exists(32)         - Was key 32 assigned? Notice
//*                          that flush() unassigns values.
//*   call t.reset()       - Flushes the whole contents of the
//*                          Table.
//*
//*   call t.destroy()     - Does reset() and also recycles the id.
//*
//*   If you use HandleTable instead of Table, it is the same
//* but it uses handles as keys, the same with StringTable.
//*
//*  You can use Table on structs' onInit  if the struct is
//* placed in a library that requires Table or outside a library.
//*
//*  You can also do 2D array syntax if you want to touch
//* mission keys directly, however, since this is shared space
//* you may want to prefix your mission keys accordingly:
//*
//*  set Table["thisstring"][ 7 ] = 2
//*  set Table["thisstring"][ 5 ] = Table["thisstring"][7]
//*
//***************************************************************

//=============================================================
    globals
        private constant integer MAX_INSTANCES=8100 //400000
        //Feel free to change max instances if necessary, it will only affect allocation
        //speed which shouldn't matter that much.

    //=========================================================
        private hashtable ht
    endglobals

    private struct GTable[MAX_INSTANCES]

        method reset takes nothing returns nothing
            call FlushChildHashtable(ht, integer(this) )
        endmethod

        private method onDestroy takes nothing returns nothing
            call this.reset()
        endmethod

        //=============================================================
        // initialize it all.
        //
        private static method onInit takes nothing returns nothing
            set ht = InitHashtable()
        endmethod

    endstruct

    //Hey: Don't instanciate other people's textmacros that you are not supposed to, thanks.
#bigdef TABLE_MACRO(NAME, TYPE, KEY)
    struct NAME extends GTable

        method operator [] takes TYPE key returns integer
            return LoadInteger(ht, integer(this), KEY)
        endmethod

        method operator []= takes TYPE key, integer value returns nothing
            call SaveInteger(ht,  integer(this)  ,KEY, value)
        endmethod

        method flush takes TYPE key returns nothing
            call RemoveSavedInteger(ht, integer(this), KEY)
        endmethod

        method exists takes TYPE key returns boolean
            return HaveSavedInteger( ht,  integer(this)  ,KEY)
        endmethod

        static method flush2D takes string firstkey returns nothing
            call NAME(- StringHash(firstkey)).reset()
        endmethod

        static method operator [] takes string firstkey returns NAME
            return NAME(- StringHash(firstkey) )
        endmethod

    endstruct
#endbigdef

TABLE_MACRO(Table, integer, key)
TABLE_MACRO(StringTable, string, StringHash(key))
TABLE_MACRO(HandleTable, handle, GetHandleId(key))

endlibrary
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 12-25-2011 at 08:41 AM.
cohadar is offline   Reply With Quote
Old 12-26-2011, 05:47 AM   #71
Bribe
User
 
Bribe's Avatar
 
Join Date: Mar 2010
Posts: 233

Submissions (1)

Bribe will become famous soon enough (30)Bribe will become famous soon enough (30)

Send a message via AIM to Bribe
Default

Quote:
Originally Posted by 0zyx0
I have recently used custom tile pathability, and it works fine and is very useful (although at one point, the pathing was 'reset' to the defaults for some reason I don't know).

One thing I would like to have in vJass is the ability to efficiently and easily do some initialization for each player, for example this type of function that I use very, very often.
Collapse JASS:
private function init takes nothing returns nothing
    local trigger T = CreateTrigger()
    local integer i = 0
    call TriggerAddCondition(T, Condition(function Actions))
    loop
        call TriggerRegisterPlayerUnitEvent(T, Player(i), EVENT_PLAYER_UNIT_SOMETHING, null)
        set i = i + 1
        exitwhen i == 12
    endloop
endfunction
The loop does only one thing for each player but requires several lines of code. It would be great if multiple of those functions (or the new replacement) also could be optimized into one single loop. It should also be possible to do it only for certain players (for example only for human (as in non-computer) players, or for one team).

This would help you a lot: http://www.wc3c.net/showthread.php?t=110455
Bribe is offline   Reply With Quote
Old 12-26-2011, 07:58 PM   #72
Barade
User
 
Barade's Avatar
 
Join Date: May 2006
Posts: 164

Barade is on a distinguished road (14)

Default

@cohadar: Macros seem to be very useful but I would have preferred improving already existing text macro stuff because I will have to rewrite some parts of my code if I am going to use your compiler.

edit:
I was writing about using encapsulation which seems to be possible with your macros (didn't check it).
__________________

Last edited by Barade : 12-26-2011 at 07:59 PM.
Barade is offline   Reply With Quote
Old 12-27-2011, 01:54 PM   #73
0zyx0
Perfectionist noob
 
0zyx0's Avatar
 
Join Date: Mar 2009
Posts: 255

0zyx0 will become famous soon enough (38)0zyx0 will become famous soon enough (38)

Default

Quote:
Originally Posted by cohadar
Collapse JASS:
    for i = 0 to 11 
        call TriggerRegisterPlayerUnitEvent(T, Player(i), EVENT_PLAYER_UNIT_SOMETHING, null)
    endfor

What's wrong with just using integer for loop?
The problem is that they only make the vJass code shorter, the compiled code has the same problem as before. There would be a lot of loops from 0 to 11, instead of one loop doing everything. (Also, having a for loop in that way still makes the function non-inline-friendly, which is inconvenient if it is to be called outside map initialization.)

Quote:
Originally Posted by Bribe
Ugh, no. It would require two function calls per registration instead of zero, and not add any benefit, since I only have one trigger per event most of the time anyway.
__________________
My new signature - Now easier to understand than ever!
0zyx0 is offline   Reply With Quote
Old 12-30-2011, 01:55 PM   #74
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by Barade
@cohadar: Macros seem to be very useful but I would have preferred improving already existing text macro stuff because I will have to rewrite some parts of my code if I am going to use your compiler.
Old textmacros are still working, there is no need to rewrite anything.
I don't break backwards compatibility - EVER.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 01-05-2012, 10:58 AM   #75
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

I know that it doesn't exist in other "real" languages (at least not in C, Java, Python), but like the FOG loop, jass has an other specificity.
Basically loops are whilenot instead of while.

So i think it worths an add.
Now, i'm not sure if the keyword should be "whilenot" or "until", or something else.

Ofc you can argue that you can already to that with a while not, and that doesn't matter most of times in real cases, but i'm not sure that script optimizers handle that.

Alternatively, you could detect a "while not" and handle it like it should, without any not in the loop.
__________________
Cool != Useful

Last edited by Troll-Brain : 01-05-2012 at 11:00 AM.
Troll-Brain is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 02:31 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services