- 18 Окт 2015
- 37
- 0
У меня есть 2 команды я хочю чтоб за радиант были все кто есть в списки но если ты зашол за dire то утя только 2 перса на выбор. Как так сделать?!
У меня есть 2 команды я хочю чтоб за радиант были все кто есть в списки но если ты зашол за dire то утя только 2 перса на выбор. Как так сделать?!
Стой ты кинул сылку я посмотрел, сделал как там но чёт не работает захожу за dire и всеровно тоже самое обычный список просто могу всех выбрать. Можно подробнее.
scripts\vscripts\addon_game_mode.luaТы выложи свой код, куда ты вставил мой код)
scripts\vscripts\addon_game_mode.lua
-- Generated from templateЯ имел в виду содержание этого файла.
мм у меня нет такого файла!Мгм
Теперь скинь содержимое твоего CAddonTemplateGameMode.lua
мм у меня нет такого файла!
Когда создаёш аддон поевляется addon_game_mode.luaПочему-то, я об этом догадывался....
У тебя в "vscripts" только лишь "addon_game_mode.lua" ?
Думаю что да. Тогда, откуда ты его взял? С какого-то примера? И что ты туда самостоятельно вписывал, если вписывал?
Когда создаёш аддон поевляется addon_game_mode.lua
у вас появляется файл с расширением addon_game_mode.lua. Как можно заметить, расширение у него .lua. Это говорит нам о том, что он написан на языке lua, что является скриптовым языком....\Steam\SteamApps\common\dota 2 beta\game\dota_addons\your_addon\scripts\vscripts
if CAddonTemplateGameMode == nil then
CAddonTemplateGameMode = class({})
end
function Precache( context )
--[[
Precache things we know we'll use. Possible file types include (but not limited to):
PrecacheResource( "model", "*.vmdl", context )
PrecacheResource( "soundfile", "*.vsndevts", context )
PrecacheResource( "particle", "*.vpcf", context )
PrecacheResource( "particle_folder", "particles/folder", context )
]]
end
-- Create the game mode when we activate
function Activate()
GameRules.AddonTemplate = CAddonTemplateGameMode()
GameRules.AddonTemplate:InitGameMode()
end
function CAddonTemplateGameMode:InitGameMode()
print( "Template addon is loaded." )
GameRules:GetGameModeEntity():SetThink( "OnThink", self, "GlobalThink", 2 )
end
-- Evaluate the state of the game
function CAddonTemplateGameMode:OnThink()
if GameRules:State_Get() == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
--print( "Template addon script is running." )
elseif GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then
return nil
end
return 1
end
function Precache( context )
--[[
Precache things we know we'll use. Possible file types include (but not limited to):
PrecacheResource( "model", "*.vmdl", context )
PrecacheResource( "soundfile", "*.vsndevts", context )
PrecacheResource( "particle", "*.vpcf", context )
PrecacheResource( "particle_folder", "particles/folder", context )
]]
end
function Activate()
end
function Precache( context )
end
function Activate()
end
function Precache( context )
end
лежат два файла: "addon_game_mode.lua" и "ForTest.lua"...\Steam\SteamApps\common\dota 2 beta\game\dota_addons\your_addon\scripts\vscripts
if ForTest == nil then
_G.ForTest = class({})
end
function Precache( context )
end
function Activate()
end
if ForTest == nil then
_G.ForTest = class({})
end
if ForTest == nil then
ForTest = class({})
end
require( 'ForTest' )
require('/другая папочка/ForTest' )
if ForTest == nil then
_G.ForTest = class({})
end
require( 'ForTest' )
function Precache( context )
end
function Activate()
end
function ForTest:InitGameMode()
end
function ForTest:AvadaCedavra()
end
function ForTest:InitGameMode()
print("------------------------------------game init----------------------------------------")
end
if ForTest == nil then
_G.ForTest = class({})
end
require( 'ForTest' )
function Precache( context )
end
function Activate()
ForTest:InitGameMode()
end
if ForTest == nil then
_G.ForTest = class({})
end
require( 'ForTest' )
function ForTest:InitGameMode()
print("------------------------------------game init----------------------------------------")
end
if ForTest == nil then
_G.ForTest = class({})
end
require( 'ForTest' )
function Precache( context )
--[[
Precache things we know we'll use. Possible file types include (but not limited to):
PrecacheResource( "model", "*.vmdl", context )
PrecacheResource( "soundfile", "*.vsndevts", context )
PrecacheResource( "particle", "*.vpcf", context )
PrecacheResource( "particle_folder", "particles/folder", context )
]]
end
function Activate()
ForTest:InitGameMode()
end
function ForTest:InitGameMode()
print("------------------------------------game init----------------------------------------")
end
Да ты прав я не дружу с программированием, но не много понимаю по этому я сижу на формах и читай как, что сделать, будь добар написать для меня гайд и отписатся когда напишешь.
if CAddonTemplateGameMode == nil then
CAddonTemplateGameMode = class({})
end
function Precache( context )
--[[
Precache things we know we'll use. Possible file types include (but not limited to):
PrecacheResource( "model", "*.vmdl", context )
PrecacheResource( "soundfile", "*.vsndevts", context )
PrecacheResource( "particle", "*.vpcf", context )
PrecacheResource( "particle_folder", "particles/folder", context )
]]
end
-- Create the game mode when we activate
function Activate()
GameRules.AddonTemplate = CAddonTemplateGameMode()
GameRules.AddonTemplate:InitGameMode()
end
function CAddonTemplateGameMode:InitGameMode()
print( "Template addon is loaded." )
GameRules:GetGameModeEntity():SetThink( "OnThink", self, "GlobalThink", 2 )
end
-- Evaluate the state of the game
function CAddonTemplateGameMode:OnThink()
if GameRules:State_Get() == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
--print( "Template addon script is running." )
elseif GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then
return nil
end
return 1
end
function Precache( context )
--[[
Precache things we know we'll use. Possible file types include (but not limited to):
PrecacheResource( "model", "*.vmdl", context )
PrecacheResource( "soundfile", "*.vsndevts", context )
PrecacheResource( "particle", "*.vpcf", context )
PrecacheResource( "particle_folder", "particles/folder", context )
]]
end
function Activate()
end
function Precache( context )
end
function Activate()
end
function Precache( context )
end
if ForTest == nil then
_G.ForTest = class({})
end
function Precache( context )
end
function Activate()
end
if ForTest == nil then
_G.ForTest = class({})
end
if ForTest == nil then
ForTest = class({})
end
require( 'ForTest' )
require('/другая папочка/ForTest' )
if ForTest == nil then
_G.ForTest = class({})
end
require( 'ForTest' )
function Precache( context )
end
function Activate()
end
function ForTest:InitGameMode()
end
function ForTest:AvadaCedavra()
end
function ForTest:InitGameMode()
print("------------------------------------game init----------------------------------------")
end
if ForTest == nil then
_G.ForTest = class({})
end
require( 'ForTest' )
function Precache( context )
end
function Activate()
ForTest:InitGameMode()
end
if ForTest == nil then
_G.ForTest = class({})
end
require( 'ForTest' )
function ForTest:InitGameMode()
print("------------------------------------game init----------------------------------------")
end
if ForTest == nil then
_G.ForTest = class({})
end
require( 'ForTest' )
function Precache( context )
--[[
Precache things we know we'll use. Possible file types include (but not limited to):
PrecacheResource( "model", "*.vmdl", context )
PrecacheResource( "soundfile", "*.vsndevts", context )
PrecacheResource( "particle", "*.vpcf", context )
PrecacheResource( "particle_folder", "particles/folder", context )
]]
end
function Activate()
ForTest:InitGameMode()
end
function ForTest:InitGameMode()
print("------------------------------------game init----------------------------------------")
end
Да я понел, сяб , +подключил barebones , rep+Ну как, разобрался?