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



Reply
 
Thread Tools Search this Thread
Old 01-27-2010, 10:38 AM   #331
Sinnergy
User
 
Sinnergy's Avatar
 
Join Date: Apr 2009
Posts: 173

Sinnergy has little to show at this moment (8)

Default

thanks, lol I forgot about it
__________________
Current Project:
Rise of Sinnergy v1.00
Sinnergy is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-30-2010, 09:07 AM   #332
Sinnergy
User
 
Sinnergy's Avatar
 
Join Date: Apr 2009
Posts: 173

Sinnergy has little to show at this moment (8)

Default

My game crashes because of this code. What the spell does is pick 1 random unit nearby periodically until there is no valid units nearby, in the loop block, it creates an instance of xecollider to be fired to the picked unit. A picked unit is added into a global group to prevent the spell by picking the same unit again.

Here's the code:
Collapse JASS:
scope ScatterShot initializer onInit

    globals
        private constant integer spell = 'A01Z'
        private constant string mdl = "Abilities\\Weapons\\Arrow\\ArrowMissile.mdl"
        private constant string sfx = "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
        private group f
    endglobals
    
    private struct data
        unit c
        integer l
        private method onDestroy takes nothing returns nothing
            call PauseUnit(c,false)
            call SetUnitTimeScale(c,1.0)
            call SetUnitAnimation(c,"stand ready")
            call GroupClear(f)
        endmethod
    endstruct
    
    private struct aCollider extends xecollider
        unit c
        unit h
        integer l
        
        private method onUnitHit takes unit t returns nothing
            if IsUnitEnemy(t,GetOwningPlayer(c)) and GetWidgetLife(t) > 0.405 and not IsUnitType(t,UNIT_TYPE_STRUCTURE) and GetUnitAbilityLevel(t,'mark') == 0 then
                call UnitDamageTarget(c,t,75*l,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,null)
                call DestroyEffect(AddSpecialEffectTarget(sfx,t,"chest"))
                if t == h then
                    call terminate()
                endif
            endif
        endmethod
        
        private method loopControl takes nothing returns nothing
            if GetWidgetLife(h) <= 0.405 then
                call terminate()
            endif
        endmethod
    endstruct
    
    private function filt takes nothing returns boolean
        return GetWidgetLife(GetFilterUnit()) > 0.405 and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and GetUnitAbilityLevel(GetFilterUnit(),'mark') == 0  and not IsUnitInGroup(GetFilterUnit(),f)
    endfunction
    
    private function callBack takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local data d = GetTimerData(t)
        local group g = NewGroup()
        local unit u
        local unit tmp = null
        local real x = GetUnitX(d.c)
        local real y=GetUnitY(d.c)
        local real tx
        local real ty
        local real a
        local aCollider xe
        call SetUnitTimeScale(d.c,4.0)
        call PauseUnit(d.c,true)
        call GroupEnumUnitsInRange(g,GetUnitX(d.c),GetUnitY(d.c),1300.0,Condition(function filt))
        loop
            set u = FirstOfGroup(g)
            exitwhen u == null
            if IsUnitEnemy(u,GetOwningPlayer(d.c)) and tmp == null then
                set tmp = u
                call GroupAddUnit(f,u)
                set tx = GetUnitX(tmp)
                set ty = GetUnitY(tmp)
                set a = Atan3(x,y,tx,ty)
                call SetUnitFacingTimed(d.c,a*57.29582,0.0)
                call SetUnitAnimation(d.c,"attack")
                set xe = aCollider.create(x,y,a)
                set xe.c = d.c
                set xe.l = d.l
                set xe.h = tmp
                set xe.fxpath = mdl
                set xe.z = 50.0
                set xe.scale = 1.3
                set xe.collisionSize = 100.0
                set xe.speed = 1200
                set xe.angleSpeed = bj_PI * 4.0
                set xe.targetUnit = tmp
            endif
            call GroupRemoveUnit(g,u)
        endloop
        call ReleaseGroup(g)
        if tmp == null or GetWidgetLife(d.c) <= 0.405 then
            call ReleaseTimer(t)
            call d.destroy()
        endif
        set t = null
        set u = null
        set tmp = null
        set g = null
    endfunction
    
    private function act takes nothing returns nothing
        local timer t = NewTimer()
        local data d = data.create()
        local unit c = SpellEvent.CastingUnit
        local integer l = GetUnitAbilityLevel(c,spell)
        set d.c = c
        set d.l = l
        call SetTimerData(t,d)
        call TimerStart(t,0.3,true,function callBack)
        set t = null
        set c = null
    endfunction
    
    private function onInit takes nothing returns nothing
        call RegisterSpellEffectResponse(spell,act)
        set f = CreateGroup()
    endfunction
endscope

Edit:
Unfortunately, I got something to add, I also have this spell that causes crash, I don't know if this is still under the xecollider category, but looks like the crash was caused by some for loop which I used to loop through the units inside the group. The crash occurs right after the unit was killed using the spell (also the same situation with another spell inside my map which uses for loop).

Expand Zinc:

offtopic: how to replicate this in zinc?
Collapse JASS:
loop
      set u = FirstOfGroup(g)
      exitwhen u == null
      //do actions
      call GroupRemoveUnit(g,u)
endloop
__________________
Current Project:
Rise of Sinnergy v1.00

Last edited by Sinnergy : 01-30-2010 at 09:39 AM.
Sinnergy is offline   Reply With Quote
Old 02-03-2010, 10:05 AM   #333
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Very nice use and example for delegate. Thanks.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 02-03-2010, 11:42 AM   #334
Kueken
User
 
Join Date: Mar 2009
Posts: 149

Kueken will become famous soon enough (41)Kueken will become famous soon enough (41)

Default

I have a suggestion for xecollider. Could you implement a projectile arc member, making the missile behave like projectiles using the projectile arc field for ranged attacking units?
Currently, I have to use loopControl for it, which works, but I think it would make sense to implement this to xecollider itself.

Last edited by Kueken : 02-03-2010 at 11:43 AM.
Kueken is offline   Reply With Quote
Old 02-03-2010, 11:52 AM   #335
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

I said this too, however, I decided to make my own engine which does have xecollider features but aswell a lot more.

Its not that hard actually and xecollider is getting old.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 02-03-2010, 12:53 PM   #336
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by Anachron
Its not that hard actually and xecollider is getting old.

NOT.
Its still up to date, and only cause you arent smart enough to use it, you dont have to flame this...
__________________
akolyt0r is offline   Reply With Quote
Old 02-03-2010, 01:00 PM   #337
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Originally Posted by akolyt0r
NOT.
Its still up to date, and only cause you arent smart enough to use it, you dont have to flame this...
O'really?

Collapse JASS:
if(ns<=0) then
    set ns=-ns
endif
Should be

Collapse JASS:
if ns < 0. then
    set ns = -ns
endif
. There is no point in switching to a negative 0.

Collapse JASS:
set this=.V[i] //adopt-a-instance
set .V[c]=this
set c=c+1
set xecollider.N=c
Ohreally? There are better indexing methods than this. A lot.

Only two small shots and I took that out without even looking. There are many more things that are just ugly.

I have been using this, however, it doesn't give me all of the functions I need.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 02-03-2010 at 01:11 PM.
Anachron is offline   Reply With Quote
Old 02-03-2010, 01:24 PM   #338
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

he first thing wont do ANY harm...
and for the second one ... show me one other method which is faster than this ...
__________________
akolyt0r is offline   Reply With Quote
Old 02-05-2010, 09:42 AM   #339
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Its not about that it doesn't work, its about that it can be better.
Currently, xe does not remove the instances from the array, so it
might cause bugs when linked with another system.

Other thing:
You can't interact with the dummy unit.

And there is no default arc method. I know, those things are kinda small, but together they 'force' me to create my own system.

It isn't bad at all, it just doesn't fit to my personal functionality.
----

You could support IDDS as optional and use IDDS damage function. That would be really great.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 02-05-2010 at 09:43 AM.
Anachron is offline   Reply With Quote
Old 03-01-2010, 06:57 AM   #340
Kueken
User
 
Join Date: Mar 2009
Posts: 149

Kueken will become famous soon enough (41)Kueken will become famous soon enough (41)

Default

Suggestion: Add a new member to xedamage called damageInvulnerable

Might sound stupid, but actually "damaging" invulnerable units causes them to react to the damage, for example engaging the target or retreating if target is not attackable. Currently, there is no possibility to avoid this using .damageAOE. You have to do a vulnerability check yourself and use damageTarget or -Group.

Last edited by Kueken : 03-01-2010 at 06:58 AM.
Kueken is offline   Reply With Quote
Old 03-01-2010, 07:07 PM   #341
TheKid
User
 
TheKid's Avatar
 
Join Date: Mar 2009
Posts: 195

TheKid will become famous soon enough (37)TheKid will become famous soon enough (37)

Default

Quote:
Originally Posted by Tot
for what is XE_TREE_RECOGNITION?

Searching through hard-coded destructible IDs is a waste of resources, especially when you can just order a dummy-caster to use XE_TREE_RECOGNITION and determine whether or not the order returned true or false.

If it returns true, then the target destructible is a tree. If false, then it is not.
TheKid is offline   Reply With Quote
Old 04-21-2010, 03:04 PM   #342
ahlee2326
User
 
Join Date: Sep 2006
Posts: 2

ahlee2326 has little to show at this moment (0)

Default

hi, can i ask how to implement a visible dummy spell with xe? or have other better way to implement it?

Example,
create a dummy blademaster with whirlwind to a point...
ahlee2326 is offline   Reply With Quote
Old 04-11-2011, 08:22 AM   #343
AzuhaSky
User
 
AzuhaSky's Avatar
 
Join Date: Mar 2011
Posts: 20

AzuhaSky has little to show at this moment (0)

Default

Hi Vexorian!Why i can't use xecast system?I was make like as you Example!But it nothing!
__________________
AzuhaSky is offline   Reply With Quote
Old 07-08-2011, 09:39 AM   #344
DanThanh
User
 
DanThanh's Avatar
 
Join Date: Apr 2009
Posts: 137

Submissions (1)

DanThanh has little to show at this moment (7)

Send a message via Yahoo to DanThanh
Default

Hello, how do i create a fx without death animation?
I mean it will just simply disappear instead of playing it's ugly death animation !
__________________
DanThanh is offline   Reply With Quote
Old 07-08-2011, 10:51 AM   #345
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Use the .hiddenDestroy() method.
__________________

Last edited by Anitarf : 07-08-2011 at 10:51 AM.
Anitarf 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 09:03 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2020, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services