• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Coders Thread

Hey guys, this thread contains the current team members of the "coders" section as well as the scripting rules.

Current team

  • watermelon_1234(co-leaders)
  • WherewolfTherewolf

General Rules
  • Coding should be only in Vjass, spell can be in vanilla GUI too.
  • Always use the latest JassHelper and JNGP in order to keep it up-to-date.
  • You are allowed to use libraries from any website however, make sure that they are clean and are working for 100%.


Script Organization


Indenting
  • Every blocks will need indenting.
  • Blocks are scopes, librariess, structs, if-then-else-constructs, loops, functions, methods, interfaces, basically everything that includes something else
  • You indent with one tab, which has the size of 4x space.

Organization
  • You should put methods and struct members in order and make it look they are cathegorized
  • Categories should be descripted or at least have a very fitting and self-speaking name
  • Libraries are ONLY USED for systems and not spells.

Code order
  • At the very top is a comment area where you put the name of the script, the author, the credits and the informations into This area should also include a "how to use" if the code is a library.
  • On the next, you open your scope/library
  • Below that, there should be public globals (if you have any)
  • Then you put the private globals
  • Then comes textmacros, functions that are used as simple library or public functions. (Also interfaces)
  • Below that, here is the place for the actual struct or system.
  • At the bottom are initializer methods and misc.

Scripts we use
  • Table (or CustomTable by Anachron, if you need to store Units, Destructables and such aswell).
  • GroupUtils for GroupRecycling
  • DamageEvent for Damage Detection and DamageModifiers for modifying damage.
  • TimerUtils for everything about timers.
  • ARGB for colors.
  • Spell Event for triggering spells.
  • Timed effects for all effects with timing and duration.
  • Ability Preload to preload all usable abilities.
  • TimedLoop to allow us to use only 1 single timer for all the instances of a spell.
  • AbortSpell and it's required libraries are a must have when cancelling spell orders just like Blizzard does.
  • UnitStatus, instead of using tons of dummy abilities, we will instead use this script which will also give us more freedom to do crazy spells.
  • IsUnitSpellResistant to allow us to check if a unit has some sort of spell resistance, thus gaining defence against spells.

Systems we use
  • ABuff for triggered buffs.
  • Injury effect script to make units bleed when they are weak.
  • Random Weather script, because regular weather is too boring ... xD
  • Custom Missile system for ALL missiles and projectiles of the game (this is important).
  • RecipeSYS, for all our item combinations and recipes!
  • BonusMod, our official unit state system that will change several units properties such as attack speed, move, int , etc. Forged in THW !!

Systems I need: Currently I am looking for a stable system that allows us to change unit attributes. BonusMod is an option, but I would like to hear the opinion of my team.
 
Last edited by a moderator:
Level 25
Joined
Jun 5, 2008
Messages
2,572
The only system other than bonus mod that comes to my mind is Unit Properties...

I don't know where it is from though, i only know it since it is in Oakwood project which in which i help around from time to time.

Probably Bonus Mod is the best system for that stuff.
 
Well, I guess we could use xebasic and xecast. But if you opt to choose XE than we can NOT by any means, use xemissile nor anything else. Personally I never saw much use for xecast and I think it brings an unnecessary library to the project. IMO we just need a dummy unit and that's it.

As for UnitProperties, I am aware it has evasion and critical strike as well. I will consider this when choosing. I never used BonusMod, so I don't know if it is easier to use. All I remember was my negative experience with UP, and I surely do not want to repeat it again.

Anachron's projectile system is required for the project. Some spells are dependant on it and it was developed with the single purpose of being used in HB. We have to use it. We have to make our missiles using it as well. If you need any help, you can contact me.

How is the progress on the spells going?

When I can see the map Xarwin?
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
Whenever you want, its only terrain and some heroes which are being prepared.
I would like to do a mass import once everything is done.

I lost Anachron and TRD is away too.
I believe his current Assist (+multiboard) system was bugged so I couldn't implant it yet.
 
Ok Xarwin, here is what I need to know:
- The bleeding type of each unit type (per example, a footman can have footman bleed, but a spider should spider bleed) for each hero and the HP to which the unit starts bleeding (per example, start bleeding at 10% HP).
- The weather types. I would like you to pick me what type of weather the random weather will have.

As for the multiboard, I assume you mention the problem is related with the assist system?

And plz, post your code so the team can have a look.
 
i'm not too familiar with the abilitypreload system. would it be wise to make the spell objects with objectmerger lines so that objects can all be deleted and then the objectmerger lines edited as necessary? or does that really not matter?
object merger ? Hell no, you don't need that, Xarwin said he was planning a mass import once our spells are done. What spells are you making? Just create the units and abilities you need.
Then in the Init function of your trigger do "call AbilityPreload(abilityID)" and the preload is done. It's that simple. If you need help, you are encouraged to post your code.
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
In the meanwhile I'll be preparing the heroes so importing is fastly done.
I am also creating spells but since I never could end my vjass lessons by viikuna (he had to join the army) I still miss important information to create more advanced spells.

Also, we need to adjust our tooltips people!
Lately I knew someone posted it in the main thread but I couldn't find it anymore.
So new suggestions are welcome, this should be done + adding the template to the first post would be a great add.

About the units: I will get to this first.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Where is UnitStatus on the list?

It is a pretty good damn system and we should use it.

EDIT:

READ THIS SEPTIMUS/XARWIN:


One icon which me and DonDustin used for a skill icon is no longer available, we should be able to edit the hero template in order to change the icons of those skills since X.e.r.e.X's icons are no longer available, dunno why, only 1 of his icons are showing.

Edit2:

Should the passive skills have a check whether the skill is unlearned?
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
You don't understand.

Filter icons in the icon section by X.e.r.e.X name and see for yourself.
There is only 1 available icon, the rest are deleted? Oo

Any hero that used X.e.r.e.X's icons should change them now.
Oh I'm sorry, I thought you meant his hero. XD
Yeah, I realized the icons were missing too when I was doing DonDustin's Volcano Skin icon.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
No, Unit Status.


It allows you to:

JASS:
    * function StunUnit takes unit whichUnit, boolean flag returns boolean
    * function StunUnitTimed takes unit whichUnit, real duration returns boolean
    * function SilenceUnit takes unit whichUnit, boolean flag returns boolean
    * function SilenceUnitTimed takes unit whichUnit, real duration returns boolean
    * function DisarmUnit takes unit whichUnit, boolean flag returns boolean
    * function DisarmUnitTimed takes unit whichUnit, real duration returns boolean
    * function EnsnareUnit takes unit whichUnit, boolean flag returns boolean
    * function EnsnareUnitTimed takes unit whichUnit, real duration returns boolean
    * function DisableUnit takes unit whichUnit, boolean flag returns boolean
    * function DisableUnitTimed takes unit whichUnit, real duration returns boolean

Might be usefull for all our Stun/silence/snare/disable needs.
 
I saw that a few days ago. I considered using and I totally agree with you Kingz: it is useful.
However, it has some cons:
1 - It was made by Rising_Dusk
2 - I fear that other coders (such as Xarwin) will prefer using dummy abilities instead of that.

I would love to add that as well but I am not certain if I should.

What do you think team? Should I approve Kingz suggestion?
 
Level 13
Joined
May 11, 2008
Messages
1,198
about unitstatus... i've seen something like that on thehelper and i've been skeptical of it, as it uses aids which i think has bugs, i'm wondering if autoindex has the same bugs or not. hmm...i guess autoindex replaced uiu so we might be ok then. we'll see.
 
Last edited:
Level 13
Joined
May 11, 2008
Messages
1,198
library UnitStatus initializer Init requires TimerUtils, AutoIndex, optional xebasic

for some reason my objectmerger is broken. and i don't understand lua variables. can someone upload a map with the unitstatus objects please?

btw, i don't know much about how the map is going, but it may be a good idea for everyone to use isunitspellresistant.

it's a system by anitarf that is very simple, and can be edited freely by the map designer. additional boolean functions can be written by the designer of course.
 
library UnitStatus initializer Init requires TimerUtils, AutoIndex, optional xebasic
Optional ... Well, this script requires a dummy unit, and so does PreloadABility. I guess we can have our own unit for that. I would like a second opinion.

btw, i don't know much about how the map is going, but it may be a good idea for everyone to use isunitspellresistant.
Good idea, I can add that. However, in most cases, the function won't be used because wc3 abilities don't work on immune units.
 
Level 13
Joined
May 11, 2008
Messages
1,198
well, i do like xepreload so i'm not against using it.

as for the isunitspellresistant, this can be useful for spells that should do more or less damage depending on what sort of unit it is, or stun or whatever a unit for longer or less time also. i don't know what distinctions we'd have in this map, but hero and regular unit is an obvious one.

like i noticed in dota all stuns and disables work for same length of time, regular unit or hero. because these all don't care what kind of unit is attacked. but in regular warcraft, all those abilities check whether unit is a hero and for other stuff. so all those heroes getting stunned for full length of time was a learning curve for a lot of beginner dota players.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
The main thing in AoS is that the spells are meant to be cast vs other heroes or on other heroes, therefore it makes no sense to reduce the amount of duration a hero is stunned because that will just lead to false information which could cause a lot of rage during play.

I prefer my facts straight, it says "stuns for 1.0 seconds" i know it stuns anything for 1.0 seconds, i wouldn't like to see him recover after 0.5 seconds =\

My thoughts about the matter.
 
Level 13
Joined
May 11, 2008
Messages
1,198
yeah, that's right kingz, that's about how blizzard designed their spells, and i don't like it much either, but on the other hand, it's not too hard to do the opposite, but which might also not be appealing which is to make certain spells do bonus damage(or bonus stun time) to other kinds of units. but like flame_phoenix said, it's up to xarwin, the map designer.

whatever way you look at it, i guess isunitspellresistant may still be used in combination with abortspell and spellevent and maybe some other stuff. this can apply to any spells that would be stealing units, for example, and stuns and stuff like that which already applies to units in dota.

so with all the spells working off spellevent we check on channel response if the target is spell resistant and then act accordingly.

i haven't bothered to use spellevent until this week and i got to say, i'm impressed with it. it's nice.

who's the one working on the spell for the ultimate for the sith, m0rbid? i'd like to see the code for that when it's done. i would imagine it makes good use of spellevent and some sort of check if units are either in or outside the range or whatever.

no, i guess that's not what i meant, flame_phoenix, just as much as the designers want to use this idea, that's fine, it can be used. maybe there could just be 1 or 2 heroes or so using the idea of having spells that are different depending on the target. knowing more about the overall map design would give hero designers(who of course are designing spells) more room to work with, but i suppose for now we can go with just whatever and if the map has more stuff than we realized we can just make some new heroes with the new stuff that gives us to work with. i hadn't actually thought as much of the implications of such a thing until just now, but spellevent seems very powerful and i really like what we'll be able to do with it. i guess i need to think about some appropriate hero design to express my thought.

i guess an example of different responses might be that a spell would cause a status of ensnare on an agil melee hero, a stun on an agil ranged, a silence on an intel, and a sword break(dmg -100%) and armor break on a str hero.

that smells like an ultimate for my hero.

also you could have for example an antimage type hero that would have a stun spell that stuns for 1 second, or 1.5 seconds if the unit is an intel hero. obviously it's more work for the tooltip writers, but it doesn't bother me. it's mostly up to the hero designers, who are for the most part, designing their own heroes, which i guess makes this aos attractive.

got a question about unitstatus...what's the difference between hurl boulder and stormbolt?
 
Last edited:
Sorry, but I feel that any work I do on the spells would be shoddy compared to the work of the more advanced members on the team, and with some constant annoyances like JNG being constantly deleted by my virus scanner I feel it's probably best I leave the coding to the coders. I still would like to help with the project, but I don't think spells would be where I'm helping and not simply stalling progress.
 
Level 13
Joined
May 11, 2008
Messages
1,198
new dota version came out and sc2 came out...can't speak for the others but i'm busy trying to gain weight...so i'm kindof trying to not be tied down to my computer too much because when i get like that i lose weight instead of gain it.

so it's not a total excuse post i'll make mention that i'll look into coding some other stuff after i do the stuff for the hero idea i came up with.

in the meantime...why don't you pastebin and pm the coders the current map so we can compare what the various coders are writing for the spells for the heroes.

i've sortof been waiting on that...
i mean i read the description of what style the spells are to be written in but i'm not sure if i understand it, and being shown the foregone examples would save me having to do some guesswork.
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
I think the release date for this project will be moved further away.
Only if people are still interested in it, many left or disappeared...

Perhaps getting it into a stand alone project, I'm not sure yet.
It would be stupid giving up all the stuff we got.
 
Level 13
Joined
May 11, 2008
Messages
1,198
i think i know what you mean.

when i look at this project, and see all those hero designs, it's amazing to me that we have so few coders. i mean think about it...
this is hiveworkshop. map makers from all over are designing heroes with names of themselves...why not make those map makers code their own hereos? and have some master coders recode everything as necessary? this obviously puts more pressure on the submission givers to deliver something, but it also is a more realistic approach to the situation, in my opinion.

i say, send a pm to every submission and tell those guys if someone hasn't already finished their hero that is...to code up something for their submission.

but, do what you will.

i'm interested in the project still, for sure...but i need to see more of it to know what's going on already. so far all i've seen is great walls of text. i haven't seen any triggers from anyone. do i gotta submit my own triggers before i get a peek?
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
SanKakU, that are my exact thoughts.
Sorry that I wasn't around for the previous days, I have vacationwork (nightwork) + real life which takes time away too.

Now, it wouldn't be a bad idea making people code their own hero however we can't expect everything will be vjass. I am still thinking and would like to talk to a lot of users.

Anyone who has msn or skype should pm it to me, so talking is a lot easier.
 
i say, send a pm to every submission and tell those guys if someone hasn't already finished their hero that is...to code up something for their submission.
This is a bad idea because most people that suggested the approved heroes make no idea on how to code them. Further more, this will bring incompatibility and will make the entire project unstable, and we should not forget that reviewing bad code(as in GUI) is harder than making good code...
 
Level 13
Joined
May 11, 2008
Messages
1,198
well, if everyone has to follow the code submission rules then they can't submit gui. if they can't code something that they designed then they shouldn't have designed it, but it's just my opinion. if they were to submit bad code then their submissions could be rejected based on that. instead we're getting some designs that are not rejected because there doesn't seem to be any discrimination.

edit: still having problems installing war3? broken cd drive? was that what you meant when asking for suggestions? have you tried copying files over from another computer and then using registry fix?
 
Last edited:
well, if everyone has to follow the code submission rules then they can't submit gui. if they can't code something that they designed then they shouldn't have designed it, but it's just my opinion.
Why is that so?
Ideas != coding. One can give an idea and not code it. It is perfectly normal.
The current system is fine IMO, because this way we don't reject good ideas based on bad coding -> we do all the coding.
We do however reject ideas if they are bad and unbalanced.

I fixed my CD-drive but now I don't the wc3 cd (I am on vacation lol) .
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
I think we may need to use IDDS so that we can determine what kind of damagetype the damage dealt is. I'm not saying we should just use this sytem though; I think we should still use DamageModifiers for modifying damage since IDDS can't do that by itself. If we do use this, we'll need to recode any spell done to use its custom damage function.

I agree with Flame_Phoenix on the team coding the spell's ideas.

I think I'm going to be pretty inactive when school starts which is next week...
 
Level 13
Joined
May 11, 2008
Messages
1,198
imo if you want to suggest anything as standard, just telling us what you want to do is insufficient, but give example or two. i'm nearly done with my own hero design and coding so i'll show it off soon...it'll take a little work to convert some of the code from my own map to another map, including rewriting how one of the skills works(my map uses two different types of hero damage, mage and warrior)

can we have a thread for posting code for spells for the heroes?
so far we have just been using this thread to discuss methods. should we just expand this one?
 
Last edited:
For Auras I suggest CustomAura. Smaller auras are done with these few lines:

JASS:
library HolyDevotion requires AuraTemplate

    globals
        private constant integer BUFF_ID = 'buf1'
        private constant integer BUFF_SPELL = 'spl1'
        private constant string BUFF_ORDER = "slow"
        private constant integer SPELL_ID = 'hldv'
    endglobals
    
    private struct HolyDevotionAura extends AuraTemplate
        //! runtextmacro AuraTemplateMethods()
    
        method onLevelup takes integer theLevel returns nothing
            set .dmg = - theLevel * 2
        endmethod
        
        method getRadius takes nothing returns real
            return 500.
        endmethod
        
        method unitFilter takes unit theUnit returns boolean
            //: Do some checks whether the unit is a valid target
            return IsUnitEnemy(theUnit, GetOwningPlayer(.theUnit)) and GetUnitState(theUnit, UNIT_STATE_LIFE) > 0.40 
        endmethod
    endstruct

endlibrary
And yes, this system detects spell unlearning! (And if you need help you can ask me, you know)
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
Using jass/vjass through all spells and ways we will never finish this map.
Drastic decision lies within the coders:
- Or we allow GUI for spells
- Or you take full responsibility for when this project fails.

(I mean, did you see the hero list with the spells?)

I would like to see a combination of both. Blizzard did it often and their maps are just fine.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
I don't really like it, but I think you should accept some GUI spells since progress on vJass coding seems to be going nowhere.
I'm not doing any coding because nothing was discussed about IDDS and preloading the spells. That and because I don't have too much free time anymore.

Also, I think we should use TimedHandles instead of TimedEffects.

@Anachron: ABuff comes with ABuffAura which allows for aura-based spells.
I also don't want to use your system(s) unless you put more documentation.
 
Top