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 > Warcraft III Modding > Developer's Corner > Warcraft Editing Tools
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 03-04-2009, 04:56 PM   #1411
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,153

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Got some issues with extended structs / interfaces ...
Expand JASS:

Calling RunTest should display:
Quote:
1
2

but it only displays the "1"
(i am using 0.9.F.5)

The print method isnt called for B-instances allocated trough A.allocate2... dunno why

EDIT: Can it be that a A.allocate2 doesnt "create" a instance of type B ..but only an instance of type A ....
That would suck ...i want to have the possibility to have more than one allocator ..for type B
__________________

Last edited by akolyt0r : 03-04-2009 at 05:16 PM.
akolyt0r is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-04-2009, 09:32 PM   #1412
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

Quote:
Can it be that a A.allocate2 doesnt "create" a instance of type B ..but only an instance of type A ....
That would suck
jasshelper isn't too much into sorcery, create is the only method that can become the child's allocate, theres no syntax or anything so that you could specify another constructor.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 03-08-2009, 12:22 PM   #1413
Skater
User
 
Skater's Avatar
 
Join Date: Jan 2007
Posts: 80

Skater is on a distinguished road (17)

Default

Hey, i think i found a bug.
You cannt declare custom static operators.

Collapse JASS:
struct test
    private static integer A

    static method operator a takes nothing returns integer
        return .A
    endmethod
endstruct

error:
Operator < cannot be static.

Ofcourse you could just use public static readonly integer A but for more complex things you have to use setters and getters.
__________________

Last edited by Skater : 03-08-2009 at 12:23 PM.
Skater is offline   Reply With Quote
Old 03-08-2009, 02:10 PM   #1414
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

Not a bug just a limitation, I guess I'll have to add them.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 03-10-2009, 06:34 AM   #1415
xombie
Banned
 
Join Date: Oct 2006
Posts: 858

xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)

Default

Quote:
Originally Posted by Vexorian
keyword

The keyword statement allows you to declare a replacement directive for an scope without declaring an actual function/variable/etc. It is useful for many reasons, the most important of the reasons being that you cannot use a private/public member in an scope before it is declared, in most cases this limitation is no more than an annoyance requiring you to change the position of declarations, in other situations though this is a limitator of other features.

For example two mutually recursive functions may use .evaluate (keep reading this readme) to call each other, but if you also want the functions to be private it is impossible to do it without using keyword:

Collapse JASS:
scope myScope

   private keyword B //we were able to declare B as private without having to actually
                     //include the statement of the function which would cause conflicts.

   private function A takes integer i returns nothing
       if(i!=0) then
           return B.evaluate(i-1)*2 //we can safely use B since it was already
                                    //declared as a private member of the scope
       endif
       return 0
   endfunction

   private function B takes integer i returns nothing
       if(i!=0) then
           return A(i-1)*3
       endif
       return 0
   endfunction

endscope

This is from the keyword section of the JassHelper manual.

Sorry, I didn't really understand what this meant but I'm going to take a shot at it and hope I get it right. So basically, the keyword functions in vJass by telling the pre-compiler that you are "about" to declare something though it was unable to be declared where you wanted it.

I also have another question regarding array parameters after a struct's declaration, such as struct someStruct [9000]. I read what this compiled into and what I got from it was that it just enabled you to use more instances of the struct than the default 8190. The same would apply to adding those parameters to a global array declaration. Is this correct?

Last edited by xombie : 03-10-2009 at 06:36 AM.
xombie is offline   Reply With Quote
Old 03-10-2009, 09:01 AM   #1416
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,153

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by xombie
I also have another question regarding array parameters after a struct's declaration, such as struct someStruct [9000]. I read what this compiled into and what I got from it was that it just enabled you to use more instances of the struct than the default 8190. The same would apply to adding those parameters to a global array declaration. Is this correct?

Correct, however it will also decrease speed ...because it will add an if-condition to every operation with struct-member-variables...
__________________
akolyt0r is offline   Reply With Quote
Old 03-10-2009, 06:23 PM   #1417
xombie
Banned
 
Join Date: Oct 2006
Posts: 858

xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)

Default

Yea, I figured that much. Well its always nice to know.
xombie is offline   Reply With Quote
Old 03-11-2009, 11:34 AM   #1418
gekko
User
 
gekko's Avatar
 
Join Date: Nov 2007
Posts: 129

Submissions (1)

gekko will become famous soon enough (33)gekko will become famous soon enough (33)

Default

Quote:
Originally Posted by Vexorian
For that sort of thing libraries and scopes are exactly the same thing, so I just don't think this is true, you'll have to give actual examples.
.

Here you are, I finally could recreate the private keyword bug:

Code:
library A
    private keyword PRIV
    
    struct B        
        integer PRIV
    endstruct
    
    struct D
        integer PRIV
    
        method setPriv takes nothing returns nothing
            set .PRIV = 0
        endmethod
    endstruct

endlibrary

gives the error PRIV is no member of D, even though both structs are in the library that declares PRIV as a private keyword.
gekko is offline   Reply With Quote
Old 03-11-2009, 12:38 PM   #1419
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

try with this.PRIV
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 03-11-2009, 12:48 PM   #1420
gekko
User
 
gekko's Avatar
 
Join Date: Nov 2007
Posts: 129

Submissions (1)

gekko will become famous soon enough (33)gekko will become famous soon enough (33)

Default

Quote:
Originally Posted by Vexorian
try with this.PRIV
shouldn't this be optional in this context?
gekko is offline   Reply With Quote
Old 03-11-2009, 01:21 PM   #1421
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

yes. But try it.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 03-11-2009, 02:18 PM   #1422
gekko
User
 
gekko's Avatar
 
Join Date: Nov 2007
Posts: 129

Submissions (1)

gekko will become famous soon enough (33)gekko will become famous soon enough (33)

Default

Quote:
Originally Posted by Vexorian
try with this.PRIV
yes, then it works. But I have seen other scenarios with private keyword, where you cant use this.. Seems that it is still a bit bugged. (again begging for something like friend, hating keyword stuff :( )
gekko is offline   Reply With Quote
Old 03-11-2009, 02:35 PM   #1423
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

If I add friend it would still break here. This is a bug with the replacing stuff. It is ignoring the keywords after a single .
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 03-11-2009, 02:48 PM   #1424
gekko
User
 
gekko's Avatar
 
Join Date: Nov 2007
Posts: 129

Submissions (1)

gekko will become famous soon enough (33)gekko will become famous soon enough (33)

Default

Quote:
Originally Posted by Vexorian
If I add friend it would still break here. This is a bug with the replacing stuff. It is ignoring the keywords after a single .

Well then add friend and fix this and you get tons of
gekko is offline   Reply With Quote
Old 03-12-2009, 06:59 PM   #1425
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,153

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Collapse JASS:
globals
   debug private real BLAH
   debug real BLOH
endglobals
BLAH throws error:
"undefined type private"...

BLOH works ...
__________________

Last edited by akolyt0r : 03-12-2009 at 07:01 PM.
akolyt0r 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 12:05 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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