I have a function that helps me set the height of a unit based on gametime. Now gametime doesn't have it's own tag to be checked in the trigger editor so I started a timer at Melee Initialization using the Timer variable "Timer."
However, when I put this variable in an equation (Which simplifies down to Cos(Timer)), Timer = 0 and Cos(Timer) returns 1. I know the timer is running because I made the timer display in a Timer Box on my screen.
Can Timer variables not be used in equations to give a value back?
Does anyone know another way I can vary height as time passes?
None.
Are you just just using Cos(Timer)? It should be something like Cos(Elapsed Time of Timer(Timer)). The actual Timer variable I doubt can be used on its own without conversion. If worst comes to worst, you could create a period trigger to increment a value (with the event probably being a repeating timer), and then use that value instead.
None.
I guess I oversimplified, here is the actual function:
4+4*Abs(Cos( (Elapsed time of Timer) / (2pi/7) ))
I was going to use the incrementing method as a total last resort... that could cause laag on my map right? A trigger that triggers every second for the entire game?
None.

An artist's depiction of an Extended Unit Death
Now gametime doesn't have it's own tag to be checked in the trigger editor
Have you investigated "Periodic Event" or "Time Elapsed"? These should work just fine for game time.
Are you sure the Timer is properly stored in the variable? You could be creating a Timer (which would show in the timer window) but not set it in your global variable, so the equation, when reading the variable, always reads 0.
I was going to use the incrementing method as a total last resort... that could cause laag on my map right? A trigger that triggers every second for the entire game?
I've made triggers that fire every 0.05 seconds, and they didn't cause any lag.
After a bunch of research I found out blizzard fux me over again... 1: they have all their angles in Degrees, not radians.. so this fuk'd my equation over... & 2: I had to set the absolute height of my units to match perfect with the set state ignore terrain trigger... The timer itself wasn't the problem
For anyone wishing to vary a unit's height whether they are in a hole or on flat land with time:
Unit - Turn (Triggering unit) Ignore Terrain Height state On
Unit - Change (Triggering unit) height to (A + (B * (Abs((Cos((90.0 * ((X) / C)))))))) over 0.0 seconds
A = Lowest height for unit to be pushed to
B = Max height above A for unit to be pushed to
X = Variable that you want unit height to vary with. For me it was time, so I set a Timer variable (One shot timer started at melee initialization)
C = Time it takes to reach highest height from lowest height.
Example:
Show a unit as it dies just above lava height. Lava height varies from 3 to 7 over 7 seconds. Base ground height is 8, but there are pits for lava of course.
Unit - Turn (Triggering unit) Ignore Terrain Height state On
Unit - Change (Triggering unit) height to (2.5 + (4.0 * (Abs((Cos((90.0 * ((Elapsed time of GameTime) / 7.0)))))))) over 0.0 seconds
This would place the dying unit just below the lava's surface so you could see part of their body stick above of the lava as they died and watch them burn.
Ty 2 every1 for helping.
edit: & I guess technically you could use this for a jetpack system also with a bit of tweaking.
None.

>be faceless void >mfw I have no face
This would place the dying unit just below the lava's surface so you could see part of their body stick above of the lava as they died and watch them burn.
Man that's clever, I'll probably use this sometime
Red classic.
"In short, their absurdities are so extreme that it is painful even to quote them."
Good you found the problem
I was going to use the incrementing method as a total last resort... that could cause laag on my map right? A trigger that triggers every second for the entire game?
Generally no, as long as it's a relatively small trigger. I've had one run roughly every 0.04 seconds that caused hardly any lag, and one that ran every 0.3 seconds that deleted particles which actually sped up the map (rather, the rendering of the map).
None.