Spellpack GUI: Spear Throw & Ball

Trollvottel

never aging title
Reaction score
262
SPELLPACK

Well, i just wanted to do something in GUI, so i made these 2 spells.

Fully MUI
Fully GUI (except leak removal)
Easy to import
Leakless (of course)

Spear Throw

Found no better description than this:
Throw 3 spears in the target direction. If a spear hits units, they will be damaged and the spear will disappear.

Screenshot:
spearkg6.jpg

Code(i had to translate it):

Code:
SpearCast
    Events
        Unit - A Unit Starts the effect of an Ability
    Conditions
        (Ability being cast) equal to Spearthrow 
    Actions
        -------- CONFIGURATION --------
        -------- Maximum Distance --------
        Set Spear_MaxD = (600.00 + (100.00 x (Real((Level of Spearthrow  for (Triggering unit))))))
        -------- Speed with each intervall --------
        Set Spear_Speed = 25.00
        -------- Damage delt to hit units --------
        Set Spear_DMG = (20.00 + (80.00 x (Real((Level of Spearthrow  for (Triggering unit))))))
        -------- Range to collide with units --------
        Set Spear_PickRange = 90.00
        -------- Insert Unit-type here --------
        Set Spear_Rawcode = Spear
        -------- ------------- --------
        -------- SPELL BEGINS --------
        -------- ------------- --------
        Set Spear_Temp_Loc[1] = (Position of (Triggering unit))
        Set Spear_Temp_Loc[2] = (Target point of ability being cast)
        Set Spear_Temp_Angle = (Angle from Spear_Temp_Loc[1] to Spear_Temp_Loc[2])
        Set Spear_Temp_Loc[3] = (Spear_Temp_Loc[2] offset by 120.00 towards (Spear_Temp_Angle + 90.00) degrees)
        Set Spear_Temp_Loc[4] = (Spear_Temp_Loc[2] offset by 120.00 towards (Spear_Temp_Angle - 90.00) degrees)
        -------- -------------------- --------
        Set Spear_Int = (Spear_Int + 1)
        Set Spear_Caster[Spear_Int] = (Triggering unit)
        Set Spear_Direction[Spear_Int] = (Angle from Spear_Temp_Loc[1] to Spear_Temp_Loc[2])
        Set Spear_Curdis[Spear_Int] = 0.00
        Set Spear_Damage[Spear_Int] = Spear_DMG
        Set Spear_MaxDis[Spear_Int] = Spear_MaxD
        Unit - Create 1 Spear_Rawcode for (Owner of (Triggering unit)) at Spear_Temp_Loc[1] facing Spear_Direction[Spear_Int] degrees
        Set Spear_Flying[Spear_Int] = (Last created unit)
        -------- -------------------- --------
        Set Spear_Int = (Spear_Int + 1)
        Set Spear_Caster[Spear_Int] = (Triggering unit)
        Set Spear_Direction[Spear_Int] = (Angle from Spear_Temp_Loc[1] to Spear_Temp_Loc[3])
        Set Spear_Curdis[Spear_Int] = 0.00
        Set Spear_Damage[Spear_Int] = Spear_DMG
        Set Spear_MaxDis[Spear_Int] = Spear_MaxD
        Unit - Create 1 Spear_Rawcode for (Owner of (Triggering unit)) at Spear_Temp_Loc[1] facing Spear_Direction[Spear_Int] degrees
        Set Spear_Flying[Spear_Int] = (Last created unit)
        -------- -------------------- --------
        Set Spear_Int = (Spear_Int + 1)
        Set Spear_Caster[Spear_Int] = (Triggering unit)
        Set Spear_Direction[Spear_Int] = (Angle from Spear_Temp_Loc[1] to Spear_Temp_Loc[4])
        Set Spear_Curdis[Spear_Int] = 0.00
        Set Spear_Damage[Spear_Int] = Spear_DMG
        Set Spear_MaxDis[Spear_Int] = Spear_MaxD
        Unit - Create 1 Spear_Rawcode for (Owner of (Triggering unit)) at Spear_Temp_Loc[1] facing Spear_Direction[Spear_Int] degrees
        Set Spear_Flying[Spear_Int] = (Last created unit)
        -------- -------------------- --------
        Custom script:   call RemoveLocation(udg_Spear_Temp_Loc[1])
        Custom script:   call RemoveLocation(udg_Spear_Temp_Loc[2])
        Custom script:   call RemoveLocation(udg_Spear_Temp_Loc[3])
        Custom script:   call RemoveLocation(udg_Spear_Temp_Loc[4])

SpearFly
    Events
        Time - Every 0.04 seconds of game time
    Conditions
        Spear_Int greater than 0
    Actions
        For each (Integer A) from 1 to Spear_Int, do (Actions)
            Loop - Actions
                Set Spear_Temp_Loc[1] = (Position of Spear_Flying[(Integer A)])
                Set Spear_Temp_Loc[2] = (Spear_Temp_Loc[1] offset by Spear_Speed towards Spear_Direction[(Integer A)] degrees)
                Unit - Move Spear_Flying[(Integer A)] instantly to Spear_Temp_Loc[2]
                Set Spear_Curdis[(Integer A)] = (Spear_Curdis[(Integer A)] + Spear_Speed)
                Set Spear_Temp_Group = (Units within Spear_PickRange of Spear_Temp_Loc[2] matching ((((Matching unit) is alive) Gleich True) and (((Matching unit) belongs to an enemy of (Owner of Spear_Flying[(Integer A)])) Gleich True)))
                Custom script:   call RemoveLocation(udg_Spear_Temp_Loc[1])
                Custom script:   call RemoveLocation(udg_Spear_Temp_Loc[2])
                UnitenGroup - Pick every unit in Spear_Temp_Group and do (Actions)
                    Loop - Actions
                        Set Spear_Release = True
                        Unit - Cause Spear_Caster[(Integer A)] to damage (Picked unit), dealing Spear_Damage[(Integer A)] damage of attack Spells and damage type Normal
                Custom script:   call DestroyGroup(udg_Spear_Temp_Group)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    'IF'-Condtitions
                        (Spear_Release equal to True) or (Spear_Curdis[(Integer A)] greater than or equal to Spear_MaxDis[(Integer A)])
                    'THEN'-Actions
                        Unit - Kill Spear_Flying[(Integer A)]
                        Set Spear_Damage[(Integer A)] = Spear_Damage[Spear_Int]
                        Set Spear_Curdis[(Integer A)] = Spear_Curdis[Spear_Int]
                        Set Spear_Direction[(Integer A)] = Spear_Direction[Spear_Int]
                        Set Spear_Flying[(Integer A)] = Spear_Flying[Spear_Int]
                        Set Spear_Caster[(Integer A)] = Spear_Caster[Spear_Int]
                        Set Spear_MaxDis[(Integer A)] = Spear_MaxDis[Spear_Int]
                        Set Spear_Int = (Spear_Int - 1)
                    'ELSE'-Actions
                Set Spear_Release = False

Ball (well, its more a rock than a ball)

Launches a ball towards the target location. If a unit comes into its way the ball will explode and the unit will be knockbacked and take damage.

Screenshot:
ballaz0.jpg

Code (another translation):

Code:
BallCast
    Events
        Unit - A unit starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Ball 
    Actions
        -------- CONFIGURATION --------
        -------- Unit Rawcode --------
        Set Ball_UnitType = Bullet
        -------- Damage Calculation --------
        Set Ball_damage = (50.00 + (50.00 x (Real((Level of Ball  for (Triggering unit))))))
        -------- Slide Distance --------
        Set Ball_maxdist = 200.00
        -------- Fly Speed --------
        Set Ball_flyspeed = 25.00
        -------- Slide Speed --------
        Set Ball_slidespeed = 10.00
        -------- Slide SFX --------
        Set Ball_SFX = Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
        -------- Collision Range --------
        Set Ball_PickRange = 140.00
        -------- ------------- --------
        -------- SPELL BEGINS --------
        -------- ------------- --------
        Set Ball_temp_loc[1] = (Position of (Triggering unit))
        Set Ball_temp_loc[2] = (Target point of ability being cast)
        Set Ball_Int_1 = (Ball_Int_1 + 1)
        Set Ball_damagetodo[Ball_Int_1] = Ball_damage
        Set Ball_maxflydis[Ball_Int_1] = (Distance between Ball_temp_loc[1] and Ball_temp_loc[2])
        Set Ball_caster[Ball_Int_1] = (Triggering unit)
        Set Ball_curflydis[Ball_Int_1] = 0.00
        Unit - Create 1 Ball_UnitType for (Owner of (Triggering unit)) at Ball_temp_loc[1] facing Vorgabe für Gebäude-Ausrichtung degrees
        Set Ball_Bullet[Ball_Int_1] = (Last created unit)
        Set Ball_angle[Ball_Int_1] = (Angle from Ball_temp_loc[1] to Ball_temp_loc[2])
        Custom script:   call RemoveLocation(udg_Ball_temp_loc[1])
        Custom script:   call RemoveLocation(udg_Ball_temp_loc[2])

Code:
BallFlight
    Events
        Time - Every 0.04 seconds of game time
    Conditions
        Ball_Int_1 greater than 0
    Actions
        For each (Integer A) from 1 to Ball_Int_1, do (Actions)
            Loop - Actions
                Set Ball_temp_loc[1] = (Position of Ball_Bullet[(Integer A)])
                Set Ball_temp_loc[2] = (Ball_temp_loc[1] offset by Ball_flyspeed towards Ball_angle[(Integer A)] degrees)
                Custom script:   call RemoveLocation(udg_Ball_temp_loc[1])
                Unit - Move Ball_Bullet[(Integer A)] instantly to Ball_temp_loc[2]
                Set Ball_unit_group = (Units within Ball_PickRange of Ball_temp_loc[2] matching ((((Matching unit) is alive) Gleich True) and ((Ball_Bullet[(Integer A)] belongs to an enemy of (Owner of (Matching unit))) Gleich True)))
                Unitgroup - Pick every unit in Ball_unit_group and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            'IF'-Conditions
                                Ball_sliding[(Custom value of (Picked unit))] equal to False
                            'THEN'-Actions
                                Set Ball_Release = True
                                Unit - Cause Ball_caster[(Integer A)] to damage (Picked unit), dealing Ball_damagetodo[(Integer A)] damage of attack type Zaubersprüche and damage type Normal
                                Set Ball_Int_2 = (Ball_Int_2 + 1)
                                Set Ball_sliding[(Custom value of (Picked unit))] = True
                                Set Ball_toSlide[Ball_Int_2] = (Picked unit)
                                Set Ball_temp_loc[3] = (Position of (Picked unit))
                                Set Ball_slideangle[Ball_Int_2] = (Angle from Ball_temp_loc[2] to Ball_temp_loc[3])
                                Set Ball_curslidedis[Ball_Int_2] = 0.00
                                Unit - Turn collision for (Picked unit) Aus
                                Custom script:   call RemoveLocation(udg_Ball_temp_loc[3])
                            'ELSE'-Actions
                Custom script:   call DestroyGroup(udg_Ball_unit_group)
                Set Ball_curflydis[(Integer A)] = (Ball_curflydis[(Integer A)] + Ball_flyspeed)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    'IF'-Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                Ball_curflydis[(Integer A)] Greater than or equal to Ball_maxflydis[(Integer A)]
                                Ball_Release equal to True
                    'THEN'-Actions
                        Unit - Kill Ball_Bullet[(Integer A)]
                        Set Ball_Bullet[(Integer A)] = Ball_Bullet[Ball_Int_1]
                        Set Ball_angle[(Integer A)] = Ball_angle[Ball_Int_1]
                        Set Ball_maxflydis[(Integer A)] = Ball_maxflydis[Ball_Int_1]
                        Set Ball_curflydis[(Integer A)] = Ball_curflydis[Ball_Int_1]
                        Set Ball_caster[(Integer A)] = Ball_caster[Ball_Int_1]
                        Set Ball_Int_1 = (Ball_Int_1 - 1)
                    'ELSE'-Actions
                Set Ball_Release = False
                Custom script:   call RemoveLocation(udg_Ball_temp_loc[2])

Code:
BallSlide
    Events
        Time - Every 0.04 seconds of game time
    Conditions
        Ball_Int_2 greater than 0
    Actions
        Set Ball_EYECANDYINT = (Ball_EYECANDYINT + 1)
        For each (Integer A) from 1 to Ball_Int_2, do (Actions)
            Loop - Actions
                Set Ball_temp_loc[1] = (Position of Ball_toSlide[(Integer A)])
                Set Ball_temp_loc[2] = (Ball_temp_loc[1] offset by Ball_slidespeed towards Ball_slideangle[(Integer A)] degrees)
                Custom script:   call RemoveLocation(udg_Ball_temp_loc[1])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    'IF'-Conditions
                        (Ball_EYECANDYINT mod 8) equal to 0
                    'THEN'-Actions
                        Spezialeffekt - Create a special effect at Ball_temp_loc[2] using Ball_SFX
                        Spezialeffekt - Destroy (Last created special effect)
                    'ELSE'-Actions
                Unit - Move Ball_toSlide[(Integer A)] instantly to Ball_temp_loc[2]
                Custom script:   call RemoveLocation(udg_Ball_temp_loc[2])
                Set Ball_curslidedis[(Integer A)] = (Ball_curslidedis[(Integer A)] + Ball_slidespeed)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    'IF'-Conditions
                        Ball_curslidedis[(Integer A)] greater than or equal to Ball_maxdist
                    'THEN'-Actions
                        Unit - Turn collision for Ball_toSlide[(Integer A)] Ein
                        Set Ball_sliding[(Custom value of Ball_toSlide[(Integer A)])] = False
                        Set Ball_toSlide[(Integer A)] = Ball_toSlide[Ball_Int_2]
                        Set Ball_slideangle[(Integer A)] = Ball_slideangle[Ball_Int_2]
                        Set Ball_curslidedis[(Integer A)] = Ball_curslidedis[Ball_Int_2]
                        Set Ball_Int_2 = (Ball_Int_2 - 1)
                    'ELSE'-Actions


Import Instructions Inside, download here:
 

Attachments

  • Ball and Spear Throw.w3x
    27.7 KB · Views: 705

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
First thing I noticed from screenshot.. Change Art - Shadow Image (Unit) to flyer instead of normal for Spear Throw, it looks better that way. Other than that, I'll test it and see.
 

Trollvottel

never aging title
Reaction score
262
thx for the reply, i will change it :)

/edit: changed shadow image and also the model, now its a real spear
 
Reaction score
86
Lol, I was about to say that :D Could have used dryad projectile for spear.

Either way, nice spells. Pretty user friendly for people who don't know Jass too XD
 

quraji

zap
Reaction score
144
Some of the code is still in German, could be confusing ;)

Namely in the If statements...Gleich...or "is", "equals".


I didn't try the spells but they look nice :)
 

Romek

Super Moderator
Reaction score
964
The spears don't explode. According to the description, they should.
 

Trollvottel

never aging title
Reaction score
262
right, it did before when i used the ballista model :p. thx for the replies

/edit: made code more english
 

Furberg

Ultra Cool Member
Reaction score
45
that cute dancing avatar deserves a comment. Well unfortunately i got no WC3 or WE around me in the next few days, so i can't test it sorry ^^ but i really like the spear spell. Btw does the ball bounce?

EDIT: oh it don't ._. You should make it bounce :p
 

Kazuga

Let the game begin...
Reaction score
110
Hm the ball is a bit like my rocket launcher spell in the Spells section. Good job though.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Very nice spellpack!

Well done for a GUI submission, especially because of the MUI factor.


I tested the map and the spells were working correctly, but on one occasion, the spear got stuck and left floating in the air.

stuck.jpg


Anyway, resource approved.
 
D

dxthegreat

Guest
Just wondering... you made the arrays size 1, but u seem to access parts of the array more than that are indexed greater than 0...

(e.g)
Code:
Set Ball_curslidedis[(Integer A)] = (Ball_curslidedis[(Integer A)] + Ball_slidespeed)

From my c programming, that's syntactically valid... but a huge faux pas

I was wondering if there would be any potential problems with doing that...
 

Trollvottel

never aging title
Reaction score
262
array size in Jass is always 8192. in GUI "size" is just the value to which the array is initialized. but because it set it to 0 at spell start, i dont have to initialize it at map init.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top