Sajin
User title under construction.
- Reaction score
- 56
People of Thehelper I have a problem with a skill for my soon coming map. The skill is:
The soilder shoots a bullet and once the bullet comes in contact with the spefic enemy that it was shot it, that unit gets sent backwards.
Specifications: The bullet travels through a slide trigger (the bullet is a dummy unit)
The Skill is done in GUI and i would like to keep it that way
And i know the skills leaks and for me its fine atm but for whoever corrects me wants to throw the custom script in im fine with it =)
Problems: Currently the dummy unit isan't appearing when the skill is cast
and the Knockback is fairly jumpy, and finnaly the enemy unit becomes stunned for a long period of time when i dont want it too. Currently here are my triggers
Can anyone please help me
The soilder shoots a bullet and once the bullet comes in contact with the spefic enemy that it was shot it, that unit gets sent backwards.
Specifications: The bullet travels through a slide trigger (the bullet is a dummy unit)
The Skill is done in GUI and i would like to keep it that way
And i know the skills leaks and for me its fine atm but for whoever corrects me wants to throw the custom script in im fine with it =)
Problems: Currently the dummy unit isan't appearing when the skill is cast
and the Knockback is fairly jumpy, and finnaly the enemy unit becomes stunned for a long period of time when i dont want it too. Currently here are my triggers
Code:
Variables
KnockbackTable = Hashtable
PeneCaster = Unit Array
PeneTarget = Unit Array
peneCastLoc = Point Array
Bullet = Unit Array
KnockbackAngle = Real
KnockbackDistance = Real
RemainingTime = Real
BulletLoc = Point Array
KnockbackUnits = Unit Group
TempPoint = Point Array
Code:
HashTables
Events
Map initialization
Conditions
Actions
Hashtable - Create a hashtable
Set knockbackTable = (Last created hashtable)
Code:
KnockbackTarget
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Penetrating Shot
Actions
Set PeneCaster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
Set PeneTarget[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
Set peneCastLoc[(Player number of (Owner of (Casting unit)))] = (Position of (Casting unit))
Unit - Create 1 Bullet for (Owner of (Casting unit)) at peneCastLoc[(Player number of (Owner of (Casting unit)))] facing (Position of (Target unit of ability being cast))
Set Bullet[(Player number of (Owner of (Casting unit)))] = (Last created unit)
Unit - Add a 4.00 second Generic expiration timer to Bullet[(Player number of (Owner of (Casting unit)))]
Unit Group - Add Bullet[(Player number of (Owner of (Casting unit)))] to PeneBullets
Set KnockbackAngle = (Angle from (Position of Bullet[(Player number of (Owner of (Casting unit)))]) to (Position of (Target unit of ability being cast)))
Set KnockbackDistance = (300.00 x 0.04)
Set RemainingTime = 0.40
Hashtable - Save KnockbackDistance as (Key distance) of (Key (Target unit of ability being cast)) in knockbackTable
Hashtable - Save KnockbackAngle as (Key angle) of (Key (Target unit of ability being cast)) in knockbackTable
Hashtable - Save RemainingTime as (Key time) of (Key (Target unit of ability being cast)) in knockbackTable
Code:
Knockback Bullet Move
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in PeneBullets and do (Actions)
Loop - Actions
Set BulletLoc[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
Unit - Move (Picked unit) instantly to ((Position of PeneTarget[(Player number of Player 12 (Brown))]) offset by 11.00 towards (Facing of (Picked unit)) degrees)
Unit Group - Pick every unit in (Units within 100.00 of BulletLoc[(Player number of (Owner of (Picked unit)))]) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Picked unit) Equal to PeneTarget[(Player number of (Owner of (Picked unit)))]
Then - Actions
Unit Group - Add (Picked unit) to KnockbackUnits
Unit - Pause (Picked unit)
Else - Actions
Do nothing
Code:
KnockbackUnits
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in KnockbackUnits and do (Actions)
Loop - Actions
Set KnockbackDistance = (Load (Key distance) of (Key (Picked unit)) from knockbackTable)
Set KnockbackAngle = (Load (Key angle) of (Key (Picked unit)) from knockbackTable)
Set RemainingTime = (Load (Key time) of (Key (Picked unit)) from knockbackTable)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RemainingTime Greater than 0.00
Then - Actions
Unit - Remove Bullet[(Player number of (Owner of (Triggering unit)))] from the game
Set TempPoint[(Player number of (Owner of (Picked unit)))] = ((Position of (Picked unit)) offset by KnockbackDistance towards KnockbackAngle degrees)
Unit - Move (Picked unit) instantly to TempPoint[(Player number of (Owner of (Picked unit)))]
Hashtable - Save (RemainingTime - 0.04) as (Key time) of (Key (Picked unit)) in knockbackTable
Else - Actions
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in knockbackTable
Unit - Unpause (Picked unit)
Unit Group - Remove (Picked unit) from KnockbackUnits
Can anyone please help me