The Daily Click ::. Forums ::. Klik Coding Help ::. A counter question...
 

Post Reply  Post Oekaki 
 

Posted By Message

DanielRehn



Registered
  18/09/2002
Points
  139
27th February, 2006 at 09:02:40 -

OMG.. How hard is this...

When you add something to the counter...

Set Counter = (Counter + x + 360) mod 360

x is the value you add...
IF yo plan to add values outside the range of -360 -> 360 then increment "+ 360" value!
eg. if you plan on using -1000 -> 1000, use 1440

another way to do this 100% accurate is using this formula

Set Counter = (Counter + x + (360 * ceil(ABS(x) / 360))) mod 360


 
n/a

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
27th February, 2006 at 09:04:14 -

Then keep using the mid$ function to get the digit that you want. It takes three values - the string that you want to get, then index to start from, and the number of characters to use (or is it the index to stop at? I can't remember.) Anyway, if it's the first, then use these:

1st: ...mid$(str$(value("counter"), 0, 1))
2nd: ...mid$(str$(value("counter"), 1, 1))
3rd: ...mid$(str$(value("counter"), 2, 1))

 
http://www.davidn.co.nr - Games, music, living in America

en kerro



Registered
  21/10/2004
Points
  578
27th February, 2006 at 15:37:28 -

...I'm confused. Can anyone explain it in one post? Too hard for me to understand...

 
Current Projects:
The Artillerys 10%
Forgotten Legends 8%
Earth Defender 20%

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
27th February, 2006 at 16:16:52 -

I think Daniel's post spilled over from the other counter thread somehow - he posted at the same time as I did, and coincidentally it looked as if I was trying to follow on from him.

 
http://www.davidn.co.nr - Games, music, living in America

DanielRehn



Registered
  18/09/2002
Points
  139
27th February, 2006 at 17:25:02 -

Hehe... kinda cool...

 
n/a

en kerro



Registered
  21/10/2004
Points
  578
27th February, 2006 at 19:25:23 -

Oh... Now I understand it

 
Current Projects:
The Artillerys 10%
Forgotten Legends 8%
Earth Defender 20%

en kerro



Registered
  21/10/2004
Points
  578
1st March, 2006 at 11:11:21 -

That Set active object direction to "val(mid$($str(counter_value), 0, 1))" didn't work. What's the problem?

 
Current Projects:
The Artillerys 10%
Forgotten Legends 8%
Earth Defender 20%

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
1st March, 2006 at 12:46:18 -

I think it should be "str$" instead of "$str".

 
http://www.davidn.co.nr - Games, music, living in America

en kerro



Registered
  21/10/2004
Points
  578
1st March, 2006 at 19:33:11 -

didn't help

 
Current Projects:
The Artillerys 10%
Forgotten Legends 8%
Earth Defender 20%

DanielRehn



Registered
  18/09/2002
Points
  139
1st March, 2006 at 19:36:47 -

You are aware that you cant use "counter_value" as well right?

 
n/a

en kerro



Registered
  21/10/2004
Points
  578
2nd March, 2006 at 09:19:45 -

I didn't use counter_value, I replaced it with value("counter1")

 
Current Projects:
The Artillerys 10%
Forgotten Legends 8%
Earth Defender 20%

DanielRehn



Registered
  18/09/2002
Points
  139
2nd March, 2006 at 17:02:15 -

MMF
val(mid$(str$(value("counter1")), 0, 1))

Wont work with tgf though!

 
n/a

en kerro



Registered
  21/10/2004
Points
  578
3rd March, 2006 at 13:18:02 -

So that's the problem. Because I have TGF!

Any other ideas for "counters in the front of everything", please...?

 
Current Projects:
The Artillerys 10%
Forgotten Legends 8%
Earth Defender 20%

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
3rd March, 2006 at 13:24:51 -

Don't know if this has been mentioned yet but the Layer Object can sort out the layering properties of text and counters in run time.. It's pretty snazzy. It works with most non-active objects (barring obvious background graphics).

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

DanielRehn



Registered
  18/09/2002
Points
  139
3rd March, 2006 at 13:47:48 -

You can use math to solve the problem

If you have a counter with the value 468, and want to transfer it to 3 active objects do like this

first digit ( 8 )
dir = value("counter1") mod 10

second digit ( 6 )
dir = (value("counter1") - (value("counter1") mod 10)) mod 100

third digit ( 4 )
dir = (value("counter1") - (value("counter1") mod 100))

and so on...

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click