Page 1 of 1

Need help with multiple Ices

Posted: Fri Jun 19, 2009 7:43 am
by manstie
I asked you before in that other post but I gathered that you would just say "Make another topic about it"


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

Re: Need help with multiple Ices

Posted: Sat Jun 20, 2009 9:33 am
by 3ICE
You only need one Sliding System for everything, don't make any more copies of it. Look at the faq.

Re: Need help with multiple Ices

Posted: Sat Jun 20, 2009 11:46 pm
by manstie
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.
willy wrote:how 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...
Polar wrote:Thank 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
BAH! I'm out smarted!!!
I only need that and to add reverse steering. :|
3ICE wrote:and 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())
		call SetUnitFacing(u,57.295828*Atan2(GetLocationY(p)-y,GetLocationX(p)-x))
		call SetUnitFacing(u,57.295828*Atan2(GetLocationY(p)-y,GetLocationX(p)-x)+180)
	call RemoveLocation(p)
	set p=null
	set u=null

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()
		call SetUnitFacing(u,57.295828*Atan2(b-y,a-x))
		call SetUnitFacing(u,57.295828*Atan2(b-y,a-x)+180)
	set u=null

function ReturnTrue takes nothing returns boolean
	return true

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)
		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
but that isn't working.
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: