All times are UTC


Dear guest, welcome to YouTD!

Ball Lightning by axllow
Name General Description
Ball Lightning v5
718
RARE
General
Wave lvl: 29

Submission
By: axllow
Date:2018-09-28 22:24:46
Status: APPROVED
ID:492
Last Update:2018-10-18 23:07:41
Description
It ' s a hot potato.

Abilities
Ball Lightning
Every 3 seconds this item jumps to another tower. If no other tower in 1500 range has an empty slot, this item will fly to stash.
Specials

+150% attackspeed


Reply to topic

Discussion

Page 1 of 1 [ 13 posts ] 
Author Message
 Post subject: Ball Lightning v5 (492)
PostPosted: Fri Sep 28, 2018 8:24 pm 
Offline
Advanced User

Joined: Fri Jun 24, 2011 5:52 am
Posts: 129
This is the discussion thread for the item Ball Lightning (492)

Creator's comments for this item:


Top
 Profile  
 
 Post subject: Re: Ball Lightning v1 (492)
PostPosted: Fri Sep 28, 2018 8:29 pm 
Offline
Advanced User

Joined: Fri Jun 24, 2011 5:52 am
Posts: 129
This method i was using as dummy for pickup in test map. Admins please test it with real one. Maybe i need to drop item before pickup?
        method pickup takes Tower twr returns nothing
            call UnitAddItem(twr.getUnit(), getItem())
        endmethod


Top
 Profile  
 
 Post subject: Re: Ball Lightning v1 (492)
PostPosted: Sat Sep 29, 2018 2:15 am 
Offline
YouTD Admin
YouTD Admin

Joined: Sat Jan 16, 2010 2:35 am
Posts: 1888
We really should update the DevKit sometime.

The real Item.pickup is essentially just UnitAddItem, but it also checks tower inventory, returns false if tower had full inventory, true if not (e.g. tower was able to pick the item up) - it also does some fullmap specific things in fullmap.
Item.pickup
//Given tower picks up this item (also changes item's owner, so be careful with the tower)
//returns false if tower had full inventory
method pickup takes Tower tower returns boolean
    if UnitInventorySize(tower.u) - UnitInventoryCount(tower.u) > 0 then
        call UnitAddItem(tower.u,.theItem)
        return true
    endif
    return false
endmethod

Item is working as intended. You can check the sequencing by adding BJDebugMsgs to Item.handleItemDrop and Item.handleItemPickup.

You should use Iterate.nextRandom unless there's a reason to do the randomimzation manually.


Top
 Profile  
 
 Post subject: Update to version v2!
PostPosted: Tue Oct 02, 2018 7:20 pm 
Offline
Advanced User

Joined: Fri Jun 24, 2011 5:52 am
Posts: 129
The item has been updated to version v2!

Creator's reason for this update:

Iterate.nextRandom to get Tower and relying on internal pickup method to check inventory size.


Top
 Profile  
 
 Post subject: Re: Ball Lightning v2 (492)
PostPosted: Tue Oct 02, 2018 8:36 pm 
Offline
YouTD Admin
YouTD Admin

Joined: Sat Jan 16, 2010 2:35 am
Posts: 1888
Need to specifically clean up the Iterate now if it wasn't exhausted.


Top
 Profile  
 
 Post subject: Update to version v3!
PostPosted: Sat Oct 06, 2018 9:13 am 
Offline
Advanced User

Joined: Fri Jun 24, 2011 5:52 am
Posts: 129
The item has been updated to version v3!

Creator's reason for this update:

Iterate cleanup.


Top
 Profile  
 
 Post subject: Re: Ball Lightning v3 (492)
PostPosted: Sat Oct 06, 2018 9:45 am 
Offline
YouTD Admin
YouTD Admin

Joined: Sat Jan 16, 2010 2:35 am
Posts: 1888
function Periodic takes Item itm returns nothing
    local Tower tower = itm.getCarrier()
    local Iterate towersInRange = Iterate.overUnitsInRangeOfCaster(tower, TARGET_TYPE_PLAYER_TOWERS, 1500.00)
    local Tower towerInRange
    loop
        set towerInRange = towersInRange.nextRandom()
        exitwhen towerInRange == 0
        if towerInRange != tower and itm.pickup(towerInRange) then
            call Effect.createSimpleAtUnit("Doodads\\Cinematic\\Lightningbolt\\Lightningbolt.mdl", towerInRange)
            exitwhen true
        endif
    endloop
    if towerInRange != 0 then
        call towersInRange.destroy()
    else
        call itm.drop()
        call itm.flyToStash(0.0)
    endif
endfunction


Top
 Profile  
 
 Post subject: Update to version v4!
PostPosted: Wed Oct 17, 2018 6:02 pm 
Offline
Advanced User

Joined: Fri Jun 24, 2011 5:52 am
Posts: 129
The item has been updated to version v4!

Creator's reason for this update:

Code refactor suggested by Deemzul.


Top
 Profile  
 
 Post subject: Re: Ball Lightning v4 (492)
PostPosted: Wed Oct 17, 2018 7:57 pm 
Offline
User
User avatar

Joined: Thu Oct 04, 2018 7:35 pm
Posts: 82
I like this item, does it mean when there are only two towers with one empty slot in range, it will ping-pong between them? Could I just fill everything up besides two towers and let mass ball lightnings jump around between them?

_________________
Hit me up for some games or discussions on the YouTD Discord!


Top
 Profile  
 
 Post subject: Re: Ball Lightning v4 (492)
PostPosted: Wed Oct 17, 2018 8:42 pm 
Offline
YouTD Admin
YouTD Admin

Joined: Sat Jan 16, 2010 2:35 am
Posts: 1888
It turns out I gave you shit code, sorry about that. The Effect isn't destroyed - just need to:
call Effect.createSimpleAtUnit("Doodads\\Cinematic\\Lightningbolt\\Lightningbolt.mdl", towerInRange).setLifetime(1)
Instant .destroy() doesn't let the effect play out (because it's a stand animation?). For example, if you set the lifetime at 0.1, it won't cause the dust effect to spawn.

The ability tooltip should also be polished:
Ball Lightning
Every 3 seconds this item jumps to another tower. If no other tower in 1500 range has an empty slot, this item will fly to stash.


It also turns out that, the code change I suggested about using the Item.pickup()'s checks for your loop actually makes it harder to answer the balance question wudijo brought up about e.g. 4 ball lightnings jumping between just two towers for constant 300% IAS on both, since you can't do an effect like "requires at least 3 towers with an empty slot in range" with .pickup() as it creates item pickup events every time and that's super ugly.

We do have a countFreeSlots method, too, but I didn't want to bring it unnecessarily since it's just UnitInventorySize(.u) - UnitInventoryCount(.u) - and it might still be unnecessary to bring up, depending on how you want to answer the balance question ---
I'd suggest one of the following:
-the mechanical change I talked about here (most effort)
-increased gold cost
-decreased attack speed
struct Tower
...
        //Returns the number of free inventory slots on this Tower
        method countFreeSlots takes nothing returns integer
            local integer numSlots
            local integer i = 0
            local integer i2 = 0
            set numSlots = UnitInventorySize(this.u)
            loop
                exitwhen i2 >= numSlots
                if (UnitItemInSlot(this.u,i2) != null) then
                    set i = i + 1
                endif
                set i2 = i2 + 1
            endloop
            return numSlots - i
        endmethod


Top
 Profile  
 
 Post subject: Update to version v5!
PostPosted: Thu Oct 18, 2018 9:07 pm 
Offline
Advanced User

Joined: Fri Jun 24, 2011 5:52 am
Posts: 129
The item has been updated to version v5!

Creator's reason for this update:

Tooltip. Jump now has visual animation, during jump item is not active.


Top
 Profile  
 
 Post subject: Approved!
PostPosted: Thu Oct 18, 2018 10:46 pm 
Offline
YouTD Admin
YouTD Admin

Joined: Sat Jan 16, 2010 2:35 am
Posts: 1888
This item has been approved!
It will be in the next version of YouTD!


Top
 Profile  
 
 Post subject: Re: Ball Lightning v5 (492)
PostPosted: Tue Nov 06, 2018 1:11 am 
Offline
YouTD developer
YouTD developer
User avatar

Joined: Wed Dec 29, 2010 12:20 pm
Posts: 4527
Location: Australia
Really cool design!

_________________
Goldcost to waveLevel & elementLevel relationship
Incremental Testmap Stub & Tower Creation Map


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group