Короче, вот она:
??(Мне её писал знакомый по просьбе, так что я не понимаю многих вычислений в ней, но думаю ваш жассопытный глаз сам оценит по коду, насколько он шарит или не шарит. Суть не в этом, а в том что всё работало нормально, но в какой то момент это просто перестало работать. Совсем. Все способности и действия, что должны были выполнять это, перестали это делать.
Это "отбрасывание"(кого, на сколько, время, направление, летит ли(0/1), высота полета(парабола)), но я часто использовал его и как просто движение для плавности)??
Помогите, пожалуйста!
2
17
7 лет назад
2
в методе StopAction
пропиши в самом верху
set m[j].destroy() должно помоч
0
19
7 лет назад
0
ledoed:
в методе StopAction
пропиши в самом верху
set m[j].destroy() должно помоч
Спасибо. Видимо ты разбираешься в муи)
Я попробую, но т.к. я не знаю как повторить это замыкание, я и не могу проверить помогло ли, так что подожду еще ответов...
ledoed:
set m[j].destroy()
Если прописать в самом верху метода, выдает синтаксис эррор(чето end of line), а если в самом низу - просто вылетает JassHelper при сохранении...
0
15
7 лет назад
0
Я даже читать не стал. Смесь Джасса и СиДжасса и отсутствие табуляций. Передай другу, что так делать нехорошо.
0
19
7 лет назад
0
Кто нибудь может мне помочь?
0
17
7 лет назад
0
ой сорян над было эт в статическом методе делать скинул бы ты библию целиком
0
19
7 лет назад
0
ledoed:
ой сорян над было эт в статическом методе делать скинул бы ты библию целиком
Так еще раз, что нужно сделать и куда?
0
17
7 лет назад
0
скинул бы ты библию целиком кодом прямо сюда
0
19
7 лет назад
0
library Flyout
private function MoveUnit takes unit u, real spd, real dir returns nothing
if IsTerrainPathable(GetUnitX(u),GetUnitY(u)+spd*Sin(dir),PATHING_TYPE_FLYABILITY)==false
SetUnitY(u,GetUnitY(u)+spd*Sin(dir))
endif
if IsTerrainPathable(GetUnitX(u)+spd*Cos(dir),GetUnitY(u),PATHING_TYPE_FLYABILITY)==false
SetUnitX(u,GetUnitX(u)+spd*Cos(dir))
endif
set u = null
endfunction
private function Parabola takes real h, real d, real x returns real
return (4 * h / d) * (d - x) * (x / d)
endfunction
private struct MUE_Struct
private static timer t = CreateTimer()
private static integer m[]
private static integer MUI = -1
unit c
real dist
integer check
real r
real r2 = 0
real fly
real rmax
real sr
real a
private method StopAction takes integer j returns nothing
set m[j] = m[MUI]
set MUI = MUI - 1
if MUI <= -1 then
call PauseTimer(t)
set MUI = -1
endif
endmethod
private static method Loop takes nothing returns nothing
local thistype this
local integer i = 0
loop
exitwhen i > MUI
set this = m[i]
if r<rmax then
set r = r + 0.01
MoveUnit(c,dist,a)
if check == 1 then
SetUnitFlyHeight(c,Parabola(fly,sr,r2),0)
set r2 = r2+dist
endif
else
if check == 1 then
SetUnitFlyHeight(c,GetUnitDefaultFlyHeight(c),0)
endif
set c = null
call StopAction(i)
call destroy()
endif
set i = i + 1
endloop
endmethod
public static method MUE_Start takes unit NewC, real NewDist,real NewRmax, real NewA,integer NewCheck,real NewFly returns nothing
local thistype this = thistype.create()
set MUI = MUI + 1
set m[MUI] = this
set c = NewC
set r = 0
set rmax = NewRmax
set dist = NewDist
set sr = NewDist
set dist = (dist/(rmax*100))
set check = NewCheck
set fly = NewFly
set r2= 0
if check == 1 then
endif
set a = NewA
if MUI == 0 then
call TimerStart(t, 0.01, true, function thistype.Loop)
endif
set NewC = null
endmethod
endstruct
function Flyout takes unit c,real distance,real timeformoving,real angle,integer checkingfly,real flyheight returns nothing
call MUE_Struct.MUE_Start(c,distance,timeformoving,angle*bj_DEGTORAD,checkingfly,flyheight)
c = null
endfunction
endlibrary
2
17
7 лет назад
2
код там к сожелению слишком сложный могу предложить альтернативу с моей системки выдернутую и переделаную под тебя
library Parabols{

//u - твой юнит
//x,y - координаты куда ему приземляться
//speed - скорость
//h - максимальная высота


//Parabols_Spell(unit u,float x,float y,float speed,float h)     запуск системки


		define{

			private Voron='Arav'//скилл ворона
            private time = 0.025//тебе это ненадо
		
		}



		public int count = 0
		private timer T=null
//============================
		private unit this_u[] 

		private float this_damage[]
		private float this_x[],this_y[]
		private float this_h[]
		private float this_distance[]
        private float this_speed[]

        
		private int Proverka(unit u){int i = 0;while(i<count){if(u==this_u[i]){return i}i++}return -1}


		private void RemoveUnitStruct(int i){

			count--
  

				//====================
					this_u[i]=this_u[count]
                    this_speed[i]=this_speed[count]
					this_x[i]=this_x[count]
					this_y[i]=this_y[count]
					this_h[i]=this_h[count]
					this_distance[i]=this_distance[count]
				//======================
					this_u[count]=null
	
  

		}

		private void Remove(int i){

		
			RemoveUnitStruct(i)

		}


			//===============================================
			//Парабола
			//h-макс высота;d-макс длина;x-тек растояние до точки
			real ParabolaZ(real h, real d, real x){
			   return ( (4 * h / d) * (d - x)*(x/d) )
			}

            
            

			private void Action(int i){
			
			float x=GetUnitX(this_u[i])
			float y=GetUnitY(this_u[i])
			
			float xx=this_x[i]-x
			float yy=this_y[i]-y
			
			//float rad = Atan2(yy,xx)
			float distance= SquareRoot(xx*xx+yy*yy)
			
			SetUnitX(this_u[i],x+this_speed[i]*xx/distance)
			SetUnitY(this_u[i],y+this_speed[i]*yy/distance)
			
			SetUnitFlyHeight(this_u[i],ParabolaZ(this_h[i], this_distance[i], distance),0)
			
				if(distance<60||GetUnitState(this_u[i],UNIT_STATE_LIFE)<=0){
				Remove(i)
				}
			
			}
			
			
			



			public void Update(){
			int i = 0 
				while(i<count){
					Action(i)
				 i++
				}
			if(count<=0){
				DestroyTimer(T)
				T=null
			 }
			}
			
			
			
			
			
			
			
			
			
			
			public void AddUnit(unit u,float speed,float h,float x,float y,float distance){

			int i = Proverka(u)

				if(i!=-1){return}
			
			this_u[count]=u
			this_h[count]=h
			this_x[count]=x
			this_y[count]=y
			this_distance[count]=distance
			this_speed[count]=speed

						UnitAddAbility(u,Voron)
                        UnitRemoveAbility(u,Voron)
			count++
			
			
			if(T==null){
				T=CreateTimer()
				TimerStart(T,time,true,function Update)
			}
			
		}
			
			
			
			
			
			
			
			public void Spell(unit u,float x,float y,float speed,float h){
			
				float dx=x-GetUnitX(u)
				float dy=y-GetUnitY(u)
				float distance=SquareRoot(dx*dx+dy*dy)
				AddUnit(u,speed,h,x,y,distance)
			
			}
			
			
			
			
			


}
Чтобы оставить комментарий, пожалуйста, войдите на сайт.