• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Im looking for some basic informations

Status
Not open for further replies.
Level 19
Joined
Aug 24, 2007
Messages
2,888
Note: Please dont tell me to look at tutorials

1- I want to know what Game Cache can provide us in jass
2- I want to know a way to move unit to another position in time
(I tried set a = 0 set b = 30 loop exitwhen a==b setunitloc(xofunit+1,yofunit+1 triggsleepactions(0.1) set a = a +1 endloop it moves unit to correct position but it moves unit 10 pixels per 1 second other frames get skipped :/ )


Anyway both questions are important for me
 
Last edited:
Level 7
Joined
Nov 12, 2005
Messages
299
1. Could you rephrase that please?
2. Use a timer. TriggerSleepAction is rather imprecise and 0.1 is too high for a smooth movement (but it's also the minimum for a triggersleep). Set the timeout to something between 0.025 and 0.04, the higher it is less chances you'll experience lag, but might not look as smooth.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
but I dont think I can use a timer for that kind of action
Thing it is a spell and it spins an unit around caster for x seconds
so it moves the unit to x of caster + cos(dir)*150 and yo of caster + sin(dir)*150 and increases direction by 1 in every 0.1 seconds after cast
and its game cache isnt game chance :D sorry my bad
 
Level 7
Joined
Nov 12, 2005
Messages
299
Ah, game cache...
Well the best way to explain the use would be in this very thing you're trying to make. What you need to is to increase the angle every time the timer expires (and move the unit at that point of course). Now if you store this angle in a global variable you'll end up with problems if two of these timers are running at the same time. This is why you can use the game cache along with a H2I function (see kattana's system) to attach the angle to the timer (well attaching might not be the right word, but that's irrelevant as it gets the job done). This way you can have more than one timer active without them interfering with each other.
Note though that game cache is very slow and you should use it as little as possible. There are alternative systems around that have similar functionality but greater speed, however it might be a good idea to understand this one before trying to go for anything else.
Also never attach anything other than integer, string, real and boolean using kattana's system as that is known to cause issues.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
sorry I forgot to add something I said models spins around unit but the unit here is able to move actually anyway I can store caster in a global too with player array but I dont want globals
its possible to make everything easier with globals but I want make 2 units in sameplayer able to cast this ability at same time anyway I wont use that function in my game just asked
 
Status
Not open for further replies.
Top