HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help

08-24-2004, 08:17 PM#1
sweet5
Ok, well I just dled ur caster system vex, its really nice . It's nice, very, took me awhile to figure it out seeing as how I dont know JASS very well but all ur comments helped a lot. but onto my quetsion.

I have a spell that Im making for the olmypics and I thought I could make it easier with your system, so I tried with your system, I got it all imported right, just the spell isnt working, maybe I forgot to change one of the lil feild or somthing in the call...JASS confusese me :\ . So anyway here is the trigger...

Code:
Chain Sheep
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Chain Sheep
    Actions
        Set UnitVar = (Target unit of ability being cast)
        Custom script:   call CasterCastAbility( GetOwningPlayer(udg_UnitVar), 'A002', "polymorph", udg_UnitVar, false)
08-24-2004, 08:31 PM#2
Vexorian
that Polymorph ability A002 can target selft, right?
08-24-2004, 08:33 PM#3
sweet5
Im not targeting the caster, if u look at the first line it says

set unitvar = target unit of ability being cast and I set the last thing so false...so I dont know what else I forgot...
08-24-2004, 08:37 PM#4
Vexorian
Then it targets allies? cause you are making the function to work for the owner of unitvar

Go
GetOwningPlayer(GetTriggerUnit())
would be the owner of the triggering unit
08-24-2004, 08:41 PM#5
sweet5
well u see I didnt get this part --> GetOwningPlayer(GetTriggerUnit()) so I just left it how it was :\
08-24-2004, 08:47 PM#6
Vexorian
I got it, A unit finishes casting an ability DOESN'T HAVE target EVENt responses, you should use A unit starts the effect of an ability


And, CasterCastAbility 's first argument is a player one, that specifies the player that will own the caster that will cast the ability.

You are currently using

GetOwningPlayer(udg_UnitVar)

That means the owner of the UnitVar unit, the UnitVar unit in your trigger is the target of the ability, so there is something wrong with it

GetOwningPlayer(GetTriggerUnit())

Code:
Chain Sheep
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Chain Sheep
    Actions
        Set UnitVar = (Target unit of ability being cast)
        Custom script:   call CasterCastAbility( GetOwningPlayer(GetTriggerUnit()), 'A002', "polymorph", udg_UnitVar,  true) 

MEans the owner of the triggering unit ( GetTriggerUnit() == Triggering unit)
08-24-2004, 08:56 PM#7
sweet5
o_O can u try to use n00by terms? I dont really understand what u said sept GetOwningPlayer(GetTriggerUnit()) needs to say somthing else and I should use unit begins casting an ability...

EDIT: when I used unit begins casting an ability with my current trigger it crashed the game...man I suck at JASS lol


EDIT 2: OOOOH I think I get what u mean! ( GetOwningPlayer(udg_UnitVar) should mean get owned of caster becuz that is how it knows who to make the caster for?, but I have it say get owner of targeted unit so I need to change it.

EDIT 3... ok I tried
Code:
Chain Sheep Copy
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Chain Sheep
    Actions
        Set UnitVar = (Target unit of ability being cast)
        Set SweetsVar = (Triggering unit)
        Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A002', "polymorph", udg_UnitVar, false)


and it still didnt work :\
08-24-2004, 09:10 PM#8
Vexorian
Please tell me you aren't making it cast the same ability as the one in the condition, if that is happening, then that's why your game is crashing,

You'll need a wait before telling it to cast it

likelly

A unit starts the effect of an ability

Custom Script: local unit udg_UnitVar
set UnitVar to Target Unit of ability being cast
Wait 0 seconds
custom script: call CasterCastAbility( GetOwningPlayer(GetTriggerUnit()), 'A002', "polymorph", udg_UnitVar, true)
08-24-2004, 09:13 PM#9
sweet5
no Im not making it cast the same ability...why would I do that? o_O

"call CasterCastAbility( GetOwningPlayer(GetTriggerUnit()), 'A002', "polymorph", udg_UnitVar, true)" shouldnt it be FALSE seeing how is a negitive spell? or did I read somthing wrong? bah, I'll just test it as false...

EDIT:
Code:
Chain Sheep Copy
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Chain Sheep
    Actions
        Custom script:   local unit udg_UnitVar
        Set UnitVar = (Target unit of ability being cast)
        Wait 0.00 seconds
        Custom script:   call CasterCastAbility( GetOwningPlayer(GetTriggerUnit()), 'A002', "polymorph", udg_UnitVar, false)

didnt work
08-25-2004, 11:27 AM#10
Coffein
Quote:
Originally Posted by sweet5
no Im not making it cast the same ability...why would I do that? o_O

"call CasterCastAbility( GetOwningPlayer(GetTriggerUnit()), 'A002', "polymorph", udg_UnitVar, true)" shouldnt it be FALSE seeing how is a negitive spell? or did I read somthing wrong? bah, I'll just test it as false...

EDIT:
Code:
Chain Sheep Copy
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Chain Sheep
    Actions
        Custom script:   local unit udg_UnitVar
        Set UnitVar = (Target unit of ability being cast)
        Wait 0.00 seconds
        Custom script:   call CasterCastAbility( GetOwningPlayer(GetTriggerUnit()), 'A002', "polymorph", udg_UnitVar, false)

didnt work

Code:
Chain Sheep Copy
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain Sheep
    Actions
        Custom script:   local unit UnitVar
        Custom script:   set UnitVar = GetSpellTargetUnit()
        Wait 0.00 seconds
        Custom script:   call CasterCastAbility( GetOwningPlayer(GetSpellAbilityUnit()), 'A002', "polymorph", UnitVar, true)
08-25-2004, 06:30 PM#11
Vexorian
Ok, Finishes Casting an ability is not the event you must use, it is Starts casting an ability.

Finishes casting an ability DOESN'T HAVE A TARGET EVENT RESPONSE godamnit
08-25-2004, 07:39 PM#12
sweet5
meh, sorry vexorian, I forgot to say that I fixed it, now I just gotta figure out how to make is poly all targets... thx to some help I got this so far:

Code:
Chain Sheep
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain Lightning
    Actions
        Set SweetsVar = (Triggering unit)
        For each (Integer A) from 1 to ((Level of Chain Lightning for (Triggering unit)) x 2), do (Actions)
            Loop - Actions
                Set UnitVar[(Integer A)] = (Random unit from (Units within 500.00 of (Position of (Triggering unit)) matching (((Owner of (Triggering unit)) Equal to (Random player from (All enemies of (Owner of (Triggering unit))))) and ((UnitVar[(Integer A)] has buff Polymorph) Equal to False))))
                Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A000', "polymorph", udg_UnitVar[GetForLoopIndexA()], true)
08-26-2004, 01:33 AM#13
Coffein
Quote:
Originally Posted by Lord Vexorian
Ok, Finishes Casting an ability is not the event you must use, it is Starts casting an ability.

Finishes casting an ability DOESN'T HAVE A TARGET EVENT RESPONSE godamnit

Oups true :S
08-26-2004, 01:40 AM#14
Coffein
Quote:
Originally Posted by sweet5
meh, sorry vexorian, I forgot to say that I fixed it, now I just gotta figure out how to make is poly all targets... thx to some help I got this so far:

Code:
Chain Sheep
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain Lightning
    Actions
        Set SweetsVar = (Triggering unit)
        For each (Integer A) from 1 to ((Level of Chain Lightning for (Triggering unit)) x 2), do (Actions)
            Loop - Actions
                Set UnitVar[(Integer A)] = (Random unit from (Units within 500.00 of (Position of (Triggering unit)) matching (((Owner of (Triggering unit)) Equal to (Random player from (All enemies of (Owner of (Triggering unit))))) and ((UnitVar[(Integer A)] has buff Polymorph) Equal to False))))
                Custom script:   call CasterCastAbility( GetOwningPlayer(udg_SweetsVar), 'A000', "polymorph", udg_UnitVar[GetForLoopIndexA()], true)

You should really get used to avoid using "Triggering Unit", Blizzard added specific Event Responses for a reason.

Also, why are you using a unit array if you give the unit variable a new value for each integer anyway? Also for your random picking you should use "matching unit".
08-26-2004, 03:14 PM#15
Vexorian
Quote:
Originally Posted by Coffein
You should really get used to avoid using "Triggering Unit", Blizzard added specific Event Responses for a reason.

Also, why are you using a unit array if you give the unit variable a new value for each integer anyway? Also for your random picking you should use "matching unit".
You are totally wrong, Triggering Unit is far better , and actually the ability event responses act like global variables