• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

AoIE For RoC

Status
Not open for further replies.
Level 3
Joined
Oct 11, 2011
Messages
58
ok i know alot of you are familiar with AoIE well...i got a proplem with this trigger...you see i need alot of help...after i revive the unit it doesnt seem to slide on the ice no more 0.o well i dont revive it..it replaces the unit at said location..if anyone can fix it i would greatly love it...and i will give credits of course
 

Attachments

  • AoIE RoC.w3x
    45.2 KB · Views: 56
Level 3
Joined
Oct 11, 2011
Messages
58
  • SRCS Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Set your dummy type --------
      • Set DummyType = Dummy Circle
      • -------- Set your runner type --------
      • Set RunnerType = Demon Hunter
      • -------- This is the radius of check around the circle for it to detect to revive the unit --------
      • Set AoE_Check = 160.00
  • SRCS Event
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to RunnerType
    • Actions
      • Set Points[1] = (Position of (Triggering unit))
      • Unit - Create 1 DummyType for (Triggering player) at Points[1] facing Default building facing degrees
      • Unit Group - Add (Last created unit) to DeadGroup
      • Trigger - Turn on SRCS Loop <gen>
      • Custom script: call RemoveLocation(udg_Points[1])
  • SRCS Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DeadGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Unit Group - Pick every unit in DeadGroup and do (Actions)
        • Loop - Actions
          • Set Dummy = (Picked unit)
          • Set Points[1] = (Position of Dummy)
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within AoE_Check of Points[1]) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Picked unit) is alive) Equal to True) and ((Unit-type of (Picked unit)) Equal to RunnerType)
                • Then - Actions
                  • Unit - Replace Dummy with a RunnerType using The new unit's max life and mana
                  • Special Effect - Create a special effect at Points[1] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at Points[1] using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit Group - Remove Dummy from DeadGroup
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Points[1])

thats all of it...idk how to upload an image yet
 
Last edited by a moderator:
Level 3
Joined
Oct 11, 2011
Messages
58
JASS:
uh ok but its in jasss..
Setup1
    Events
        Map initialization
    Conditions
    Actions
        -------- Welcome!     This System was Created by 3ICE --------
        -------- [email][email protected][/email]     [url]http://www.3ice.hu/[/url] --------
        -------- Please check Setup2 too for extra settings --------
        -------- - --------
        -------- Everything inside the "H" unit group will slide on ice and die on snow (by default) --------
        Set H = (Units of type Demon Hunter)
        -------- Speed factor (Big number = Fast sliding) (Default is 4.00) --------
        Set Speed = 4.00
        -------- You can add more units to H (So they will be able to slide too) --------
        Unit Group - Add (Last created unit) to H
        -------- You can turn steering off so players will be able to slide but not turn --------
        -------- Variable autocreation (You can delete these two after importing) --------
        Set Slide = 3
        Set TerrainKill = 3

// List of all terrain type codes you can use:
// [url]http://www.3ice.hu/blog/3ice-sliding-system-for-roc/#comment-109[/url]
function SetTerrainTypes takes nothing returns nothing
//Change 'Nice' to the terrain type code you want to slide heroes:
	set udg_Slide = 'Nice'

//Change 'Nsnw' to the terrain type code you want to kill heroes:
	set udg_TerrainKill = 'Nsnw'
endfunction

function InitTrig_Setup2 takes nothing returns nothing
	set gg_trg_Setup2=CreateTrigger()
	call TriggerAddAction(gg_trg_Setup2,function SetTerrainTypes)
endfunction

// List of all terrain type codes you can use:
// [url]http://www.3ice.hu/blog/3ice-sliding-system-for-roc/#comment-109[/url]
function SetTerrainTypes takes nothing returns nothing
//Change 'Nice' to the terrain type code you want to slide heroes:
	set udg_Slide = 'Nice'

//Change 'Nsnw' to the terrain type code you want to kill heroes:
	set udg_TerrainKill = 'Nsnw'
endfunction

function InitTrig_Setup2 takes nothing returns nothing
	set gg_trg_Setup2=CreateTrigger()
	call TriggerAddAction(gg_trg_Setup2,function SetTerrainTypes)
endfunction


function S takes nothing returns nothing
	local unit u=GetEnumUnit()
	local real x=GetUnitX(u)
	local real y=GetUnitY(u)
	local integer t=GetTerrainType(x,y)
	if(t==udg_Slide)then
		call SetUnitX(u,x+udg_Speed*Cos(0.017453278*GetUnitFacing(u)))
		call SetUnitY(u,y+udg_Speed*Sin(0.017453278*GetUnitFacing(u)))


//Delete these two lines to remove terrainkill (Between START2 and END2)
//START2
	elseif(t==udg_TerrainKill)and(GetUnitState(u,UNIT_STATE_LIFE)>0)then
		call KillUnit(u)
//END2

	endif
	set u=null
endfunction

function Slide takes nothing returns nothing
	call ForGroup(udg_H,function S)
endfunction

function InitTrig_Slide takes nothing returns nothing
	set gg_trg_Slide=CreateTrigger()
	call TriggerRegisterTimerEvent(gg_trg_Slide,0.01,true)
	call TriggerAddAction(gg_trg_Slide,function Slide)
endfunction

function Turn takes nothing returns nothing
	local unit u=GetTriggerUnit()
	local real x=GetUnitX(u)
	local real y=GetUnitY(u)
	local location p=GetUnitLoc(GetOrderTargetUnit())
	if(GetTerrainType(x,y)==udg_Slide)and(IsUnitInGroup(u,udg_H))then
		call SetUnitFacing(u,57.295828*Atan2(GetLocationY(p)-y,GetLocationX(p)-x))
	endif
	call RemoveLocation(p)
	set p=null
	set u=null
endfunction

function Steer takes nothing returns nothing
	local unit u=GetTriggerUnit()
	local real x=GetUnitX(u)
	local real y=GetUnitY(u)
	local real a=GetOrderPointX()
	local real b=GetOrderPointY()
	if(GetTerrainType(x,y)==udg_Slide)and(IsUnitInGroup(u,udg_H))then
		call SetUnitFacing(u,57.295828*Atan2(b-y,a-x))
	endif
	set u=null
endfunction

function ReturnTrue takes nothing returns boolean
	return true
endfunction

function InitTrig_Steer takes nothing returns nothing
	local integer i=0
	local filterfunc nullboolexpr=Filter(function ReturnTrue)
	local trigger gg_trg_Turn=CreateTrigger()
	set gg_trg_Steer=CreateTrigger()
	call TriggerAddAction(gg_trg_Turn,function Turn)
	call TriggerAddAction(gg_trg_Steer,function Steer)
	loop
		exitwhen i>12
		call TriggerRegisterPlayerUnitEvent(gg_trg_Turn,Player(i),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,nullboolexpr)
		call TriggerRegisterPlayerUnitEvent(gg_trg_Steer,Player(i),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,nullboolexpr)
		set i=i+1
	endloop
endfunction

i would also like to make it "revive hero" at region but idk how to change the region according to levels
 
Last edited:
Please, use [code=jass][/code] tags.

Then your code will look like this:

JASS:
// List of all terrain type codes you can use:
// [url]http://www.3ice.hu/blog/3ice-sliding...c/#comment-109[/url]
function SetTerrainTypes takes nothing returns nothing
//Change 'Nice' to the terrain type code you want to slide heroes:
set udg_Slide = 'Nice'

//Change 'Nsnw' to the terrain type code you want to kill heroes:
set udg_TerrainKill = 'Nsnw'
endfunction

function InitTrig_Setup2 takes nothing returns nothing
set gg_trg_Setup2=CreateTrigger()
call TriggerAddAction(gg_trg_Setup2,function SetTerrainTypes)
endfunction

// List of all terrain type codes you can use:
// [url]http://www.3ice.hu/blog/3ice-sliding...c/#comment-109[/url]
function SetTerrainTypes takes nothing returns nothing
//Change 'Nice' to the terrain type code you want to slide heroes:
set udg_Slide = 'Nice'

//Change 'Nsnw' to the terrain type code you want to kill heroes:
set udg_TerrainKill = 'Nsnw'
endfunction

function InitTrig_Setup2 takes nothing returns nothing
set gg_trg_Setup2=CreateTrigger()
call TriggerAddAction(gg_trg_Setup2,function SetTerrainTypes)
endfunction


function S takes nothing returns nothing
local unit u=GetEnumUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local integer t=GetTerrainType(x,y)
if(t==udg_Slide)then
call SetUnitX(u,x+udg_Speed*Cos(0.017453278*GetUnitFacing(u)))
call SetUnitY(u,y+udg_Speed*Sin(0.017453278*GetUnitFacing(u)))


//Delete these two lines to remove terrainkill (Between START2 and END2)
//START2
elseif(t==udg_TerrainKill)and(GetUnitState(u,UNIT_STATE_LIFE)>0)then
call KillUnit(u)
//END2

endif
set u=null
endfunction

function Slide takes nothing returns nothing
call ForGroup(udg_H,function S)
endfunction

function InitTrig_Slide takes nothing returns nothing
set gg_trg_Slide=CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_Slide,0.01,true)
call TriggerAddAction(gg_trg_Slide,function Slide)
endfunction

function Turn takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local location p=GetUnitLoc(GetOrderTargetUnit())
if(GetTerrainType(x,y)==udg_Slide)and(IsUnitInGroup(u,udg_H))then
call SetUnitFacing(u,57.295828*Atan2(GetLocationY(p)-y,GetLocationX(p)-x))
endif
call RemoveLocation(p)
set p=null
set u=null
endfunction

function Steer takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local real a=GetOrderPointX()
local real b=GetOrderPointY()
if(GetTerrainType(x,y)==udg_Slide)and(IsUnitInGroup(u,udg_H))then
call SetUnitFacing(u,57.295828*Atan2(b-y,a-x))
endif
set u=null
endfunction

function ReturnTrue takes nothing returns boolean
return true
endfunction

function InitTrig_Steer takes nothing returns nothing
local integer i=0
local filterfunc nullboolexpr=Filter(function ReturnTrue)
local trigger gg_trg_Turn=CreateTrigger()
set gg_trg_Steer=CreateTrigger()
call TriggerAddAction(gg_trg_Turn,function Turn)
call TriggerAddAction(gg_trg_Steer,function Steer)
loop
exitwhen i>12
call TriggerRegisterPlayerUnitEvent(gg_trg_Turn,Player(i),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,nullboole xpr)
call TriggerRegisterPlayerUnitEvent(gg_trg_Steer,Player(i),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,nullboole xpr)
set i=i+1
endloop
endfunction

which is still difficult to read, because it's not properly indented.

Edit: To fix it, in your revive trigger, after you've created the unit, use the action "unit group - add unit" and add the last created unit to the unit group called 'H'.
 
Level 3
Joined
Oct 11, 2011
Messages
58
i got 1 more question...how do you make a unit unclickable/untargetable?
i have the ability data i just dont know how to set up the trigger..
 
Status
Not open for further replies.
Top