jnZ
I
- Reaction score
- 64
Ok here is what i am trying to do: i want to create a "movementsystem" (more or less) that allows moving 1 hero (for each player) without having him selected.
I asked and searched arround and noticed that the only way to do this is via trackables.
So i looked at some trackable turtorials but because i understand a sh*t of jass in rly understood nothing >.<
I would be rly glad (and +rep) if anyone here could edit the trigger below (from 1 of the turtorials) so that the above mentioned features work. (in my map up to 10 players will be able to play to it would be awesome if this could be MPI but every player only got 1 hero so no need for MUI (makes no sense here anyway ^^)
> when i tried to edit the Trackable trigger i noticed that its quiet easy and a nice feature to let the hero face wherever the mouse currently is.
When i tried to edit this trigger i got critical errors everytime so i thought it would be the best to ask here arround for help
I asked and searched arround and noticed that the only way to do this is via trackables.
So i looked at some trackable turtorials but because i understand a sh*t of jass in rly understood nothing >.<
I would be rly glad (and +rep) if anyone here could edit the trigger below (from 1 of the turtorials) so that the above mentioned features work. (in my map up to 10 players will be able to play to it would be awesome if this could be MPI but every player only got 1 hero so no need for MUI (makes no sense here anyway ^^)
> when i tried to edit the Trackable trigger i noticed that its quiet easy and a nice feature to let the hero face wherever the mouse currently is.
When i tried to edit this trigger i got critical errors everytime so i thought it would be the best to ask here arround for help
JASS:
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_Hero, loc, 0.5) // I GUESS THIS IS THE FACING PART QUIET EASY TILL HERE
endfunction
function TrackableHit takes nothing returns nothing
local real x = GetTrackableX(GetTriggeringTrackable())
local real y = GetTrackableY(GetTriggeringTrackable())
local effect fx
local group bombs
local unit bomb
local real d
if ( udg_Overheated or udg_GameOver ) then
return
endif
set udg_ShotsFired = udg_ShotsFired + 1
set bombs = CloneGroup(udg_Bombs)
set fx = AddSpecialEffect("Abilities\\Weapons\\Mortar\\MortarMissile.mdl", x, y)
call DestroyEffect(fx)
call SetUnitAnimation(udg_Tower, "attack spell")
loop
set bomb = FirstOfGroup(bombs)
exitwhen bomb == null
set d = (GetUnitX(bomb)-x)*(GetUnitX(bomb)-x) + (GetUnitY(bomb)-y)*(GetUnitY(bomb)-y)
if ( d <= udg_ShootAOE*udg_ShootAOE ) then
if ( GetHandleInt(bomb, "super") == 1 ) then
set udg_SuperrocketsShot = udg_SuperrocketsShot + 1
else
set udg_RocketsShot = udg_RocketsShot + 1
endif
call GroupRemoveUnit(udg_Bombs, bomb)
call KillUnit(bomb)
endif
call GroupRemoveUnit(bombs, bomb)
endloop
call DestroyGroup(bombs)
set udg_OverheatShots = udg_OverheatShots + 1
call TriggerExecute(gg_trg_Update_Leaderboard) // NO NEED FOR ALL THOSE EFFECTS // OVERHEAT THINGS ETC I JUST WANT THE HERO OF THE TRACKABLE HITTING PLAYER TO MOVE TO THE LOCATION OF THE TRACKABLE
endfunction
function Trig_Init_Trackables_Actions takes nothing returns nothing
local trigger hit = CreateTrigger()
local trigger track = CreateTrigger()
local real x
local real y = GetRectMinY(gg_rct_Bomb_area) + 64
local real maxY = GetRectMaxY(gg_rct_Bomb_area)
local real maxX = GetRectMaxX(gg_rct_Bomb_area)
loop
exitwhen y > maxY - 64
set x = GetRectMinX(gg_rct_Bomb_area) + 64
loop
exitwhen x > maxX - 64
call NewTrackable("war3mapImported\\4x4Trackable.mdl", x, y, GetPlayersAll(), track, hit)
set x = x + 128
endloop
set y = y + 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