HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Scale and Fade snippet...

09-27-2009, 02:09 PM#1
Komaqtion
Hi!

I'm currently working on a small scale and fade snippet, and I've gotten the "scale" part done, bsaically...

Now, it's just the "fade" part left, and I thought it would be basically the same, but no no, it's giving me quite a hard time XD

So, atm it's using a constant timer of 0.03125 interval, using Timer32 by Jesus4Lyf from TheHelper.net (Please don't mind this, I could've used a local timer aswell).

Oh, well here's my code atm:
Expand JASS:

And my ongoing problem with this is that it keeps "breaking my thread", meaning that it just stops, and won't keep going.

And right now, only the ".create" method is executed, as seen by the debug msg'es...
Any ideas to why the ".periodic" method won't run ? :S

(If you wanna see T32, here it is:)
Expand JASS:
09-27-2009, 02:44 PM#2
Viikuna-
You should have some struct for storing units current numbers, so you can have multiple fades going on, without fucking things up.

Using some unit indexing system for getting indexes for your struct array is probably a good idea.
09-27-2009, 02:54 PM#3
Komaqtion
Quote:
Using some unit indexing system for getting indexes for your struct array is probably a good idea.

Ok... Which one would you suggest I use ? :o

(And, I'm a "Not-Noob-but-definately-not-Pro" in using vJASS, so if you could maybe at least guide me to the right path of implementing it, that'd be nice !!! ;))

But anyways, atm it's the "not-working" part I'm trying to fix :P

And, I just discovered another thing... My "scale" struct doesn't work with negative values, like this works:
Trigger:
Test Scale
Collapse Events
Player - Player 1 (Red) types a chat message containing scale as An exact match
Conditions
Collapse Actions
Set TempGroup = (Units owned by (Triggering player))
Custom script: call SmoothScale.create(FirstOfGroup(udg_TempGroup), 1., 1.5, 2.5)
Custom script: call DestroyGroup(udg_TempGroup)

But this doesn't:
Trigger:
Test Scale
Collapse Events
Player - Player 1 (Red) types a chat message containing scale as An exact match
Conditions
Collapse Actions
Set TempGroup = (Units owned by (Triggering player))
Custom script: call SmoothScale.create(FirstOfGroup(udg_TempGroup), 1., .5, 2.5)
Custom script: call DestroyGroup(udg_TempGroup)

And, if you want to know... This is the trigger I'm using for testing the "fade" struct:
Trigger:
Test Fade
Collapse Events
Player - Player 1 (Red) types a chat message containing fade as An exact match
Conditions
Collapse Actions
Set TempGroup = (Units owned by (Triggering player))
Custom script: call SmoothFade.create(FirstOfGroup(udg_TempGroup), 100. , 50., 2.5)
Custom script: call DestroyGroup(udg_TempGroup)
09-28-2009, 07:32 PM#4
Komaqtion
Ok... I've extended this snippet/system quite a bit now, though I might remove some stuff XD

Well, anyways there are some "Why"s I want to get answers to:
  • And how do I make a "callback feature" for my methods ? Like you type (As a "take") either a string, or code, and when the fade/scale is over that function runs ?

Ok, I've now fixed all "problems" with it, and it's only that one question left now ! :D
(It was a few maths issues XD)

But, I really want the user to be able to have callback on it, and also a boolean so the user can specify if he wants te callback on each interval, or only on the last one :D

Well, here's the updated code :
Expand JASS:

Sorry for all the code, but I want you to have all the information you'll need ;)