(The Custom value check is there to see if the unit is not in a certain area - as comparing terrain at point isn't available in SC2.)
First of all: This trigger gives me debug messages. Saying "try again". I imagine this message appears every 0.1 seconds, so it doesn't go away.
I figured this was because I only have 1 Hero assigned, but I thought my 'Hero[i] != No Unit' -condition would take care of that.
Secondly: My hero goes straight forward for a random amount of time (ie working as intended.) Then, all of a sudden (completely random) the hero turns on it's own. Some times it ends up spinning around in a very tight circle, round and round.
I figured this might be because the hero's idle animation makes it turn and look left and right. -Any way to prevent this?
Bonus question:
Is there a way to draw terrain using triggers?
Thanks in advance.
EDIT: Actually, it seems like everytime I order the unit to move while sliding, it starts spinning when it reaches it's destination. No idea why.
If you want prevent spinning you can set facing angle to variable so the facing angle doesnt change all the time or you can try to pause the unit so he cannot change facing angle.
i think it's because (Custom value 0 of Hero[i]) != 1.0
and if the hero[i] == no unit then it will cause an error
first make a if Hero[i] != No Unit
and after if another if with the other conditions
(Custom value 0 of Hero[i]) != 1.0
Hero[i] != No Unit
Basically you are saying to the editor that No unit has a custom value of 1.. You must have a unit there.
You also have a function that moves a unit, and it will only run if Hero[i] = No Unit, so it does not execute.
Second, create the following AFTER the If/Then/Else:
Set i = 0, otherwise, i will increase by 4 every time the trigger runs (4, 8, 12, etc).
(Custom value 0 of Hero[i]) != 1.0 Hero[i] != No Unit
Basically you are saying to the editor that No unit has a custom value of 1.. You must have a unit there. You also have a function that moves a unit, and it will only run if Hero[i] = No Unit, so it does not execute.
Second, create the following AFTER the If/Then/Else: Set i = 0, otherwise, i will increase by 4 every time the trigger runs (4, 8, 12, etc).
You need to learn how triggers work.
The condition:
Hero[i] != No Unit
means:
if Hero[i] is Not equal to No Unit (null)
meaning:
if Hero[i] is Actually a unit (any unit)
then... Do actions..
I agree that checking the custom value is a bit off, but it's the easiest way I can work around checking terrain texture at point. (Since it's missing in SC2, for some weird reason..)
Since i is a local variable it will create a new one for each trigger, every time the trigger runs.
i is initialized as 0. So no, it won't increase everytime a trigger runs. (It can even run two triggers at the same time, without interfering with each other, since it's local. Unlike global.)
So anyway. I fixed my debug message by changing the trigger a bit (it now works better with my map, so it was a win-win.)
My real problem still remains, however; the units still spin around in circles for no apparent reason.
Pausing the units is sadly not an option, since they are "heroes" and the players has to be able to move them around.
EDIT: Why does these forums fuck up my text when I press enter?
you need this function:
click move
Events
UI - Player Any Player clicks Right mouse button Down.
Local Variables
time = 0.0 <Real>
player = (Triggering player) <Integer>
Conditions
slide bool array[player] == true
Actions
Variable - Set last move[player] = (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))
Point - Make last move[player] face (Angle from (Position of player units[player]) to last move[player]) degrees
Variable - Set time = (Facing of player units[player])
Variable - Set time = (time - (Facing of last move[player]))
Variable - Set time = (time / 300.0)
Variable - Set time = (Abs(time))
UI - Display (Text(time) with Any Precision decimal places) for (All players) to Subtitle area
Unit - Order player units[player] to ( Stop) (Replace Existing Orders)
Unit - Make player units[player] face last move[player] over time seconds
and one like this:
slide
Events
Timer - Every 0.01 seconds of Game Time
Local Variables
i = 0 <Integer>
Conditions
Actions
General - For each integer i from 0 to 8 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
slide bool array[i] == true
Then
Unit - Move player units[i] instantly to ((Position of player units[i]) offset by 0.2 towards (Facing of player units[i]) degrees) (Blend)
Else
Yup i really am trying to make an ice slide effect only on ice... I tried your trigger dobs2... I had no condition option for slide bool array.... and im confused on the variables... I'm sorry im learning! lol
This thread is over 4 years old. The last response was 3 years ago. Chances of the people above still being here is only very slight.
I would recommend making a new topic and describing clearly what you are after.
Of note is that the fastest resolvable time in SC2 is 0.0625 seconds of game time as that is the period of deterministic frames. Smaller values should not be used for future compatibility (in case the frame period is lowered in a patch, does not help if it gets raised but chances of that is less than it being lowered). Blizzard really needs to add a "Frame Period" period constant to solve this.
Hi.
I'm having a bit of problem with my sliding trigger. First off, here's the trigger:
(The Custom value check is there to see if the unit is not in a certain area - as comparing terrain at point isn't available in SC2.)
First of all: This trigger gives me debug messages. Saying "try again". I imagine this message appears every 0.1 seconds, so it doesn't go away. I figured this was because I only have 1 Hero assigned, but I thought my 'Hero[i] != No Unit' -condition would take care of that.
Secondly: My hero goes straight forward for a random amount of time (ie working as intended.) Then, all of a sudden (completely random) the hero turns on it's own. Some times it ends up spinning around in a very tight circle, round and round. I figured this might be because the hero's idle animation makes it turn and look left and right. -Any way to prevent this?
Bonus question: Is there a way to draw terrain using triggers?
Thanks in advance.
EDIT: Actually, it seems like everytime I order the unit to move while sliding, it starts spinning when it reaches it's destination. No idea why.
that trigger itself seems fine.
If you want prevent spinning you can set facing angle to variable so the facing angle doesnt change all the time or you can try to pause the unit so he cannot change facing angle.
i think it's because (Custom value 0 of Hero[i]) != 1.0
and if the hero[i] == no unit then it will cause an error
first make a if Hero[i] != No Unit
and after if another if with the other conditions
(Custom value 0 of Hero[i]) != 1.0 Hero[i] != No Unit
Basically you are saying to the editor that No unit has a custom value of 1.. You must have a unit there. You also have a function that moves a unit, and it will only run if Hero[i] = No Unit, so it does not execute.
Second, create the following AFTER the If/Then/Else: Set i = 0, otherwise, i will increase by 4 every time the trigger runs (4, 8, 12, etc).
You need to learn how triggers work.
The condition: Hero[i] != No Unit
means:
if Hero[i] is Not equal to No Unit (null)
meaning:
if Hero[i] is Actually a unit (any unit)
then... Do actions..
I agree that checking the custom value is a bit off, but it's the easiest way I can work around checking terrain texture at point. (Since it's missing in SC2, for some weird reason..)
Since i is a local variable it will create a new one for each trigger, every time the trigger runs. i is initialized as 0. So no, it won't increase everytime a trigger runs. (It can even run two triggers at the same time, without interfering with each other, since it's local. Unlike global.)
So anyway. I fixed my debug message by changing the trigger a bit (it now works better with my map, so it was a win-win.)
My real problem still remains, however; the units still spin around in circles for no apparent reason. Pausing the units is sadly not an option, since they are "heroes" and the players has to be able to move them around.
EDIT: Why does these forums fuck up my text when I press enter?
small question
Is the location the unit moves to a fixed spot everytime or is it meant to be a random point based on your input into the game?
I made a slider too ;)
you need this function:
click move
Events
UI - Player Any Player clicks Right mouse button Down.
Local Variables
time = 0.0 <Real>
player = (Triggering player) <Integer>
Conditions
slide bool array[player] == true
Actions
Variable - Set last move[player] = (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))
Point - Make last move[player] face (Angle from (Position of player units[player]) to last move[player]) degrees
Variable - Set time = (Facing of player units[player])
Variable - Set time = (time - (Facing of last move[player]))
Variable - Set time = (time / 300.0)
Variable - Set time = (Abs(time))
UI - Display (Text(time) with Any Precision decimal places) for (All players) to Subtitle area
Unit - Order player units[player] to ( Stop) (Replace Existing Orders)
Unit - Make player units[player] face last move[player] over time seconds
and one like this:
slide
Events
Timer - Every 0.01 seconds of Game Time
Local Variables
i = 0 <Integer>
Conditions
Actions
General - For each integer i from 0 to 8 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
slide bool array[i] == true
Then
Unit - Move player units[i] instantly to ((Position of player units[i]) offset by 0.2 towards (Facing of player units[i]) degrees) (Blend)
Else
Yup i really am trying to make an ice slide effect only on ice... I tried your trigger dobs2... I had no condition option for slide bool array.... and im confused on the variables... I'm sorry im learning! lol
This thread is over 4 years old. The last response was 3 years ago. Chances of the people above still being here is only very slight.
I would recommend making a new topic and describing clearly what you are after.
Of note is that the fastest resolvable time in SC2 is 0.0625 seconds of game time as that is the period of deterministic frames. Smaller values should not be used for future compatibility (in case the frame period is lowered in a patch, does not help if it gets raised but chances of that is less than it being lowered). Blizzard really needs to add a "Frame Period" period constant to solve this.
lol ok. i didn't notice that. Thanks. I did create a post in map ideas...