XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Барахолка
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
Doc

offline
Опыт: 63,163
Активность:
Absol, ок.
Старый 18.04.2012, 20:47
NIKZ
Изучаю Jass
offline
Опыт: 6,036
Активность:
а можно vJass конвертировать в Jass?
[+] замечание от Msey: дублирование поста, идиотизм
Старый 18.04.2012, 22:29
Msey
????
offline
Опыт: 67,346
Активность:
NIKZ, редактор в конечном процессе код компилирует и так в обычный жас
Msey добавил:
как сделать чтоб сейвило в корень варика
ну наверное указать свой путь, не?
Старый 19.04.2012, 00:53
NIKZ
Изучаю Jass
offline
Опыт: 6,036
Активность:
редактор в конечном процессе код компилирует и так в обычный жас
Ты хочешь сказать что в архиве карты будет обычный Джасс?? Значит ты ошибаешься там vJass
Старый 19.04.2012, 20:33
DaeDR

offline
Опыт: 8,074
Активность:
NIKZ, Тот архив, который читает вар - чистый jass. V и С - только упрощение для работы картодела. В итоге все сводится к обычному.
Старый 19.04.2012, 20:38
NIKZ
Изучаю Jass
offline
Опыт: 6,036
Активность:
Ну допустим это из архива
((код jass
globals
constant boolean LIBRARY_DebugLog=true
integer DebugLog__CurrentString=0
integer DebugLog__Seconds=0
integer DebugLog__Minutes=0
constant integer DebugLog__StringLimit=200
trigger gg_trg_DebugLog=null
trigger gg_trg_Add=null
trigger gg_trg_Clear=null
trigger gg_trg_Update=null
trigger l__library_init
string array sDebugLogDebugLog
string array s2DebugLogDebugLog
endglobals
function sgDebugLogDebugLog_get takes integer i returns string
if(i<8191)then
return sDebugLogDebugLog[i]
else
return s2DebugLogDebugLog[i-8191]
endif
endfunction
function sgDebugLogDebugLog_set takes integer i,string v returns nothing
if(i<8191)then
set sDebugLogDebugLog[i]=v
else
set s2DebugLogDebugLog[i-8191]=v
endif
endfunction
function LogAdd takes string s returns nothing
local string sec=I2S(DebugLog__Seconds)
if(DebugLog__Seconds<10)then
set sec="0"+sec
endif
call sgDebugLogDebugLog_set(DebugLogCurrentString,sgDebugLogDebugLog_get(DebugLogCurrentStrin​&#8203;g)+("["+I2S(DebugLog__Minutes)+":"sec"] "s"\n"))
if(StringLength(sgDebugLogDebugLog_get(DebugLogCurrentString))>=DebugLogStringLimit)then
set DebugLogCurrentString=DebugLogCurrentString+1
endif
endfunction
function LogClear takes nothing returns nothing
local integer i=0
loop
exitwhen not(i<=DebugLog__CurrentString)
call sgDebugLogDebugLog_set(i,"")
set i=i+1
endloop
set DebugLog__CurrentString=0
endfunction
function LogUpdate takes nothing returns nothing
local integer i=0
call PreloadGenClear()
call PreloadGenStart()
loop
exitwhen not(i<=DebugLog__CurrentString)
call Preload("\")\n"+sgDebugLogDebugLog_get(i)+"\n(\"")
set i=i+1
endloop
call PreloadGenEnd("C:\\Dir\\Debug.txt")
endfunction
function DebugLog__DebugLogOnTimer takes nothing returns nothing
set DebugLogSeconds=DebugLogSeconds+1
if(DebugLog__Seconds>59)then
set DebugLog__Seconds=0
set DebugLogMinutes=DebugLogMinutes+1
endif
endfunction
function DebugLog__DebugLogInit takes nothing returns nothing
call TimerStart(CreateTimer(),1.0,true,function LogUpdate)
call TimerStart(CreateTimer(),1.,true,function DebugLog__DebugLogOnTimer)
call LogAdd("By DoctorGester. Last compilation: 2011.04.25 19:03:15")
endfunction
function InitGlobals takes nothing returns nothing
endfunction
function Trig_Add_Actions takes nothing returns nothing
call LogAdd("TEST")
endfunction
function InitTrig_Add takes nothing returns nothing
set gg_trg_Add=CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_Add,Player(0),"add",true)
call TriggerAddAction(gg_trg_Add,function Trig_Add_Actions)
endfunction
function Trig_Clear_Actions takes nothing returns nothing
call LogClear()
endfunction
function InitTrig_Clear takes nothing returns nothing
set gg_trg_Clear=CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_Clear,Player(0),"clear",true)
call TriggerAddAction(gg_trg_Clear,function Trig_Clear_Actions)
endfunction
function Trig_Update_Actions takes nothing returns nothing
call LogUpdate()
endfunction
function InitTrig_Update takes nothing returns nothing
set gg_trg_Update=CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_Update,Player(0),"update",true)
call TriggerAddAction(gg_trg_Update,function Trig_Update_Actions)
endfunction
function InitCustomTriggers takes nothing returns nothing
call InitTrig_Add()
call InitTrig_Clear()
call InitTrig_Update()
endfunction
function RunInitializationTriggers takes nothing returns nothing
call ConditionalTriggerExecute(gg_trg_DebugLog)
endfunction
function InitCustomPlayerSlots takes nothing returns nothing
call SetPlayerStartLocation(Player(0),0)
call SetPlayerColor(Player(0),ConvertPlayerColor(0))
call SetPlayerRacePreference(Player(0),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(0),true)
call SetPlayerController(Player(0),MAP_CONTROL_USER)
endfunction
function InitCustomTeams takes nothing returns nothing
call SetPlayerTeam(Player(0),0)
endfunction
function main takes nothing returns nothing
call SetCameraBounds(-1280.0+GetCameraMargin(CAMERA_MARGIN_LEFT),-1536.0+GetCameraMargin(CAMERA_MARGIN_BO​&#8203;TTOM),1280.0-GetCameraMargin(CAMERA_MARGIN_RIGHT),1024.0-GetCameraMargin(CAMERA_MARGIN_TO​P),-1280.0+&#8203;GetCameraMargin(CAMERA_MARGIN_LEFT),1024.0-GetCameraMargin(CAMERA_MARGIN_TOP),​1280.0-GetCameraMargin&#8203;(CAMERA_MARGIN_RIGHT),-1536.0+GetCameraMargin(CAMERA_MARGIN_BOTTOM)​)
call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl​&#8203;","Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl"​)
call NewSoundEnvironment("Default")
call SetAmbientDaySound("LordaeronSummerDay")
call SetAmbientNightSound("LordaeronSummerNight")
call SetMapMusic("Music",true,0)
call InitBlizzard()
call ExecuteFunc("DebugLog__DebugLogInit")
call InitGlobals()
call InitCustomTriggers()
call ConditionalTriggerExecute(gg_trg_DebugLog)
endfunction
function config takes nothing returns nothing
call SetMapName("??? ???? ?????")
call SetMapDescription("???????? ???????????")
call SetPlayers(1)
call SetTeams(1)
call SetGamePlacement(MAP_PLACEMENT_USE_MAP_SETTINGS)
call DefineStartLocation(0,-64.0,-192.0)
call InitCustomPlayerSlots()
call SetPlayerSlotAvailable(Player(0),MAP_CONTROL_USER)
call InitGenericPlayerSlots()
endfunction
))
NIKZ добавил:
NIKZ, Это Jass?
Старый 19.04.2012, 20:47
XOR

offline
Опыт: 38,159
Активность:
да
Старый 19.04.2012, 20:54
NIKZ
Изучаю Jass
offline
Опыт: 6,036
Активность:
Как мне его распределить по триггерам?), так как он куучу ошибок вызывает
Старый 19.04.2012, 20:55
Doc

offline
Опыт: 63,163
Активность:
ну допустим глобалс - фича обычного жасса, просто редактор ее не пускает.
Старый 19.04.2012, 21:46
quq_CCCP
Я белый и пушистый!
offline
Опыт: 93,259
Активность:
NIKZ, функция main исполняется еще до загрузки карты, её нельзя трогать, там параметры карты, и их изменение во время игры не сулит нечего хорошего, так же ты показал ту часть кода карты которая генерируется редактором, и не должна изменятся тобой по определению...
Тут если бы редактор не ругался, ругался бы движок в виде FATAL ERROR!
Старый 20.04.2012, 06:25
NIKZ
Изучаю Jass
offline
Опыт: 6,036
Активность:
Установил JNGP поставил сJass и все равно не хочет. Он просто напростос не видит кода (не понимает код)
Старый 06.05.2012, 15:01
quq_CCCP
Я белый и пушистый!
offline
Опыт: 93,259
Активность:
NIKZ, точно настроил все параметры как на скрине? Мб у тебя в коде ошибки....
Старый 06.05.2012, 15:37
NIKZ
Изучаю Jass
offline
Опыт: 6,036
Активность:
vJASS
((код jass
library DebugLog
globals
private constant string SAVE_PATH = "C:\\Users\\"
private constant boolean AUTO_SAVE = false
private constant real SAVE_INTERVAL = 1.0

private string array log
private integer index = 0
private integer seconds = 0
private integer minutes = 0
endglobals

function LogAdd takes string s returns nothing
local string sec=I2S(seconds)
if seconds<10 then
set sec="0"+sec
endif
set log[index]="[" + I2S(minutes) + ":" + sec + "] " + s + "\n"
set index=index+1
endfunction

function LogClear takes nothing returns nothing
local integer i = 0
loop
exitwhen i>index
set log[i]=""
set i=i+1
endloop
set index = 0
endfunction

function LogUpdate takes nothing returns nothing
local integer i=0
call PreloadGenClear()
call PreloadGenStart()
loop
exitwhen i>index
call Preload("\")\n" + log[i] + "\n(\"")
set i=i+1
endloop
call PreloadGenEnd(SAVE_PATH+"DebugLog.txt")
endfunction

private function TimeBuffer takes nothing returns nothing
set seconds=seconds+1
if seconds>59 then
set seconds=0
set minutes=minutes+1
endif
endfunction

private module Init
private static method onInit takes nothing returns nothing
static if AUTO_SAVE then
call TimerStart(CreateTimer(),SAVE_INTERVAL,true,function LogUpdate)
endif
call TimerStart(CreateTimer(),1.,true,function TimeBuffer)
endmethod
endmodule
private struct Inits extends array
implement Init
endstruct
endlibrary
))
Старый 06.05.2012, 17:11
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 09:35.