Need help with multiple Ices

The perfect one step solution for creating Ice/Sliding Mazes in both Reign of Chaos and The Frozen Throne. It is the only decent system around and it even works in RoC, is lagfree, perfectly optimized, fast and reliable. The included TerrainKill feature frees you from the tedious task of creating a thousand kill-regions.

Need help with multiple Ices

New postby manstie on Fri Jun 19, 2009 7:43 am

I asked you before in that other post but I gathered that you would just say "Make another topic about it"

So.

My problem is having a faster ice and a reverse controlled ice.

FastSlide FastSlide
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_Slide3)then
call SetUnitX(u,x+udg_Speed2*Cos(0.017453278*GetUnitFacing(u)))
call SetUnitY(u,y+udg_Speed2*Sin(0.017453278*GetUnitFacing(u)))

//Delete this line for the cool Realistic Sliding Mode (Between START1 and END1)
//START1
call IssueImmediateOrder(u,"stop")
//END1
endif
set u=null
endfunction

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

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


So I tried that but nothing works by copying and pasting with your triggers... (The save "bug", as we have discussed before).

As well as the reverse controlling ice.

Could I have those in a non-save-"bug" format, if you can :D
Image
User avatar
manstie
 
Posts: 273
Joined: Wed Jun 17, 2009 9:27 am
Location: Perth, Australia
Account: manstie

Re: Need help with multiple Ices

New postby 3ICE on Sat Jun 20, 2009 9:33 am

You only need one Sliding System for everything, don't make any more copies of it. Look at the faq.
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2118
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Need help with multiple Ices

New postby manstie on Sat Jun 20, 2009 11:46 pm

I was thinking, if I added an if/then/else to the jass, could it be:
If position of unit is on "Superfastice" then do use speed2
or something? I'm so retarded.

willyhow do you make it work on many tilesets att once? ex if i want to slide on every tile except one

I don't understand what he is asking thus not understanding what your telling him...
PolarThank you so much for this! You are right when saying that the // comments explain everything, I even figured out how to make 2 types of ice with different speed myself.
I will put your name and link into the loading screen, even though I probably wont use the map on Battle.net.

BAH! I'm out smarted!!!
I only need that and to add reverse steering. :|

3ICEand in the Setup2 trigger set usg_Slide to the terrain you don't want to slide on.

Bahahahaha, you said usg_Slide instead of udg_Slide
------------------------------------------------------------------------------------------------------------------------------
HA! IN YOUR FACE 3ICE! I figured out how to make a different ice a different speed :twisted:
Now I think I know why you were being suborn and not just telling me straight forward what to do.
Was it so i can get to know more JASS?
------------------------------------------------------------------------------------------------------------------------------
I still can't figure out how to get the reverse STEERING working.
I've got
Code: Select all
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)or(GetTerrainType(x,y)==udg_Slide3)and(IsUnitInGroup(u,udg_H))then
      call SetUnitFacing(u,57.295828*Atan2(GetLocationY(p)-y,GetLocationX(p)-x))
   endif
   if(GetTerrainType(x,y)==udg_Slide4)and(IsUnitInGroup(u,udg_H))then
      call SetUnitFacing(u,57.295828*Atan2(GetLocationY(p)-y,GetLocationX(p)-x)+180)
   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)or(GetTerrainType(x,y)==udg_Slide3)and(IsUnitInGroup(u,udg_H))then
      call SetUnitFacing(u,57.295828*Atan2(b-y,a-x))
   endif
   if(GetTerrainType(x,y)==udg_Slid4)and(IsUnitInGroup(u,udg_H))then
      call SetUnitFacing(u,57.295828*Atan2(b-y,a-x)+180)
   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

but that isn't working.
BUT WAIT!!!
Using my logic and how I made the different ice sliding speeds, IT IS A SUCCESS!
I know almost every feature for your sliding system now! (Only thing missing is understanding "Realistic Sliding Mode" and how to make "Boosters")
But still! :mrgreen:
Image
User avatar
manstie
 
Posts: 273
Joined: Wed Jun 17, 2009 9:27 am
Location: Perth, Australia
Account: manstie


Return to 3ICE's Sliding System for RoC



Who is online

Users browsing this forum: No registered users and 2 guests

cron