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 07-14-2009, 01:07 PM   #2101
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

guess I found a bug (or misunderstood something).

code:
Collapse JASS:
library libbug

    private function init takes nothing returns nothing
        call init1.execute()
    endfunction
    
    private function init1 takes nothing returns nothing
    endfunction

endlibrary
JassHelper says

"init1 is not a type that allows . syntax"

any ideas?

Quote:
2. having to manually import the AI for all 4 races in 30+ maps is a very tedious job. it would be nice if when using the 4 parameter command line mode that clijasshelper would import the resulting .ai file into the map (and replace any existing one with the same name). this would work like using the command line version for triggers where the actual map is updated with the compiled triggers, but this would import the AI into the map.

I don't know how the import section is stored in the map, but there would need to be a way to specify the path (i.e. scripts/human.ai etc) for the file being imported.

this way we could just use a batch file to update all the maps with the edited ai (as we do when using the command line version when creating triggers).

if this is not possible or important enough to add to clijasshelper, do you know where the map file format (the import section) is posted so that maybe I can try write a command line importer?
Maybe you wanna try my tool GMSI. You can add imports there with just a function call. And you can insert the script into all your maps with just one script execution. One click, AI in every map you want. :)
__________________
My stuff can be found at www.eeve.org

Check out latest GMSI !

Last edited by gekko : 07-14-2009 at 01:16 PM.
gekko is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-14-2009, 01:27 PM   #2102
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

Quote:
Originally Posted by gekko
guess I found a bug (or misunderstood something).

code:
Collapse JASS:
library libbug

    private function init takes nothing returns nothing
        call init1.execute()
    endfunction
    
    private function init1 takes nothing returns nothing
    endfunction

endlibrary
JassHelper says

"init1 is not a type that allows . syntax"

any ideas?

you have to use a private keyword like that :
Collapse JASS:
library libbug

    private keyword init1

    private function init takes nothing returns nothing
        call init1.execute()
    endfunction
    
    private function init1 takes nothing returns nothing
    endfunction

endlibrary

Or change the position of the functions like that :

Collapse JASS:
library libbug
    
    private function init1 takes nothing returns nothing
    endfunction
    
    private function init takes nothing returns nothing
        call init1.execute()
    endfunction
    
endlibrary

Last edited by Troll-Brain : 07-14-2009 at 01:28 PM.
Troll-Brain is offline   Reply With Quote
Old 07-14-2009, 09:12 PM   #2103
daPanda
User
 
Join Date: Jan 2009
Posts: 28

daPanda has little to show at this moment (0)

Default

Quote:
Originally Posted by gekko
Maybe you wanna try my tool GMSI. You can add imports there with just a function call. And you can insert the script into all your maps with just one script execution. One click, AI in every map you want. :)
wow! very cool tool this will solve a LOT of tedious work in other areas that have been driving me nuts (some of the things you mention on your website).

I'll give it a whirl and see how it works with updating the AI imports.
Thanks!
daPanda is offline   Reply With Quote
Old 07-14-2009, 10:06 PM   #2104
Dark_Dragon
User
 
Dark_Dragon's Avatar
 
Join Date: Apr 2008
Posts: 189

Dark_Dragon has little to show at this moment (9)

Default

vex since you where asked to do linebreaks with semicolons why dont you insted do this?

Collapse JASS:
set i = 0
loopuntil (i >= 5)
    call BJDebugMsg(I2S(i))
    set i = i + 1
endloop

its compiled to:

Collapse JASS:
set i = 0
loop
 exitwhen (i >= 5)
    call BJDebugMsg(I2S(i))
    set i = i + 1
endloop

that would be awesome and btw why not add this (i know that you dont like c that much but it would be cool)

Collapse JASS:
for (integer i = 0, i < 5, i+1)
   call IMsg(i)
endfor

//compiled to

local integer i

// for detected (integer i not jet loaded so load it now)
set i = 0
loop
exitwhen not (i < 5)
   call IMsg(i)
   set i = i + 1
endloop

each time i load a for and ask for integer you must check is it already declared.

Collapse JASS:
local integer i
for (i = 0, i < 5, i+1)
   call IMsg(i)
endfor

this would as well be acceptable.

i think that for loop is really missing the jass, so its a suggestion to add it!
it would be good if you add at leat one of them loopuntil or for... if you add both it would be even better...

Greets!
~Dark Dragon
__________________
Undefined shadow...
Dark_Dragon is offline   Reply With Quote
Old 07-14-2009, 10:39 PM
Litany
This message has been deleted by Litany.
Old 07-15-2009, 12:19 AM   #2105
Bobo_The_Kodo
oO
 
Bobo_The_Kodo's Avatar
 
Join Date: Jul 2008
Posts: 580

Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)

Default

Thats not a struct Litany, >.>
Bobo_The_Kodo is offline   Reply With Quote
Old 07-15-2009, 01:54 AM   #2106
daPanda
User
 
Join Date: Jan 2009
Posts: 28

daPanda has little to show at this moment (0)

Default

Quote:
Originally Posted by Dark_Dragon
i think that for loop is really missing the jass, so its a suggestion to add it!
it would be good if you add at leat one of them loopuntil or for... if you add both it would be even better...

Greets!
~Dark Dragon
I'd vote for the for() loop if it came down to choice. much easier and less ambiguous, IMO. As for implementation of it and checking for existing local variables, you could just substitute the user defined name with name mangling (auto generated integer var name).
daPanda is offline   Reply With Quote
Old 07-15-2009, 03:03 AM
Litany
This message has been deleted by Litany.
Old 07-15-2009, 07:52 AM   #2107
C2H3NaO2
User
 
Join Date: May 2008
Posts: 80

C2H3NaO2 is on a distinguished road (17)

Default

Quote:
Originally Posted by daPanda
I'd vote for the for() loop if it came down to choice. much easier and less ambiguous, IMO. As for implementation of it and checking for existing local variables, you could just substitute the user defined name with name mangling (auto generated integer var name).

That is really ugly in jass syntax! I would prefer a pascal like syntax.
Collapse JASS:
local integer i
for i = 1 to 1
call BJDebugMsg(I2S(i))
endfor
C2H3NaO2 is offline   Reply With Quote
Old 07-15-2009, 09:10 AM   #2108
Dark_Dragon
User
 
Dark_Dragon's Avatar
 
Join Date: Apr 2008
Posts: 189

Dark_Dragon has little to show at this moment (9)

Default

Quote:
Originally Posted by C2H3NaO2
That is really ugly in jass syntax! I would prefer a pascal like syntax.
Collapse JASS:
local integer i
for i = 1 to 1
call BJDebugMsg(I2S(i))
endfor

its not like yours is bad i can live with it as well but where is increment?

EDIT: hmm as i remember syntax would be:

Collapse JASS:
local integer i

for i = 1 to 10 step 1
endfor

//or

for i = 10 to 0 step -2
endfor

questions for vex!

1) do you like "for loop"? like you said you dont like i++ stuff
2) is any of this syntaxes good enough?
3) do you think you will ever implement any syntax for "for loop"?

its importand to know the answers coz i dont want to keep suggesting it if it bothers u!
__________________
Undefined shadow...

Last edited by Dark_Dragon : 07-15-2009 at 11:20 AM.
Dark_Dragon is offline   Reply With Quote
Old 07-15-2009, 04:04 PM   #2109
ToukoAozaki
extends net.wc3c.Jasser
 
Join Date: Jun 2008
Posts: 336

Submissions (5)

ToukoAozaki will become famous soon enough (60)ToukoAozaki will become famous soon enough (60)ToukoAozaki will become famous soon enough (60)

Send a message via MSN to ToukoAozaki
Default

It would be great if default values on interface methods work with null structs... Currently using them with invalid instances likely to return unexpected values or get the thread killed silently

Also, what about making "local" keyword optional? I'd also like to see something like "static auto/local variables" in C...

Last edited by ToukoAozaki : 07-15-2009 at 04:16 PM.
ToukoAozaki is offline   Reply With Quote
Old 07-15-2009, 04:53 PM   #2110
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 ToukoAozaki
It would be great if default values on interface methods work with null structs... Currently using them with invalid instances likely to return unexpected values or get the thread killed silently

have you tried: defaults 0 ?

If this doesnt work aswell, this should really get fixed..
__________________

Last edited by akolyt0r : 07-15-2009 at 04:54 PM.
akolyt0r is offline   Reply With Quote
Old 07-15-2009, 05:04 PM   #2111
ToukoAozaki
extends net.wc3c.Jasser
 
Join Date: Jun 2008
Posts: 336

Submissions (5)

ToukoAozaki will become famous soon enough (60)ToukoAozaki will become famous soon enough (60)ToukoAozaki will become famous soon enough (60)

Send a message via MSN to ToukoAozaki
Default

Quote:
Originally Posted by akolyt0r
have you tried: defaults 0 ?

If this doesnt work aswell, this should really get fixed..

Collapse JASS:
library A initializer Init
    interface B
        method operator intValue takes nothing returns integer defaults 0
        method operator boolValue takes nothing returns boolean defaults false
    endinterface
    
    private function OnStart takes nothing returns nothing
        local B b = B(0)
        
        call BJDebugMsg("OnStart")
        
        call BJDebugMsg(I2S(b.intValue))
        if b.boolValue then
            call BJDebugMsg("true")
        else
            call BJDebugMsg("false")
        endif
    endfunction
    
    private function Init takes nothing returns nothing
        call TimerStart(CreateTimer(), 0.0, false, function OnStart)
    endfunction
endlibrary

This yields:

Collapse JASS:
//Generated method caller for B._get_intValue
function sc__B__get_intValue takes integer this returns integer
    set f__arg_this=this
    //no struct used this interface. We should probably avoid adding it...
 return f__result_integer
endfunction

//Generated method executor for B._get_intValue
function sx__B__get_intValue takes integer this returns nothing
    set f__arg_this=this
endfunction

//Generated method caller for B._get_boolValue
function sc__B__get_boolValue takes integer this returns boolean
    set f__arg_this=this
    //no struct used this interface. We should probably avoid adding it...
 return f__result_boolean
endfunction

//Generated method executor for B._get_boolValue
function sx__B__get_boolValue takes integer this returns nothing
    set f__arg_this=this
endfunction
//Generated destructor of B
function sc__B_destroy takes integer this returns nothing
    if this==null then
            call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Attempt to destroy a null struct of type: B")
        return
    elseif (si__B_V[this]!=-1) then
            call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Double free of type: B")
        return
    endif
    //no struct used this interface. We should probably avoid adding it...
    set si__B_V[this]=si__B_F
    set si__B_F=this
endfunction

//library A:
    
    function A___OnStart takes nothing returns nothing
        local integer b= (0)
        
        call BJDebugMsg("OnStart")
        
        call BJDebugMsg(I2S(sc__B__get_intValue(b)))
        if sc__B__get_boolValue(b) then
            call BJDebugMsg("true")
        else
            call BJDebugMsg("false")
        endif
    endfunction
    
    function A___Init takes nothing returns nothing
        call TimerStart(CreateTimer() , 0.0 , false , function A___OnStart)
    endfunction

//library A ends
ToukoAozaki is offline   Reply With Quote
Old 07-15-2009, 05:32 PM   #2112
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,153

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

ah i missunderstood you, i thought that method interfaces which returned structs didnt work somehow .. NVM
__________________
akolyt0r is offline   Reply With Quote
Old 07-16-2009, 06:23 AM   #2113
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 ToukoAozaki
I'd also like to see something like "static auto/local variables" in C...

I also beg for function static variables! How often do I need one or more globals for just one function (to increase performance over local variables, because these are not needed in every branch of the function and it would be insuficient to alloc memory for them each time the function is called, even if they are only used in one of 100 cases when the function is called).
It is so damn ugly to make a globals block above that function and specify all values there. Instead a line inside the function with something like:
"local static integer i"
would be superb, would make the code look much straighter and really emphasize that this global is only for this function/method.

The compiler just had to remove this line from the function and just make a global declaration out of it. (Of course, most function calls would be impossible in static init since its a global declaration)
__________________
My stuff can be found at www.eeve.org

Check out latest GMSI !
gekko is offline   Reply With Quote
Old 07-16-2009, 10:30 AM   #2114
Dark_Dragon
User
 
Dark_Dragon's Avatar
 
Join Date: Apr 2008
Posts: 189

Dark_Dragon has little to show at this moment (9)

Default

Quote:
Originally Posted by gekko
I also beg for function static variables! How often do I need one or more globals for just one function (to increase performance over local variables, because these are not needed in every branch of the function and it would be insuficient to alloc memory for them each time the function is called, even if they are only used in one of 100 cases when the function is called).
It is so damn ugly to make a globals block above that function and specify all values there. Instead a line inside the function with something like:
"local static integer i"
would be superb, would make the code look much straighter and really emphasize that this global is only for this function/method.

The compiler just had to remove this line from the function and just make a global declaration out of it. (Of course, most function calls would be impossible in static init since its a global declaration)

Collapse JASS:
local static integer i //? that makes no sense
static integer i // thats fine

second thing if this is not a bug then omg!

Collapse JASS:
struct xxx
   method onDestroy takes nothing returns nothing
   endmethod
endstruct

local xxx x = xxx.create()
call x.onDestroy()

one guy who i was teaching vjass wrote that and thats how i found about this bug...
__________________
Undefined shadow...
Dark_Dragon is offline   Reply With Quote
Old 07-16-2009, 03:15 PM   #2115
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 Dark_Dragon
Collapse JASS:
local static integer i //? that makes no sense
static integer i // thats fine

I rather ment this:
Collapse JASS:
method bla takes nothing returns nothing   
  local static integer i
 //or maybe just
  static integer i
endmethod
__________________
My stuff can be found at www.eeve.org

Check out latest GMSI !

Last edited by gekko : 07-16-2009 at 03:16 PM.
gekko 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 10:19 AM.


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