TmaRT
offline
Опыт:
1,360Активность: |
Трекабл система
Я хотел начучится трекабля и нашел вот эту систему! она нормальнно работает если дистанция между трекаблями равна 64(см. тригер), а стоить мне уменьшить её до 32 и тригер перестает работать вовсе, почему и как это сделать подскажите плз!
! » (costom code) function HandleToInt takes handle h returns integer return h return 0 endfunction function IntToHandle takes integer i returns handle return i return null endfunction function LocalVars takes nothing returns gamecache return InitGameCache("test.w3v") endfunction function SetHandleHandle takes handle subject, string name, handle value returns nothing if value==null then call FlushStoredInteger(LocalVars(),I2S(HandleToInt(subject)),name) else call StoreInteger(LocalVars(), I2S(HandleToInt(subject)), name, HandleToInt(value)) endif endfunction function SetHandleInt takes handle subject, string name, integer value returns nothing if value==0 then call FlushStoredInteger(LocalVars(),I2S(HandleToInt(subject)),name) else call StoreInteger(LocalVars(), I2S(HandleToInt(subject)), name, value) endif endfunction function SetHandleReal takes handle subject, string name, real value returns nothing if value==0 then call FlushStoredReal(LocalVars(), I2S(HandleToInt(subject)), name) else call StoreReal(LocalVars(), I2S(HandleToInt(subject)), name, value) endif endfunction function SetHandleString takes handle subject, string name, string value returns nothing if ( value == null or value == "" ) then call FlushStoredString(LocalVars(), I2S(HandleToInt(subject)), name) else call StoreString(LocalVars(), I2S(HandleToInt(subject)), name, value) endif endfunction function GetHandleHandle takes handle subject, string name returns handle return IntToHandle(GetStoredInteger(LocalVars(), I2S(HandleToInt(subject)), name)) endfunction function GetHandleInt takes handle subject, string name returns integer return GetStoredInteger(LocalVars(), I2S(HandleToInt(subject)), name) endfunction function GetHandleReal takes handle subject, string name returns real return GetStoredReal(LocalVars(), I2S(HandleToInt(subject)), name) endfunction function GetHandleString takes handle subject, string name returns string return GetStoredString(LocalVars(), I2S(HandleToInt(subject)), name) endfunction function FlushHandleLocals takes handle subject returns nothing call FlushStoredMission(LocalVars(), I2S(HandleToInt(subject)) ) endfunction function GetTrackableX takes trackable tc returns real return GetHandleReal(tc, "x") endfunction function GetTrackableY takes trackable tc returns real return GetHandleReal(tc, "y") endfunction function GetTrackablePath takes trackable tc returns string return GetHandleString(tc, "path") endfunction function GetTrackablePlayer takes trackable tc returns player return Player(GetHandleInt(tc, "player")) endfunction function NewTrackable takes string path, real x, real y, force visiblePlayers, trigger trackEvent, trigger hitEvent returns nothing local trackable tc local integer i = 0 local string model loop exitwhen i > 11 set model = "" if ( IsPlayerInForce(Player(i), visiblePlayers) and GetPlayerController(Player(i)) == MAP_CONTROL_USER ) then if ( GetLocalPlayer() == Player(i) ) then set model = path endif set tc = CreateTrackable(model, x, y, 0) call SetHandleReal(tc, "x", x) call SetHandleReal(tc, "y", y) call SetHandleString(tc, "path", path) call SetHandleInt(tc, "player", i) if ( trackEvent != null ) then call TriggerRegisterTrackableTrackEvent(trackEvent, tc) endif if ( hitEvent != null ) then call TriggerRegisterTrackableHitEvent(hitEvent, tc) endif endif set i = i + 1 endloop endfunction » Тригер function TrackableTrack takes nothing returns nothing local real x = GetTrackableX(GetTriggeringTrackable()) local real y = GetTrackableY(GetTriggeringTrackable()) local location loc = Location(x,y) call SetUnitFacingToFaceLocTimed(udg_Tower, loc, 0.5) call DisplayTextToForce( GetPlayersAll(), ( "Навелась мышка" ) ) //move mause endfunction function TrackableHit takes nothing returns nothing local real x = GetTrackableX(GetTriggeringTrackable()) local real y = GetTrackableY(GetTriggeringTrackable()) call DisplayTextToForce( GetPlayersAll(), ( "Мышь клик" ) ) //click endfunction function Trig_Init_Trackables_Actions takes nothing returns nothing local trigger hit = CreateTrigger() local trigger track = CreateTrigger() local real x = 0 local real y = GetRectMinY(gg_rct_area) + 32 //было 64 local real maxY = GetRectMaxY(gg_rct_area) local real maxX = GetRectMaxX(gg_rct_area) loop exitwhen y > maxY - 32//было 64 set x = GetRectMinX(gg_rct_area) +32//было 64 loop exitwhen x > maxX - 32//было 64 call NewTrackable("units\\nightelf\\Wisp\\Wisp.mdl", x, y, GetPlayersAll(), track, hit) set x = x + 64//было 128 endloop set y = y + 64 //было 128 endloop call TriggerAddAction(hit, function TrackableHit) call TriggerAddAction(track, function TrackableTrack) endfunction //======================================================================= ==== function InitTrig_Init_Trackables takes nothing returns nothing set gg_trg_Init_Trackables = CreateTrigger( ) call TriggerAddAction( gg_trg_Init_Trackables, function Trig_Init_Trackables_Actions ) endfunction TmaRT добавил: Кстати система работает так, указываешь там регион и он полностью его должен заложить трекаблями растояние между ними 32х32 (см тригер, подчеркнутый жирным это поля где я редоктировал) |
09.06.2009, 14:53 | #1
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
agentex
offline
Опыт:
34,834Активность: |
Цитата:
лол ну я так думаю что трекеблы наезжают друг на друга при такой маленькой дистанции, хотя быть может дело в движке |
|
09.06.2009, 14:54 | #2
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
TmaRT
offline
Опыт:
1,360Активность: |
agentexДа я с трэкаблями еще не работал, не я использовал маленьку модель 2х2, так что на друг друга они не как не наезжают) движок работает нормально вроде
TmaRT добавил: Мне по зарез надо это система |
09.06.2009, 15:04 | #3
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|