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 > Code Resources > Samples
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 07-27-2007, 09:03 PM   #16
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Collapse JASS:
set f = FirstOfGroup(allies) 
   loop
   exitwhen f == null   
       call SetPlayerHandicapXP(GetOwningPlayer(f), 1.00)
              call AddHeroXP(f, add, true)
THAT one was a typo on my part. I may was well provide a key to my indentation before attempting to change it.
And it's "sane" to me.

0 spaces for sets
2 spaces for locals
3 spaces for if's, loops, etc., resets the count (block)
4 for calls
eg:
Collapse JASS:
  local unit u
set u = blah
    call this

   if blahblah == whatever then
       call whatever
   elseif blahblah == false then
      if this == that then
          call function
      set u = thatUnit
      endif
   endif

set u = null
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt


Last edited by darkwulfv : 07-27-2007 at 09:15 PM.
darkwulfv is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-27-2007, 09:26 PM   #17
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

That looks really terrible though and it's really hard to read.
Let me show you how I would do that...
Collapse JASS:
function MyFunc takes nothing returns nothing
    local unit u
    
    set u = blah
    call SomeFunc(u)
    if true == false then
        call OneMoreFunc(u)
    elseif false == false then
        if true == true then
            call SomeOtherFunc(u)
            set u = OtherUnit
        endif
    endif

    set u = null
endfunction
You can't possibly tell me yours is easier to read.
__________________
Rising_Dusk is offline   Reply With Quote
Old 07-27-2007, 09:41 PM   #18
Rao Dao Zao
www.raodaozao.net
 
Rao Dao Zao's Avatar


MDL & Resource Moderator
 
Join Date: Aug 2003
Posts: 2,511

Submissions (27)

Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)

Approved Map: When the Freedom Slips Away

Send a message via MSN to Rao Dao Zao
Default

Dusky wins.

Give that man some time programming in Python, that'll set him to rights.
__________________
Rao Dao Zao is offline   Reply With Quote
Old 07-27-2007, 11:33 PM   #19
The Elite
For External Use Only
 
The Elite's Avatar
 
Join Date: Jun 2007
Posts: 672

Submissions (6)

The Elite will become famous soon enough (60)The Elite will become famous soon enough (60)The Elite will become famous soon enough (60)

Default

i have an idea, how about heros further away will get less exp from kill then the ones closer to the hero, eg: the units who are 400 away from it will recieve 79 exp apiece while the hero who was just running to another place and happened to be in the exp gathering range (lets say 1100) only gets 22 exp.
How about that?
The Elite is offline   Reply With Quote
Old 07-28-2007, 12:05 AM   #20
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Quote:
Originally Posted by Rising_Dusk
You can't possibly tell me yours is easier to read.
Well besides the fact they look almost exactly the same, and that mine was a hurridly created example just to show how I indent and without decent code dividing, I can't possibly say yours is much different.


But can we please just drop the fucking topic? I already agreed to fix it (not seeing why it's such a big deal, has anyone seen MrApples's code indenting before?!) You've gone far off topic ranting about how terribly my code is indented (which is NOT an impairing issue since the only things someone needs to be editing anyways are the constants), and only one person seems to have tried it. I'd like feedback on the SYSTEM AND CODE, not how much whitespace I put between the wall and my words. And don't say you can't give me feedback on my code because of it's indenting, because it's coherent enough to read and you all know it. The only major difference I'm seeing is that it's not following the "standard" method. Drop the indentation topic and give me time to change it, I've been under the weather today and haven't felt like fixing it.[/rant].

[Disclaimer]Due to constant wracking headaches, I'm in no mood for anything, so the constant arguing is most likely caused by said headaches. Don't hate my system because I put up a fight over the indenting, blame the headaches.[/disclaimer]

Quote:
Originally Posted by The_Elite
i have an idea, how about heros further away will get less exp from kill then the ones closer to the hero, eg: the units who are 400 away from it will recieve 79 exp apiece while the hero who was just running to another place and happened to be in the exp gathering range (lets say 1100) only gets 22 exp.
How about that?
Not the point of the system, but I considered that. Right now however, I don't wanna put in exp-splitting code, but if time permits I suppose I could work on that.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt


Last edited by darkwulfv : 07-28-2007 at 12:12 AM.
darkwulfv is offline   Reply With Quote
Old 07-28-2007, 04:15 AM   #21
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

~Bump~
I intended the code in accordance to the conformist way. Indent is 2 now.

2 for the base, then +2 for blocks, and another +2 for anything inside the blocks.

Is everyone happy now? Can I get some real feedback on my code? Like possible opimizations or something?

EDIT: Shitshitshit there's a huge error that stops the code from working entirely, now I gotta go through and find it. Map's removed for now.
EDITEDIT: Fiks'd. I'm going to be adding the following to my system tonight:
-The ability to make it so that distance from the dying unit affects how much XP you get (3 settings: Close, medium, and far) (that might take a while)
-Removing the ability to get expierence from killing allied units.
So for now, the map won't be there. Just browse my code and check for anything that can be improved.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt


Last edited by darkwulfv : 07-28-2007 at 04:26 AM.
darkwulfv is offline   Reply With Quote
Old 07-28-2007, 05:35 AM   #22
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

T-T-T-T-T-T-Trrriple Post!!!11!

Yeah yeah, triple post bump. Just pointing out that the new features are added and tested and the code is finally ready for a final evaluation. I won't be adding more features unless someone asks. If it's reasonable, I'll add it in. The final version of the demo is up, and the original post is updated as of in a few minutes of me posting this. Enjoy!

Also, I'd like to apologize for putting up such a fight about my indenting habits. It's been a shitty day for me, and coming here and seeing my system thread filled with posts about my code indenting rather than the code itself or the system, possible additions, flaws, etc., just set me off. I'll be nice from now on.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Old 07-28-2007, 05:49 AM   #23
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

I'm drunk.
xombie is offline   Reply With Quote
Old 07-28-2007, 08:06 AM   #24
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Pardon?
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 07-28-2007, 08:09 AM   #25
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Quote:
Originally Posted by xombie
I'm drunk.
You've failed at all aspects of life, now please, kindly remove yourself from my thread and hug the front-side of a speeding train. Thank you.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Old 07-28-2007, 08:15 AM   #26
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Either way, his saying he's drunk took away from your total failure of a triple post.
So you should be thanking him with more booze, not asking him to leave.

*Downloads the system then goes to sleep*
__________________
Rising_Dusk is offline   Reply With Quote
Old 07-28-2007, 08:19 AM   #27
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

If I hadn't triple posted, my system would've been left forgotten like so many other resources. I had to save it, since it got no feedback other than "indentations r teh gai".

There's a resource on the second page that nobody has said a thing about since april 25th. I'd rather not have my system end up there.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt


Last edited by darkwulfv : 07-28-2007 at 08:22 AM.
darkwulfv is offline   Reply With Quote
Old 07-28-2007, 08:24 AM   #28
The Elite
For External Use Only
 
The Elite's Avatar
 
Join Date: Jun 2007
Posts: 672

Submissions (6)

The Elite will become famous soon enough (60)The Elite will become famous soon enough (60)The Elite will become famous soon enough (60)

Default

Quote:
Originally Posted by darkwulfv
T-T-T-T-T-T-Trrriple Post!!!11!
You monster!!
__________________

Goths are nerds that dress like vampires. -Dominant-Male
Oh, and wc3c wasn't dying back in 2007 and it isn't now. Our secret is simple: you can't kill the undead ... - Vexorian

We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft. - Chris Metzen on the Warcraft Movie
Man, we're considered elitist all over the internet. This makes me feel nice and warm inside. - ghenjis
Please help! I'll provide no information, you must guess! - Whitehorn
The Elite is offline   Reply With Quote
Old 07-28-2007, 08:26 AM   #29
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Quote:
Originally Posted by Me
Credits:
...
...
The_Elite - He suggested hero XP splitting according to distance from the kill. (Which i used)
You're in my credits, and as such, have no right to declare me a monster! Now look at my system! DO IT! please?
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Old 07-30-2007, 04:56 PM   #30
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Comments:
  • You should make the "HeroXP" thing into a factor that the experience is multiplied by, not another number. Maybe this is personal opinion, but it would make more sense to me this way. So instead of what you have, the factor would be 1.5, this way it multiplies the unit xp the hero would get by 1.5 if it's a hero.
  • Collapse JASS:
    // 10 * Killed Unit Level + (Number of Heroes in radius * (Amount specified in DES_XPPerHero))
    Give the ability to modify that formula in a constant function.
  • Collapse JASS:
    constant function DES_XPPerHero takes nothing returns real
      return 9. //This is the amount the number of heroes is mutliplied by.
      //A negative number will mean the more heroes, the less XP gained.
    endfunction
    This is a confusing function, why not simply make a boolean for whether or not the experience splits between heroes or not? Wouldn't that make infinitely more sense?
  • Why do you GroupEnumUnitsInRange 3 times in that function? Why not group everything in the far radius than do a DistanceBetweenUnitsXYSquared() check on those units to see how close they are?
  • You still missed some spots on the indenting, but I'll let it slide.
  • It would be nice if you configured the boolexpr filter for the hero grouping in the constant function area (Though it wouldn't be able to be constant). That way people can configure what kinds of heroes are selected to be given experience.
  • Collapse JASS:
      local group g = CreateGroup()
      local group g2 = CreateGroup()
      local group picked = CreateGroup()
      local group allies = CreateGroup()
    Your method of doing this is terrible, you only need one group for this whole system and you can shrink the code by about 75% relatively easily.
  • Collapse JASS:
    local boolean HeroOrUnit = IsUnitType(u, UNIT_TYPE_HERO) == true
    Why does that exist? Just inline that boolean.
  • If this gets approved, it is not a true system, but should rather be approved as a sample. That's really what it is.
Rawr.
__________________

Last edited by Rising_Dusk : 07-30-2007 at 04:56 PM.
Rising_Dusk 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 01:07 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