- Joined
- Jul 17, 2013
- Messages
- 544
Hey with help of few people i managed to make jump spell but it doesnt always work propley so i need litle help how to fix it. i have also attachted the test map with the spell. The problem is that sometimes when unit is flying over the dooad he doesnt land near ground, hes supossed to land on ground whenever he touches some area that isnt walkable, unit must not get throught rock or tress
when i was testing this in game i set my hero like that and put casting point there as u can see, my hero doesnt land on ground hes stuck into air, but when i stand straight to the rock all works fine, idk whats reason there, when players are playing in my map sometimes also they manage to go throught tress, i noticed that they also get stuck into the air then they click to mvoe or jump again and it allows them to get throught tress. any idea how to fix that? i have 2 issues hero is stuck sometimes in air and sometimes can go throught tress.
when i was testing this in game i set my hero like that and put casting point there as u can see, my hero doesnt land on ground hes stuck into air, but when i stand straight to the rock all works fine, idk whats reason there, when players are playing in my map sometimes also they manage to go throught tress, i noticed that they also get stuck into the air then they click to mvoe or jump again and it allows them to get throught tress. any idea how to fix that? i have 2 issues hero is stuck sometimes in air and sometimes can go throught tress.
JASS:
function IsPointWalkable takes real x, real y returns boolean
local real X
local real Y
local item I = CreateItem('sehr', x, y)
set X = GetItemX(I)
set Y = GetItemY(I)
call RemoveItem(I)
return X-x <= 0.5 and Y-y <= 0.5
endfunction
-
first
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Jump
-
Actions
- Set VariableSet TempLoc = (Position of Gimli 0005 <gen>)
- Set VariableSet targecikjumpa = (Target point of ability being cast)
- Set VariableSet LeapDistance = (Distance between TempLoc and targecikjumpa)
- Custom script: if (IsPointWalkable(GetLocationX(udg_targecikjumpa),GetLocationY(udg_targecikjumpa))) then
- Custom script: else
- Unit - Order Gimli 0005 <gen> to Stop.
- Game - Display to Player Group - Player 6 (Orange) the text: |cffffcc00This area...
- Custom script: endif
- Custom script: call RemoveLocation (udg_TempLoc)
- Custom script: call RemoveLocation(udg_targecikjumpa)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- LeapDistance Less than 100.00
-
Then - Actions
- Unit - Order Gimli 0005 <gen> to Stop.
- Game - Display to Player Group - Player 6 (Orange) the text: |cffffcc00Target is...
- Else - Actions
-
If - Conditions
-
Events
-
second
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Jump
-
Actions
- Set VariableSet TempLoc = (Position of Gimli 0005 <gen>)
- Set VariableSet targecikjumpa = (Target point of ability being cast)
- Set VariableSet LeapDistance = (Distance between TempLoc and targecikjumpa)
- Set VariableSet skok = (TempLoc offset by 20.00 towards LeapDistance degrees.)
- Custom script: call RemoveLocation (udg_TempLoc)
- Unit - Turn collision for Gimli 0005 <gen> Off.
- Unit - Add Crow Form to Gimli 0005 <gen>
- Unit - Remove Crow Form from Gimli 0005 <gen>
- Animation - Change Gimli 0005 <gen> flying height to 130.00 at 400.00
- Trigger - Turn on third <gen>
-
Events
-
third
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
- Set VariableSet TempLoc = (Position of Gimli 0005 <gen>)
- Set VariableSet LeapDistance = (Distance between TempLoc and targecikjumpa)
- Set VariableSet skok = (TempLoc offset by 20.00 towards (Angle from TempLoc to targecikjumpa) degrees.)
- Custom script: if (IsPointWalkable(GetLocationX(udg_skok),GetLocationY(udg_skok))) then
- Unit - Move Gimli 0005 <gen> instantly to skok
- Set VariableSet newLoc = (Position of Gimli 0005 <gen>)
- Custom script: endif
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- LeapDistance Less than or equal to 15.00
- (Distance between newLoc and TempLoc) Less than 15.00
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Set VariableSet skok = targecikjumpa
- Trigger - Turn off (This trigger)
- Custom script: call RemoveLocation(udg_targecikjumpa)
- Custom script: call RemoveLocation(udg_newLoc)
- Custom script: call RemoveLocation (udg_skok)
- Animation - Change Gimli 0005 <gen> flying height to 0.00 at 400.00
- Unit - Turn collision for Gimli 0005 <gen> On.
- Unit - Create 1 Dummy for Player 6 (Orange) at TempLoc facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Add gimlia dummy to (Last created unit)
- Special Effect - Create a special effect at TempLoc using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
- Custom script: call RemoveLocation (udg_TempLoc)
- Special Effect - Destroy (Last created special effect)
- Unit - Set level of gimlia dummy for (Last created unit) to (Level of Jump for Gimli 0005 <gen>)
- Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp.
- Set VariableSet gimliuk = (Position of Gimli 0005 <gen>)
- Set VariableSet gimliknock = (Units within 230.00 of gimliuk matching (((Matching unit) has buff Knockbacked (Pause) gimljusz) Equal to True).)
-
Unit Group - Pick every unit in gimliknock and do (Actions)
-
Loop - Actions
- Custom script: if IsUnitType(GetEnumUnit(),UNIT_TYPE_GIANT) then
- Unit Group - Remove (Picked unit) from gimliknock.
- Custom script: endif
-
Loop - Actions
-
Unit Group - Pick every unit in gimliknock and do (Actions)
-
Loop - Actions
- Unit - Turn collision for (Picked unit) Off.
- Unit - Add Crow Form to (Picked unit)
- Unit - Remove Crow Form from (Picked unit)
- Animation - Change (Picked unit) flying height to (Random real number between 150.00 and 190.00) at 400.00
-
Loop - Actions
- Set VariableSet knockbackCounter = 0
- Trigger - Turn on fourth <gen>
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation (udg_TempLoc)
-
Events