- Joined
- Jun 16, 2008
- Messages
- 1,939
HI!
It's me again. I opened a thread concerning my Charge spell some time ago and since then I and Paladon (you might know him) both worked on the spell, but we couldnt fix it.
Today I made the whole spell MUI/MPI and overworked it completely, trying to find a bug. Apart from that I shortened it from 4 to 3 triggers implementing the fade system into the dummy trigger.
I will post the 3 triggers here with the hoping that some genius scripter @ thehive might be able to fix it...
I will comment on every trigger, what it is suppoesed to do and I will attach the map to this post.
To really understand the problem you will have to take a look at the map!!!!
Plz help me!!!
----Palaslayer----
So, here is the first trigger called ChargeCast. It is activ from the beginning and it detects when the Charge is casted. It sets some points, including the position of the target and the position of the caster.
Point 3 is an offset from the angle of point 1 towards point 2, where the caster will be moved to the first time. In addition this trigger prepars the other ones by hiding the charger and so on.
Now here is the second trigger which may be the main reason why the charge malfunctions (i will tell you the problem at the end of the post).
It runs every 0.04 seconds of game-time and creates the illusion of very fast movement.
Everytime it runs, the 3 locations which can also be found in the first trigger are set again, using the position of the caster and the target, and the caster is moved to the third location again while he still is hidden as well as a dummy unit is created which has the same model as the charger and faces the position of the target. It has no movementspeed and cannot be selected as a dummy is supposed to be.
The dummy is added to a unitgroup.
Now the dummy's movement animation is played and with the fade part of the trigger, everytime the trigger runs the transperency will be increased up to a certain point (90% transperency). At this point, the dummy unit is removed from the game as well as from the unit group where we added it before.
You may already see how the spell is supposed to work. We create a dummy every second and store it in a variable with an array. Using a loop we pick every dummy which exists at the moment, fade it and when the transperency reaches 90% we remove it.
Now, this only happens when the truth check reurns false.
At the point, where the distance between the caster and the target remains only 200 units or less, it is returned true and no more dummys will be created form this point on.
We run the final ChargeTrigger. The fade process will go on until the unitgroup is empty, then the trigger will be turned off.
Here is the trigger, it is active but not from the beginning:
Now, this is the final trigger. The charger is moved to point 3 a last time becomes unhidden and some special effects are attached. Damage is dealt and the KnockbackSystem from Paladon is initialized (there can be no fault, it works perfectly). It is active from the beginning but has no event.
Now, to give the final information, the problem is.
It works completely fine when i use it the firsttime. The second time, no dummies are created, the hcrager is only moved once and then the final trigger fires off. (It looks like a ranged attack without missile)
Where the hag is that bug, eh?
Here is the map, plz help me, I am near insanity.
It's me again. I opened a thread concerning my Charge spell some time ago and since then I and Paladon (you might know him) both worked on the spell, but we couldnt fix it.
Today I made the whole spell MUI/MPI and overworked it completely, trying to find a bug. Apart from that I shortened it from 4 to 3 triggers implementing the fade system into the dummy trigger.
I will post the 3 triggers here with the hoping that some genius scripter @ thehive might be able to fix it...
I will comment on every trigger, what it is suppoesed to do and I will attach the map to this post.
To really understand the problem you will have to take a look at the map!!!!
Plz help me!!!
----Palaslayer----
So, here is the first trigger called ChargeCast. It is activ from the beginning and it detects when the Charge is casted. It sets some points, including the position of the target and the position of the caster.
Point 3 is an offset from the angle of point 1 towards point 2, where the caster will be moved to the first time. In addition this trigger prepars the other ones by hiding the charger and so on.
-
ChargeCast
-
Events
- Unit - A unit starts the effect of an ability
-
Conditions
- (Ability being cast) equal to (==) Charge!!
-
Actions
- Set ChargeInteger[1] = (ChargeInteger[1] + 1)
- Set CustomValue = (CustomValue + 1)
- Set Charger[CustomValue] = (Triggering unit)
- Set Victim[CustomValue] = (Target unit of ability being cast)
- Set Charge_Point_01[CustomValue] = (Position of Charger[CustomValue])
- Set Charge_Point_02[CustomValue] = (Position of Victim[CustomValue])
- Set Charge_Point_03[CustomValue] = (Charge_Point_01[CustomValue] offset by 50.00 towards (Angle from Charge_Point_01[CustomValue] to Charge_Point_02[CustomValue]) degrees)
- Unit - Turn collision for Charger[CustomValue] Off
- Unit - Hide Charger[CustomValue]
- Unit - Move Charger[CustomValue] instantly to Charge_Point_03[CustomValue]
- Trigger - Turn on ChargeDummy <gen>
- Custom script: call RemoveLocation(udg_Charge_Point_01[udg_CustomValue])
- Custom script: call RemoveLocation(udg_Charge_Point_02[udg_CustomValue])
- Custom script: call RemoveLocation(udg_Charge_Point_03[udg_CustomValue])
-
Events
Now here is the second trigger which may be the main reason why the charge malfunctions (i will tell you the problem at the end of the post).
It runs every 0.04 seconds of game-time and creates the illusion of very fast movement.
Everytime it runs, the 3 locations which can also be found in the first trigger are set again, using the position of the caster and the target, and the caster is moved to the third location again while he still is hidden as well as a dummy unit is created which has the same model as the charger and faces the position of the target. It has no movementspeed and cannot be selected as a dummy is supposed to be.
The dummy is added to a unitgroup.
Now the dummy's movement animation is played and with the fade part of the trigger, everytime the trigger runs the transperency will be increased up to a certain point (90% transperency). At this point, the dummy unit is removed from the game as well as from the unit group where we added it before.
You may already see how the spell is supposed to work. We create a dummy every second and store it in a variable with an array. Using a loop we pick every dummy which exists at the moment, fade it and when the transperency reaches 90% we remove it.
Now, this only happens when the truth check reurns false.
At the point, where the distance between the caster and the target remains only 200 units or less, it is returned true and no more dummys will be created form this point on.
We run the final ChargeTrigger. The fade process will go on until the unitgroup is empty, then the trigger will be turned off.
Here is the trigger, it is active but not from the beginning:
-
ChargeDummy
-
Events
- Time - Every 0.04 seconds of game time
- Conditions
-
Actions
-
Do Multiple ActionsFor each (Integer A) from 1 to CustomValue, do (Actions)
-
Loop - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- ControlTruth[(Integer A)] Gleich (==) False
-
'THEN'-Actions
- Set Charge_Point_01[(Integer A)] = (Position of Charger[(Integer A)])
- Set Charge_Point_02[(Integer A)] = (Position of Victim[(Integer A)])
- Set Charge_Point_03[(Integer A)] = (Charge_Point_01[(Integer A)] offset by 45.00 towards (Angle from Charge_Point_01[(Integer A)] to Charge_Point_02[(Integer A)]) degrees)
- Unit - Create 1 TimeChargeDummy for (Owner of Charger[(Integer A)]) at Charge_Point_03[(Integer A)] facing (Angle from Charge_Point_03[(Integer A)] to Charge_Point_02[(Integer A)]) degrees
- Unit - Turn collision for (Last created unit) Off
- Set Dummy[Dummyinteger[(Integer A)]] = (Last created unit)
- Animation - Play Dummy[Dummyinteger[(Integer A)]]'s walk animation
- Set DummyGroup[(Integer A)] = (Create Unit Group)
- Unitgroup - Add Dummy[Dummyinteger[(Integer A)]] to DummyGroup[(Integer A)]
- Set Dummyinteger[(Integer A)] = (Dummyinteger[(Integer A)] + 1)
-
Unit - Move Charger[(Integer A)] instantly to Charge_Point_03[(Integer A)]
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- (Distance between Charge_Point_02[(Integer A)] and Charge_Point_03[(Integer A)]) smaller or equal to (<=) 200.00
-
'THEN'-Actions
- Set ControlTruth[(Integer A)] = True
- Trigger - Run ChargeFinal<gen> (checking conditions)
- 'ELSE'-Actions
-
'IF'-Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Custom script: call RemoveLocation(udg_Charge_Point_01[bj_forLoopAIndex])
- Custom script: call RemoveLocation(udg_Charge_Point_02[bj_forLoopAIndex])
- Custom script: call RemoveLocation(udg_Charge_Point_03[bj_forLoopAIndex])
- 'ELSE'-Actions
-
'IF'-Conditions
-
Do Multiple ActionsFor each (Integer B) from 1 to Dummyinteger[(Integer A)], do (Actions)
-
Loop - Actions
- Set fadeinteger[(Integer B)] = (fadeinteger[(Integer B)] + 10.00)
-
Animation - Change Dummy[(Integer B)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with fadeinteger[(Integer B)]% transparency
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- fadeinteger[(Integer B)] Größer als (>) 90.00
-
'THEN'-Actions
- Unitgroup - Remove Dummy[(Integer B)] from DummyGroup[(Integer A)]
- Unit - Remove Dummy[(Integer B)] from the game
-
Custom script: set udg_Dummy[bj_forLoopBIndex] = null
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- (DummyGroup[(Integer A)] is empty) equal to (==) True
-
'THEN'-Actions
- Set Dummyinteger[(Integer A)] = 1
- Custom script: call DestroyGroup(udg_DummyGroup[bj_forLoopAIndex])
- Trigger - Turn off (This trigger)
- Set ControlTruth[(Integer A)] = False
-
Set ChargeInteger[1] = (ChargeInteger[1] - 1)
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- ChargeInteger[1] Gleich (==) 0
-
'THEN'-Actions
- Set CustomValue = 1
- 'ELSE'-Actions
-
'IF'-Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'ELSE'-Actions
-
'IF'-Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'ELSE'-Actions
-
'IF'-Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Do Multiple ActionsFor each (Integer A) from 1 to CustomValue, do (Actions)
-
Events
Now, this is the final trigger. The charger is moved to point 3 a last time becomes unhidden and some special effects are attached. Damage is dealt and the KnockbackSystem from Paladon is initialized (there can be no fault, it works perfectly). It is active from the beginning but has no event.
-
ChargeFinal
- Events
- Conditions
-
Actions
-
Do Multiple ActionsFor each (Integer A) from 1 to CustomValue, do (Actions)
-
Loop - Actions
- Set Charge_Point_01[(Integer A)] = (Position of Charger[(Integer A)])
- Set Charge_Point_02[(Integer A)] = (Position of Victim[(Integer A)])
- Set Charge_Point_03[(Integer A)] = (Charge_Point_01[(Integer A)] offset by 45.00 towards (Angle from Charge_Point_01[(Integer A)] to Charge_Point_02[(Integer A)]) degrees)
- Unit - Move Charger[(Integer A)] instantly to Charge_Point_03[(Integer A)]
- Unit - Unhide Charger[(Integer A)]
- Unit - Turn collision for Charger[(Integer A)] Ein
- Specialeffect - Create a special effect attached to the weapon of Charger[(Integer A)] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
- Set SpecialEffect[(Integer A)] = (Last created special effect)
- Unit - Cause Charger[(Integer A)] to damage Victim[(Integer A)], dealing 100.00 damage of attack type Spells and damage type Unknown
- Animation - Play Charger[(Integer A)]'s attack slam animation
- Set KBA_Caster = Charger[(Integer A)]
- Set KBA_TargetUnit = Victim[(Integer A)]
- Set KBA_StartingPosition = Charge_Point_03[(Integer A)]
- Set KBA_Level = 1
- Set KBA_Speed = 5.00
- Set KBA_DistancePerLevel = 140.00
- Set KBA_SpecialEffects[1] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
- Set KBA_SpecialEffects[2] = Objects\Spawnmodels\Human\HumanBlood\HumanBloodLarge0.mdl
- Set KBA_DestroyTrees = True
- Trigger - Run Cast A Knockback <gen> (checking conditions)
- Specialeffect - Destroy SpecialEffect[(Integer A)]
- Animation - Reset Charger[(Integer A)]'s animation
- Selection - Select Charger[(Integer A)] for (Owner of Charger[(Integer A)])
- Unit - Order Charger[(Integer A)] to Angreifen Victim[(Integer A)]
- Custom script: call RemoveLocation(udg_Charge_Point_01[bj_forLoopAIndex])
- Custom script: call RemoveLocation(udg_Charge_Point_02[bj_forLoopAIndex])
- Custom script: call RemoveLocation(udg_Charge_Point_03[bj_forLoopAIndex])
- Custom script: set udg_Charger[bj_forLoopAIndex] = null
- Custom script: set udg_Victim[bj_forLoopAIndex] = null
-
Loop - Actions
-
Do Multiple ActionsFor each (Integer A) from 1 to CustomValue, do (Actions)
Now, to give the final information, the problem is.
It works completely fine when i use it the firsttime. The second time, no dummies are created, the hcrager is only moved once and then the final trigger fires off. (It looks like a ranged attack without missile)
Where the hag is that bug, eh?
Here is the map, plz help me, I am near insanity.
Last edited: