HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

JCast Spells

12-12-2010, 03:10 AM#1
rogueteddybear
I noticed there was a lack of JCast type spells. I have been using JCast and find it real easy. So here are some simple spells done in JCast that I hope others can use to learn.

Update:

I made UnitStatus and UnitProperties optional in the spells where they are used. I made the requirements in each spell more clear in the comments. Also fixed some elevation issues with the effects. I am now using GroupUtils to avoid creating/destroying groups. Fixed some comments and damage calculations with the spells.


Spells:
Chain Lightning
War Stomp
Shock Flow
Beam of Fire

Shock Flow is a continuous channeling spell that does increasing damage to a unit over time.

Beam of fire unleashes a laser on the ground in a straight line, causing damage and burning enemies over time.

I decided to spice things up with bonus attributes when the spells get to level 4 and 5. For example chain lightning gets a chance to stun and war stomp gets knockback/slow.

Requirements (All in test map):
- JCast, TimerUtils, Knockback, UnitStatus, UnitProperties, Intuituve Damage/Buff System
- There are some other random little libraries that I use in the map.

Issues:
There were a couple of things I couldn't figure out:
- When firing Beam of Fire near trees or elevated terrain, the globe effect gets higher up in the air (FIXED).
- When killing rapidly spawning units, like spawns from a hydra, Autoindex gets errors about "trying to remove decaying/removed units"

Credit:
All individual systems used are credited by their own author in the comments of the code.
They include Vexorian, Rising_Dusk, profet, grim001, Cassiel
Attached Images
File type: pngBeamOfFire.png (616.3 KB)
Attached Files
File type: w3xJCastSubmissionMap1.w3x (321.8 KB)
12-12-2010, 04:25 AM#2
SanKakU
hey...these spells look really, really good!

edit: ok, can you change them so they don't require unitproperties and unitstatus? i have tried to see what systems it needs, and i guess everyone that's in the map.
12-12-2010, 07:41 AM#3
rogueteddybear
Ah, you probably have other ways of stunning/affecting units.
In that case I will look into it.

I know that unitproperties is only used for movespeed modification at this point so that's not a big deal.

unitstatus is only used for stun so taking that out doesn't really break anything, you will just have to stun units however you want to do it.

I will take a look and update later.
12-12-2010, 11:11 AM#4
Anitarf
I'm sorry but your spells require many libraries that are not in our resource section, so this submission can not be approved.
12-12-2010, 05:11 PM#5
SanKakU
Quote:
Originally Posted by Anitarf
I'm sorry but your spells require many libraries that are not in our resource section, so this submission can not be approved.
i would suggest that if you want to keep all those libraries in there put in some of those...

STATIC IF

deals. with static if you can determine if a library exists in the person's map...if so, proceed like normal...otherwise...run alternate code. this may simply result in additional features of the spell being unused, and error messages to that effect displayed.
12-12-2010, 08:28 PM#6
rogueteddybear
Quote:
Originally Posted by Anitarf
I'm sorry but your spells require many libraries that are not in our resource section, so this submission can not be approved.

That's alright. I just submitted these to help JCast out a bit, and to help others who might be interested in it.

Perhaps it is an easy fix though. Are the libraries you are referring to the smaller ones such as LoopEffect and Ray? I noticed that UnitProperties was not on here but it is on The Hive and approved on there. If I link to that page will that be enough?

Everything else is just stuff to make the map presentable.

Edit: perhaps then I should make this less of a resource, and instead a post on the forums? I think this, along with previous suggestions Sankaku has made, would probably work out?
12-12-2010, 09:37 PM#7
Anitarf
The libraries that are a problem are GlobalCore, TextUtils, CoreVars, PlayerData, HeroRevival, UnitIndexer, AIDS, DamageModifier, Ray, LoopEffect, JCast, JCastExtension, NegativeBuffs (UnitProperties is a border case; it did go through our review process once and was approved, so despite its author removing it at a later point it could still be considered an acceptable requirement; on the other hand, we have an alternative in BonusMod so it makes sense for us to encourage spellmakers to use it instead).

I realize some of the listed libraries are only a part of the demo map and not actually required by the spells, but since the spells don't have their requirements properly documented and the demo map code seems to be dispersed across multiple categories it is easier for me to just list all the libraries than try to figure out which is which.


If you don't wish to jump through the hoops of our review process, this can be moved to the Triggers&Scripts forum at your request instead.
12-13-2010, 01:50 AM#8
BlackRose
Quote:
- When firing Beam of Fire near trees or elevated terrain, the globe effect gets higher up in the air.

Movement - Type of Fly causes the unit to automatically adjust it's height. This issue is the result, you can always set to Foot / Hover or something and it should work fine (provided you add crow ability or something).

I tested your spells and I really like the Beam of Fire, it's smooth :)
As for Shock Overflow, the lightning should have some height offset, it looks strange when it's on the ground. Also, do you know AddLightningEx does not factor in the Z of the x/y location? You must do it yourself with GetLocationZ.
12-13-2010, 03:49 AM#9
rogueteddybear
@BlackRose Thank you BlackRose, that did the trick. Also I fixed the zoffset issue. All lightning effects get a default zoffset of 50 added to the ground height so shock flow should look ok.

@Anitarf: I updated the comments to better reflect the requirements that the spells have. However they still require some things that aren't available on this site. So if this was moved to the forums like you suggested then that would be good.

@SanKaku: UnitStatus and UnitProperties are no longer required. If you don't have them you can fill in your own code after the static if's like you suggested.
12-13-2010, 11:24 AM#10
Anitarf
Okay, moving this to triggers&scripts then.

You should look into using static groups instead of dynamic ones, since there are several leaks associated with creating&destroying groups. You can instead keep one global group and use GroupEnum natives to fill it with units as needed. Also, you are leaking locations when using GetUnitsInRangeOfLocMatching.

Does the WC3 chain lightning target random units? I always thought it bounces to the nearest unit first, but maybe I'm wrong, I haven't played melee in a while.
12-13-2010, 08:41 PM#11
rogueteddybear
Thank you for the feed back.

Quote:
Originally Posted by Anitarf
You should look into using static groups instead of dynamic ones, since there are several leaks associated with creating&destroying groups.

Interesting. I did download GroupUtils earlier because I needed it for the knockback library. I suppose using that would be alright since in the docs it says it recycles groups instead of destroying them? I will replace all my group creation/destruction with this.


Quote:
Originally Posted by Anitarf
Also, you are leaking locations when using GetUnitsInRangeOfLocMatching.

Is that just by the nature of the function or is it because im using GetUnitLoc() and never cleaning that location up?

Quote:
Originally Posted by Anitarf
Does the WC3 chain lightning target random units? I always thought it bounces to the nearest unit first, but maybe I'm wrong, I haven't played melee in a while.

Now that you mention it I don't actually know. I could change it to the nearest, but it isn't so much of a concern for me since I just wanted a working chain lightning.

edit: I have added GroupUtils functionality to the spells, along with the GroupEnum stuff. Fixed some effects/damage issues with beam of fire as well.
12-14-2010, 12:11 PM#12
Bribe
GetUnitLoc() should never be found in a JASS script. Stick to reals. Wish Blizzard had not made natives able to work with locations (and had used BJ's)... everything should be able to be done with coordinates... a well-scripted code only requires locations for GetLocationZ(), and nothing else. The next patch could really use a GetTerrainZ(x, y) native.