Enfo's Three Lane Edition?

General discussion of Warcraft 3. Threads may may be posted here if they don't fit into the other sections.

Moderator: Cheaters

patrick-the-bomb
Senior Member
Posts: 165
Joined: February 25th, 2008, 2:56 am
Title: Sir Awesome

Re: Enfo's Three Lane Edition?

Post by patrick-the-bomb »

Kryptonyte wrote:
patrick-the-bomb wrote:Also because I am under the impression that JASS can't do THAT much more than GUI. I may be wrong, and if so, correct me.


Have you ever tried to code some of the DotA skills in GUI? No? Didn't think so.


Actually I tried to do one. Then failed because I just started and I had no idea what was happening.
storyyeller wrote:
patrick-the-bomb wrote:Also because I am under the impression that GUI can't do much.


I fixed it for you


The only reason you haven't seen the limitations of GUI is because you are used to thinking in terms of GUI actions or whatever.

Which is ok if all you ever want to do is Spawn unit x every 30 seconds or whatever, but once you switch to JASS, you can do infinitely more and you'll wonder why on earth you ever used GUI. For example, even something simple like a load/save code would be basically impossible using only GUI triggers.


Lol, thanks bro.


Like I said though, I'm def too lazy to go learn JASS and for Enfo's I really, REALLY don't think I'd need to anyway. It's pretty simple stuff...
User avatar
Risen
Forum Staff
Posts: 811
Joined: January 1st, 2008, 12:58 am

Re: Enfo's Three Lane Edition?

Post by Risen »

patrick-the-bomb wrote:Also because I am under the impression that JASS can't do THAT much more than GUI.

GASP! o.o...
Jass can do maybe 50x more than GUI can. That's including bigass heavy duty systems, Huge mathematic formula's that require you to be very efficient and whatnot.

Then there's efficiency and time.

I guess I should provide an example.
Ok, First off, Let's say you're making a dialog with 10 buttons.
First, you'd make the trigger with the DialogSetup, Then there's the trigger adding the buttons, then there's the trigger showing the dialog, then there's the trigger doing actions for EACH of the buttons. That's like 13 triggers just for a dialog..

Now into jass, I used this kind of example because it's good and I have it handy.

First, The DialogInit

Spoiler:

Code: Select all

library DialogInit initializer init

globals
        dialog RaceSelect = DialogCreate()
        button array Race
endglobals

 function DialogAssign takes nothing returns nothing
    local integer i = 0
    set Race[0] = DialogAddButton( RaceSelect, "Human", 'H' )
    set Race[1] = DialogAddButton( RaceSelect, "Orc", 'O' )
    set Race[2] = DialogAddButton( RaceSelect, "Night Elf", 'E' )
    set Race[3] = DialogAddButton( RaceSelect, "Naga", 'N' )
    call DialogSetMessage( RaceSelect, "Select Your Race" ) 
     loop
      exitwhen i > 11
          call DialogDisplay( Player(i), RaceSelect, true )
         
          set i = i + 1
      endloop
      call DestroyTimer( GetExpiredTimer() )
 endfunction

 private function init takes nothing returns nothing
local trigger t = CreateTrigger()
    call TimerStart( CreateTimer(), .7 , false, function DialogAssign )
set t = null
 endfunction

 endlibrary



Then there's what happens when you select a button.

Spoiler:

Code: Select all

library RaceSelect initializer init

 function DialogSelect takes nothing returns nothing
  local real x = GetRandomReal( GetRectMinX( gg_rct_Player_Spawn ), GetRectMaxX( gg_rct_Player_Spawn ) )
  local real y = GetRandomReal( GetRectMinY( gg_rct_Player_Spawn ), GetRectMaxY( gg_rct_Player_Spawn ) )
  local real r = 270.
  local player p = GetTriggerPlayer()
  local button b = GetClickedButton()
  if b== Race[0] then
      call CreateUnit( p, 'h001', x, y, r )
  elseif b == Race[1] then
      call CreateUnit( p, 'h013', x, y, r )   
  elseif b == Race[2] then
      call CreateUnit( p, 'h014', x, y, r )   
  elseif b == Race[3] then
      call CreateUnit( p, 'h017', x, y, r )   
endif
    if GetLocalPlayer() == p then
      call PanCameraToTimed( x, y, 0. )
    endif
set b = null
endfunction
 
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
    call TriggerRegisterDialogEvent( t, RaceSelect )
    call TriggerAddAction( t, function DialogSelect )
set t = null
endfunction

endlibrary
   


See how much more efficient that is? Not to mention less time consuming. Jass is the first language I learned (and I only know one Computer language) I'll say it is difficult to learn at first, but it's really worthwhile once you can actually use it correctly.

Edit: Yea, I agree, Enfos is a pretty simple map to start with, just creating waves / and spawns pretty much, maybe a leader board.
But what if you want to add different modes? A cool hero select system? Maybe a name changing system? Possibly a setcam option too? You could also add a multiboard to that, Maybe a few cool spells? There's so many different things to do with jass, and it can be fun too.

Oh, I forgot to mention to come back and clean up all of those nasty leaks you've made in your map. ;)

@Storyyeller, Dialogs are a really good example since most people using GUI have created some dialogs and know what I mean when I state my points.
Last edited by Risen on April 12th, 2009, 9:32 pm, edited 2 times in total.
Image
Wanna learn to hack maps? --> Guide
storyyeller
Senior Member
Posts: 178
Joined: February 15th, 2009, 9:08 pm

Re: Enfo's Three Lane Edition?

Post by storyyeller »

For something like dialogs, I'd personally just create a generic dialog system and paste it into whatever map I need it in
patrick-the-bomb
Senior Member
Posts: 165
Joined: February 25th, 2008, 2:56 am
Title: Sir Awesome

Re: Enfo's Three Lane Edition?

Post by patrick-the-bomb »

I need to learn JASS though. GUI I can pretty much figure out myself, and I have. Anyone know some badass JASS tutorials? If you help me find a good one I'll learn, but the ones I've seen don't help me at all.
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: Enfo's Three Lane Edition?

Post by Ken »

Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
User avatar
Risen
Forum Staff
Posts: 811
Joined: January 1st, 2008, 12:58 am

Re: Enfo's Three Lane Edition?

Post by Risen »

The best one I can spot to get started.. would be http://world-editor-tutorials.thehelper.net/jassintro.php
Image
Wanna learn to hack maps? --> Guide