Начинающий
- Статус
- Оффлайн
- Регистрация
- 28 Авг 2022
- Сообщения
- 6
- Реакции
- 0
Да я знаю что уже есть один pets, но там неудобно корректировать все под себя.
Ссылка вот
Все луашкой можно пользоваться!
•PET MODE
pet mod ов всего 4 вида:
1) Joint - Питомец лепится к модельке и вращается вместе с игроком, либо если выключено третье лицо то просто висит на экране
2) 2D - Питомец теперь привязан к точке на земле, но всегда повернут к вам лицом
3) 2.5D - Питомец так же привязан к точке на земле, но вращается теперь только по оси z
4) 3D - Полное вращение
•PET NAME
Ну пишете в поле имя питомцу и оно меняется (если не надо можно просто стереть)
•PET NAME POSITION
Для смещения клички питомца
•MIRROR
Отзеркаливает ваше изображение
•OFFSETS
С помощью оффсетов можно скорректировать положение вашего питомца в 3д пространстве
•PET SIZE
меняет размер питомца
•PET ROTATION
Вращает вашего питомца
•PET ALPHA
Прозрачность питомца
•RESET
Сбрасывает все параметры (если лень самому поправлять как было)
•SAFE UNLOAD
Отключить скрипт без краша игры
[ПРОБЛЕМЫ]Если попробовать выключить луа обычным способом то игра ВЫЛЕТАЕТ!!
Связанно это с отрисовкой динамических текстур и как это пофиксить я пока не понял если кто нибудь знает напишите!
Ссылка вот
Пожалуйста, авторизуйтесь для просмотра ссылки.
, а ну еще и снизу код прикрепил[ЗАПУСК]
При запуске луа игра свернется для создания папки, но если вдруг папка для картинок не создалась сама то можно создать вручную по этому пути:
Туда нужно кинуть 2 любые картинки В ФОРМАТЕ PNG, после чего нужно перезапустить луашку что бы скрипт подгрузил фотокарточки.steam\steamapps\common\Counter-Strike Global Offensive\nix\uwupets
Все луашкой можно пользоваться!
Доступна полная настройка
(пока что недоступно по градусное вращение)
[ФУНКЦИОНАЛ]
(пока что недоступно по градусное вращение)
[ФУНКЦИОНАЛ]
•PET MODE
pet mod ов всего 4 вида:
1) Joint - Питомец лепится к модельке и вращается вместе с игроком, либо если выключено третье лицо то просто висит на экране
2) 2D - Питомец теперь привязан к точке на земле, но всегда повернут к вам лицом
3) 2.5D - Питомец так же привязан к точке на земле, но вращается теперь только по оси z
4) 3D - Полное вращение
•PET NAME
Ну пишете в поле имя питомцу и оно меняется (если не надо можно просто стереть)
•PET NAME POSITION
Для смещения клички питомца
•MIRROR
Отзеркаливает ваше изображение
•OFFSETS
С помощью оффсетов можно скорректировать положение вашего питомца в 3д пространстве
•PET SIZE
меняет размер питомца
•PET ROTATION
Вращает вашего питомца
•PET ALPHA
Прозрачность питомца
•RESET
Сбрасывает все параметры (если лень самому поправлять как было)
•SAFE UNLOAD
Отключить скрипт без краша игры
[ПРОБЛЕМЫ]
Связанно это с отрисовкой динамических текстур и как это пофиксить я пока не понял если кто нибудь знает напишите!
[В БУДУЩЕМ]
Хочу добавить возможность подгрузки сразу пяти или шести картинок. Работа не закончена просто приостановлена.
Код:
ffi.cdef[[
int CopyFileA(const char* lpExistingFileName, const char* lpNewFileName, int bFailIfExists);
bool CreateDirectoryA(const char *path, void *lpSecurityAttributes);
]]
local path, index, files = "./nix/uwupets", 0, {}
ffi.C.CreateDirectoryA(path, nil)
for line in io.popen("dir \"" .. path .. "\" /a /b", "r"):lines() do
if string.find(line, ".png") then
files[index] = line index = index + 1
end
end
if #files == 0 then
client.notify("no png images were found.");
return
end
local screen = engine.get_screen_size()
local png_files = ui.add_combo_box("png images", "png_files", files, 0)
local petmode = ui.add_combo_box("choose pet mode", "petmode", {"OFF","Joint","2D","2.5D","3D"}, 0)
local pet_name = ui.add_text_input("pet name", "pet_name", "uwuboi")
local name_offset_x = ui.add_slider_int("x name position", "slider_name_x",-444,444,0)
local name_offset_y = ui.add_slider_int("y name position", "slider_name_y",-444,444,0)
local mirrored = ui.add_check_box("mirror your pet", "mirrored", false)
local pet_offset_x = ui.add_slider_int("x coordinate offset", "slider_x",-444,444,44)
local pet_offset_y = ui.add_slider_int("y coordinate offset", "slider_y",-444,444,44)
local pet_offset_z = ui.add_slider_int("z coordinate offset", "slider_z",-444,444,-60)
local pet_size = ui.add_slider_int("pet size", "slider_size",0,200,44)
local pet_rot = ui.add_slider_float("pet rotation", "slider_rotate",0.0,90.0,0.0)
local pet_alpha = ui.add_slider_int("pet alpha", "slider_alpha",0,100,100)
local tahoma_bold = renderer.setup_font("C:/windows/fonts/tahomabd.ttf", 24, 0)
local resetp = ui.add_check_box("back to default", "resetp", false)
local unlod = ui.add_check_box("safe lua unload", "unlod_lua", false)
client.register_callback('paint', function ()
if resetp:get_value() == true then
name_offset_x:set_value(0)
name_offset_y:set_value(0)
pet_offset_x:set_value(44)
pet_offset_y:set_value(44)
pet_offset_z:set_value(-60)
pet_size:set_value(44)
pet_rot:set_value(0.0)
pet_name:set_value("uwuboi")
mirrored:set_value(false)
resetp:set_value(false)
client.notify("default settings restored.")
end
if unlod:get_value() == true then
petmode:set_value(0)
local current_script_name = client.get_script_name()
client.unload_script(current_script_name)
end
local alpha = pet_alpha:get_value() * 2.55
local pname = pet_name:get_value()
local lp = entitylist.get_local_player()
local dot_pos = lp:get_player_hitbox_pos(4)
local mirindx = mirrored:get_value()
local imgindex = png_files:get_value()
local size_png = pet_size:get_value()
local origin_x = dot_pos.x + pet_offset_x:get_value()
local origin_y = dot_pos.y + pet_offset_y :get_value()
local origin_z = dot_pos.z + pet_offset_z:get_value()
local prot = size_png * pet_rot:get_value()/90
local high_x = origin_x - size_png/2 + prot
local high_y = origin_y + size_png/2
local high_z = origin_z + size_png
local low_x = origin_x + size_png/2 - prot
local low_y = origin_y - size_png/2
local low_z = origin_z
local tx = name_offset_x:get_value()
local ty = name_offset_y:get_value()
local my_texture = renderer.setup_texture(path .. "\\" .. files[png_files:get_value()])
local high_pos , mid_pos , low_pos , org_pos = vec3_t.new(high_x,high_y,high_z) , vec3_t.new(origin_x,origin_y,origin_z) , vec3_t.new(low_x,low_y,low_z) , vec3_t.new(dot_pos.x,dot_pos.y,dot_pos.z)
local w2s, w2s1 , w2s2 , w1s = se.world_to_screen(high_pos) , se.world_to_screen(mid_pos) , se.world_to_screen(low_pos) , se.world_to_screen(org_pos)
if petmode:get_value() == 0 then
return
end
if petmode:get_value() == 1 then
local tpc = ui.get_check_box("visuals_thirdperson")
if tpc:get_value() == false then
if mirrored:get_value() == true then
renderer.texture(my_texture, vec2_t.new(screen.x/2-size_png*1.5+pet_offset_x:get_value()*2.5,screen.y/2- size_png*3+pet_offset_y :get_value()*1.5), vec2_t.new(screen.x/2 + size_png*1.5+pet_offset_x:get_value()*2.5,screen.y/2+pet_offset_y :get_value()*1.5), color_t.new(255, 255, 255, alpha))
end
if mirrored:get_value() == false then
renderer.texture(my_texture, vec2_t.new(screen.x/2+size_png*1.5+pet_offset_x:get_value()*2.5,screen.y/2- size_png*3+pet_offset_y :get_value()*1.5), vec2_t.new(screen.x/2- size_png*1.5+pet_offset_x:get_value()*2.5,screen.y/2+pet_offset_y :get_value()*1.5), color_t.new(255, 255, 255, alpha))
end
local text_size = renderer.get_text_size(tahoma_bold, 24,pname)
local text_size_x, text_size_y = text_size.x, text_size.y
renderer.text(pname , tahoma_bold, vec2_t.new(screen.x/2+pet_offset_x:get_value()*2.5-text_size_x/2 + tx*2,screen.y/2-size_png*2+pet_offset_y :get_value()*1.5-text_size_y*3-ty), 24, color_t.new(255, 255, 255, 255))
end
if tpc:get_value() == true then
if w1s ~= nil then
if mirrored:get_value() == true then
renderer.texture(my_texture, vec2_t.new(w1s.x-size_png*1.5+pet_offset_x:get_value()*1.5,w1s.y- size_png*3+pet_offset_y :get_value()*1.5), vec2_t.new(w1s.x+ size_png*1.5+pet_offset_x:get_value()*1.5,w1s.y+pet_offset_y :get_value()*1.5), color_t.new(255, 255, 255, alpha))
end
if mirrored:get_value() == false then
renderer.texture(my_texture, vec2_t.new(w1s.x+size_png*1.5+pet_offset_x:get_value()*1.5,w1s.y- size_png*3+pet_offset_y :get_value()*1.5), vec2_t.new(w1s.x- size_png*1.5+pet_offset_x:get_value()*1.5,w1s.y+pet_offset_y :get_value()*1.5), color_t.new(255, 255, 255, alpha))
end
local text_size = renderer.get_text_size(tahoma_bold, 24,pname)
local text_size_x, text_size_y = text_size.x, text_size.y
renderer.text(pname , tahoma_bold, vec2_t.new(w1s.x+pet_offset_x:get_value()*1.5-text_size_x/2 + tx*1.5,w1s.y-size_png*2+pet_offset_y :get_value()*1.5-text_size_y*3-ty*1.5), 24, color_t.new(255, 255, 255, 255))
end
end
end
if petmode:get_value() == 2 then
if w2s1 ~= nil then
if mirrored:get_value() == true then
renderer.texture(my_texture, vec2_t.new(w2s1.x-size_png*1.5,w2s1.y- size_png*3), vec2_t.new(w2s1.x+ size_png*1.5,w2s1.y), color_t.new(255, 255, 255, alpha))
end
if mirrored:get_value() == false then
renderer.texture(my_texture, vec2_t.new(w2s1.x+size_png*1.5,w2s1.y- size_png*3), vec2_t.new(w2s1.x- size_png*1.5,w2s1.y), color_t.new(255, 255, 255, alpha))
end
local text_size = renderer.get_text_size(tahoma_bold, 24,pname)
local text_size_x, text_size_y = text_size.x, text_size.y
renderer.text(pname , tahoma_bold, vec2_t.new(w2s1.x-text_size_x/2+tx,w2s1.y-size_png*2-text_size_y*3-ty), 24, color_t.new(255, 255, 255, 255))
end
end
if petmode:get_value() == 3 then
if w2s ~= nil and w2s2 ~= nil and w2s1 ~= nil then
if mirrored:get_value() == true then
renderer.texture(my_texture, vec2_t.new(w2s.x,w2s1.y-size_png*4), vec2_t.new(w2s2.x,w2s1.y), color_t.new(255, 255, 255, alpha))
end
if mirrored:get_value() == false then
renderer.texture(my_texture, vec2_t.new(w2s2.x,w2s1.y-size_png*4), vec2_t.new(w2s.x,w2s1.y), color_t.new(255, 255, 255, alpha))
end
local text_size = renderer.get_text_size(tahoma_bold, 24,pname)
local text_size_x, text_size_y = text_size.x, text_size.y
renderer.text(pname , tahoma_bold, vec2_t.new(w2s1.x-text_size_x/2+tx*1.5,w2s1.y-size_png*3-text_size_y*3-ty*1.5), 24, color_t.new(255, 255, 255, 255))
end
end
if petmode:get_value() == 4 then
if w2s ~= nil and w2s2 ~= nil and w2s1 ~= nil then
if mirrored:get_value() == true then
renderer.texture(my_texture, vec2_t.new(w2s.x,w2s.y), vec2_t.new(w2s2.x,w2s2.y), color_t.new(255, 255, 255, alpha))
end
if mirrored:get_value() == false then
renderer.texture(my_texture, vec2_t.new(w2s2.x,w2s.y), vec2_t.new(w2s.x,w2s2.y), color_t.new(255, 255, 255, alpha))
end
local text_size = renderer.get_text_size(tahoma_bold, 24,pname)
local text_size_x, text_size_y = text_size.x, text_size.y
renderer.text(pname , tahoma_bold, vec2_t.new(w2s1.x-text_size_x/2+tx*1.5,w2s.y-text_size_y*1.5-ty*1.5), 24, color_t.new(255, 255, 255, alpha))
end
end
end)
function on_unload()
pet_offset_x:set_value(44)
pet_offset_y:set_value(44)
pet_offset_z:set_value(-60)
pet_size:set_value(44)
petmode:set_value(0)
pet_name:set_value("uwuboi")
mirrored:set_value(false)
resetp:set_value(false)
end
client.register_callback('unload', on_unload)
Последнее редактирование: