• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Orientations on the Lua programming language with additional features DotA 2?

Status
Not open for further replies.
Level 9
Joined
Jul 7, 2011
Messages
275
Hello everyone.

I'm here to ask orientations to me, about the programming language DotA 2 - Lua. That is try learn program until get to program in DotA 2 custom modes (cushy).

And if you want also helps me the functionate this programming:

On addon_game_mode.lua:

Code:
require("Spawner_creeps")

Code:
function Activate()

         unit_group[1] = "npc_dota_neutral_kobold"
         unit_group[2] = "npc_dota_neutral_ghost"
         unit_group[3] = "npc_dota_neutral_harpy_scout"
         unit_group[4] = "npc_dota_neutral_satyr_trickster"
         unit_group[5] = "npc_dota_neutral_gnoll_assassin"
         end
					
		     if start_after == 360 then do
		     
         unit_group[1] = "npc_dota_neutral_alpha_wolf"
         unit_group[2] = "npc_dota_neutral_mud_golem"
         unit_group[3] = "npc_dota_neutral_centaur_outrunner"
         unit_group[4] = "npc_dota_neutral_ogre_mauler"
         unit_group[5] = "npc_dota_neutral_satyr_soulstealer" 
         end
end

In a script I created (Spawner_creeps.lua):

Code:
function SpawnCreeps()
   -- local unit = CreateUnitByName( "unit_group"(math.random[1,5]), spawnercreep, true, nil, nil, DOTA_TEAM_NEUTRALS )
       local unit = CreateUnitFromTable(unit_group(math.random[1,5]), spawnercreep) 
end

local spawnercreep = nil
    while spawnercreep == nil do
    spawnercreep = Entities:Findbyname("spawn_creep"):GetOrigin() + RandomVector( RandomFloat( 100, ))
end

The intention is to create a spawner to spawn neutral creeps. That every 6 minutes until arrive the most powerful creeps, the creeps vain changing (the units in the variable).


imgur
 
Status
Not open for further replies.
Top