Instantly Move

cleeezzz

The Undead Ranger.
Reaction score
268
Code:
Unit - Move (Triggering unit) instantly to (Center of (Playable map area)), facing Default building facing degrees

it works but it stops the unit, how do i make it continue its last order?

should i pause it, and then move it and the unpause?

(im trying to make it look like your getting sucked in by a tornado but you can still run to escape it.) the periodic is .05 seconds so i dont know if pause and unpause is a great solution,

thanks.
 

Somatic

You can change this now in User CP.
Reaction score
84
You cant make it fight the move as everytime even if the unit is moving, his being shifted to the location where its now at. thus making it unable to fight the suck at all.
 
T

Tubba

Guest
I've messed around a lot with this. Pausing/unpausing didn't work. My best bet was to set the custom value to something, and then issue order depending on the custom value.
 

C0mput3r

New Member
Reaction score
20
You'll never know till you try ;)


Umm, I see your thinking there, by pausing a unit, you store their last actions, and move them, then unpause to make them movable again.

Umm I'm not an expert in this, but if i remember correctly, Emjlr3 made a tower called the lasso tower and it sucks/pulls/lassos creeps towards you. He even put down the JASS Coding.

WARNING: The below link can only be accessed if you are eighter A-a moderator B-A hacker or C-Fluent in JASS or D-A combination of these.
:DLOL:)


http://www.thehelper.net/forums/showthread.php?t=77159&page=5

His was the #73rd Post, Also thats where I live!!

To Post #6
Emjlr3's slide did allow the creeps to fight the slide... But the slide/Periodic/whatever was too fast for most of the creeps cept for the drake. And the Drake could only escape it if it was already far away.
 
Reaction score
107
The only way i've heard to do this is to slide by using X,Y co-ordinates, which is as far as i know about it :p
Maybe someone who knows more, like one of the mods, will come and elaborate..
 

Somatic

You can change this now in User CP.
Reaction score
84
Guys, read up Please!

He wants a method to "FIGHT" a Slide, not to Slide!
 
K

Kerberos

Guest
I'm fairly sure there is no GUI way to do this. If you aren't too afraid of JASS, this will do it.

I'm assuming that you're doing this in a "Pick every unit in Unit Group and do Actions" loop. If you aren't, this is wrong. If you are, just put these lines in instead of "move unit instantly." (Note: JASS is sensitive, so you'll have to enter these exactly.)
Code:
Custom script:    call SetUnitX(GetEnumUnit(),(GetUnitX(GetEnumUnit()+Cos(bj_DEGTORAD*AngleBetweenPoints(GetUnitLoc(GetEnumUnit()),[b][u]L[/b][/u])))*[b][u]K[/b][/u])
Custom script:    call SetUnitY(GetEnumUnit(),(GetUnitY(GetEnumUnit()+Sin(bj_DEGTORAD*AngleBetweenPoints(GetUnitLoc(GetEnumUnit()),[b][u]L[/b][/u])))*[b][u]K[/b][/u])

The L is the location of the tornado. If it's a point variable named VARIABLENAME, replace L with
udg_VARIABLENAME

If it's a unit, replace L with
GetUnitLoc(udg_VARIABLENAME)

K is some number. Messing with K will change how quickly the tornado sucks things in.
 
Reaction score
107
Guys, read up Please!

He wants a method to "FIGHT" a Slide, not to Slide!

Yes I know... Conventional sliding using the code he posted in his first breaks the units order, so once you're being "sucked" you can't escape.

Sliding by X,Y co-ordinates allows the unit to slide while keeping the units order, and taking a quick look at emjlr3 JASS code, and my basic JASS knowledge, this is the way he is doing it...
 
T

Tubba

Guest
What's XY-sliding? Setting the coordinates of a unit instead of moving it to a point?


Oh, thanks for that snippet. Will come in handy for me :D
 

Somatic

You can change this now in User CP.
Reaction score
84
Ok, Baka - Ranger is right. I've checked the new Knockback script by Emilj.

Its possible to not cancel the order of the unit if you do this

JASS:
Set unitX (u,x)
Set unity (u,y)


Meaning to say, since a position is consist of a coordinates (x,y). You shift it by changing the unit's X and Y coordinates instead of the Location itself.
 
T

Tubba

Guest
I'm fairly sure there is no GUI way to do this. If you aren't too afraid of JASS, this will do it.

I'm assuming that you're doing this in a "Pick every unit in Unit Group and do Actions" loop. If you aren't, this is wrong. If you are, just put these lines in instead of "move unit instantly." (Note: JASS is sensitive, so you'll have to enter these exactly.)
Code:
Custom script:    call SetUnitX(GetEnumUnit(),(GetUnitX(GetEnumUnit()+Cos(bj_DEGTORAD*AngleBetweenPoints(GetUnitLoc(GetEnumUnit()),[b][u]L[/b][/u])))*[b][u]K[/b][/u])
Custom script:    call SetUnitY(GetEnumUnit(),(GetUnitY(GetEnumUnit()+Sin(bj_DEGTORAD*AngleBetweenPoints(GetUnitLoc(GetEnumUnit()),[b][u]L[/b][/u])))*[b][u]K[/b][/u])

The L is the location of the tornado. If it's a point variable named VARIABLENAME, replace L with
udg_VARIABLENAME

If it's a unit, replace L with
GetUnitLoc(udg_VARIABLENAME)

K is some number. Messing with K will change how quickly the tornado sucks things in.

Hate to hijack, but I tried this:

Code:
call SetUnitX(GetEnumUnit(),(GetUnitX(GetEnumUnit()+Cos(bj_DEGTORAD*AngleBetweenPoints(GetUnitLoc(GetEnumUnit()),udg_tempCasterPos)))*0.2)

And the same for Y. I get the error message "Invalid type for specified operator". Any tips?
 
T

Tubba

Guest
I tried with plain and simple "2" as well, didn't work either.

And yes, it's inside a "Pick every unit" loop.
 

Psiblade94122

In need of sleep
Reaction score
138
well, if your trying to fight a slide (this would make tons of lagg if not coded correctly) you can make everything in that tornado run by a physics engine, <like mad ball's or so>, then every time the unit is issues an order, use the physics engine to "propell" that unit in that direction, this would move with the tornado (meaning in reality, eventho your slideing out of the tornado, you are also being sucked in) <make the propulsion<slide speed> ofthe unit greater then that of the tornado's propulsion >

so basically... itll look something like this (trigger wise)

Simple slide trigger
Functions for slideing the units depending on the unit's propulsion <aquired after ordered to move out of tornado>
Functions for slideing units into the torado depending on how strong the tornado is <aquired when the tornado is spawned>

ingame you would see two things happening

1. The person slowly escapes
2. The person would not move in or out
3. The person is slowly sucked in

reasons for that
1. unit's propulsion is > then tornado's
2. units propulsion is = to the tornado's
3. unit's propulsion is < then tornado's

the issued order thing i have no idea how to work with that... but this is basically the idea behind a similar effect that i made ages ago <black hole from one of my many space maps>

oh, note... after the unit escapes, they will have no order <my map had mo problems with this because everything moved via slides>
 

Somatic

You can change this now in User CP.
Reaction score
84
Ok,

K is the rate of the distance you want it to get sucked in.
Meaning if k is 50, it would move 50 times the duration you set.

For L, its the existing X or Y of the unit.
 
T

Tubba

Guest
I know, but it's complaining about "Invalid type for specified operator". I just can't get it to work :S
 

Somatic

You can change this now in User CP.
Reaction score
84
Yes Tubba

Cleeezzz - Its just using Coordinates to shift units instead of using locations.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top