HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

PLS help i can't get it to work :(

05-24-2008, 12:15 PM#1
v16
i want to make it so when the missle hit to spawn a dummy unit that knockbacks the unit thats hit with a dummy spell
Trigger:
Abi Init
Collapse Events
Map initialization
Conditions
Collapse Actions
Set Abi_Elune_EluneArrow = Elune's Arrow
Set UnitType_Elune_Dummy = Elune's Arrow Dummy
Trigger:
Start
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Abi_Elune_EluneArrow
Collapse Actions
Set ff = (Triggering unit)
Set Pt_Elune_TriggerPos = (Position of (Triggering unit))
Set Pt_Elune_TargetPos = (Target point of ability being cast)
Unit - Create 1 UnitType_Elune_Dummy for (Owner of (Triggering unit)) at Pt_Elune_TriggerPos facing (Angle from Pt_Elune_TriggerPos to Pt_Elune_TargetPos) degrees
Unit - Turn collision for (Last created unit) Off
Unit - Add Abi_Elune_EluneArrow to (Last created unit)
Unit - Set level of Abi_Elune_EluneArrow for (Last created unit) to (Level of Abi_Elune_EluneArrow for (Triggering unit))
Unit Group - Add (Last created unit) to Unitgp_Elune_Dummy
Trigger - Turn on Movement <gen>
Custom script: call RemoveLocation (udg_Pt_Elune_TriggerPos)
Custom script: call RemoveLocation (udg_Pt_Elune_TargetPos)
Trigger:
Movement
Collapse Events
Time - Every 0.01 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Unitgp_Elune_Dummy and do (Actions)
Collapse Loop - Actions
Set Pt_Elune_DummyPos = (Position of (Picked unit))
Set Pt_Elune_TargetPos = (Pt_Elune_DummyPos offset by 10.00 towards (Facing of (Picked unit)) degrees)
Unit - Move (Picked unit) instantly to Pt_Elune_TargetPos
Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
Set Unitgp_Elune_AOEdetect = (Units within 90.00 of Pt_Elune_DummyPos matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True))))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in Unitgp_Elune_AOEdetect) Not equal to 0
Collapse Then - Actions
Set Unit_Elune_DetectedUnit = (Random unit from Unitgp_Elune_AOEdetect)
Unit - Create 1 Elune's Arrow Stun Dummy for (Owner of ff) at (Position of Unit_Elune_DetectedUnit) facing Default building facing degrees
Set damagedunit = (Last created unit)
Unit - Add Elune's Arrow Stun Dummy to damagedunit
Unit - Order damagedunit to Human Mountain King - Storm Bolt Unit_Elune_DetectedUnit
Special Effect - Create a special effect at Pt_Elune_DummyPos using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Remove (Picked unit) from the game
Else - Actions
Custom script: call DestroyGroup (udg_Unitgp_Elune_AOEdetect)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Picked unit)) Greater than or equal to 100
Collapse Then - Actions
Unit - Remove (Picked unit) from the game
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Custom script: call RemoveLocation (udg_Pt_Elune_DummyPos)
Custom script: call RemoveLocation (udg_Pt_Elune_TargetPos)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in Unitgp_Elune_Dummy) Equal to 0
Collapse Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Trigger:
Knockback Cast Copy
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Elune's Arrow Stun Dummy
Collapse Actions
Set Temp_Int = 0
Set Timer_Delay = 0.03
Set Caster = damagedunit
Set Caster_Loc = Pt_Elune_TriggerPos
Set Knockback_Value = 10.00
Set Knockback_Group = knock
Countdown Timer - Start Knockback_Timer_Copy as a Repeating timer that will expire in Timer_Delay seconds
Wait 1.25 seconds
Countdown Timer - Pause Knockback_Timer_Copy
Custom script: call RemoveLocation(udg_Caster_Loc)
Custom script: call DestroyGroup(udg_Knockback_Group)
Trigger:
Knock Targets Back Copy
Collapse Events
Time - Knockback_Timer_Copy expires
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Knockback_Group and do (Actions)
Collapse Loop - Actions
Set Knockback_Target_Loc = (Position of (Picked unit))
Set Knockback_Target_Loc_Offset = (Knockback_Target_Loc offset by Knockback_Value towards (Angle from Caster_Loc to Knockback_Target_Loc) degrees)
Unit - Move (Picked unit) instantly to Knockback_Target_Loc_Offset
Custom script: call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AItb\\AItbTarget.mdl", GetEnumUnit(), "chest"))
Custom script: call RemoveLocation(udg_Knockback_Target_Loc)
Custom script: call RemoveLocation(udg_Knockback_Target_Loc_Offset)
05-24-2008, 02:53 PM#2
d07.RiV
I havent read it all, but you seem to remove the dummy unit right after issuing cast order. This will obviously not work since the unit needs some time to throw the bolt. You will have to add the dummy unit into a global group and create another trigger that deletes the units in that group every x seconds (you can also give the dummy unit a custom value and decrease it in that trigger and remove the unit when the value reaches zero).
05-24-2008, 03:42 PM#3
v16
no it dosn't delete the casting unit the unit is stuned after the hit but no knockback from the spell
05-24-2008, 06:09 PM#4
d07.RiV
Oh sorry misread.
Ok, then. Where do you set the "knock" variable?
05-24-2008, 07:42 PM#5
v16
what you mean?
05-24-2008, 08:09 PM#6
Silvenon
He was probably referring to this line:

Trigger:
Set Knockback_Group = knock
05-24-2008, 08:32 PM#7
d07.RiV
Yes this is the only line where variable "knock" comes up. Probably this is the problem (since the group you knock back ends up being empty).
05-25-2008, 06:26 PM#8
v16
ok fixed that stuped problem but now it only works for 1 hit then the knockback isn't working
05-25-2008, 06:31 PM#9
Vestras
Quote:
Originally Posted by v16
ok fixed that stuped problem but now it only works for 1 hit then the knockback isn't working
are you sure you null the variables so that you can set them again?
05-26-2008, 12:28 PM#10
Silvenon
What? Globals aren't supposed to be nulled, well, you can null them, but it has no effect (because non-nulled globals don't leak).

I hate GUI, I really suck at it. I'm here just to make wise statements.
05-26-2008, 02:03 PM#11
Vestras
Quote:
Originally Posted by Silvenon
What? Globals aren't supposed to be nulled, well, you can null them, but it has no effect (because non-nulled globals don't leak).

I hate GUI, I really suck at it. I'm here just to make wise statements.

Seriusly? I didn't knew GUI was that.. boring (don't know what else to say).
05-26-2008, 07:57 PM#12
v16
ok so NOBODY here can't help me?
05-26-2008, 09:30 PM#13
Silvenon
It will help if you fix the code here also and not just in your map, because it's useful to know what that "knock" thing should actually be.

I'll look at it tomorrow.