The Daily Click ::. Forums ::. Klik Coding Help ::. Making every value unique per active object
 

Post Reply  Post Oekaki 
 

Posted By Message

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
7th February, 2005 at 21:28:07 -

This problem is a bit hard to explain, but I'm sure most of you have encountered it, and maybe someone's figured a solution for it...

Let's say I'm making this physics engine. I set Rock to fall an amount of pixels equal to Rock's Velocity (Alterable Value A = AV A).

Now this works perfectly fine if there's only one Rock. But if there's more than one Rock, they all follow the latest Rock's AV A.

The question is... how do I set it so that every Rock will follow their own AV A?

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
7th February, 2005 at 23:56:50 -

If you're code goes something like:
Set Y Pos to Y Pos + Value A("Rock")
you might want to replace it with something like:
Set Value B("Rock") --> Value B("Rock") + Value A("Rock")
Set Y Pos to Value B("Rock")

 
http://www.klik-me.com

Tiles

Possibly Insane

Registered
  06/12/2002
Points
  2339

GOTM 3TH PLACE WINNER - JANUARY 2010
8th February, 2005 at 05:09:29 -

You could also use a fastloop .

Start of frame ( or when number of rocks is changing ) Spread value X in Rock

Always start loop "falling" for NO Objects Rock .

On Loop "Falling" + Loopindex equal Alt Val X --- > set Rock to fall an amount of pixels equal to Rock's Velocity (Alterable Value A = AV A)

Still, i think that the way of Rapidflash is the easier way . Just wanted to provide an alternative

 
Free graphics,Free Games
http://www.reinerstilesets.de

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
8th February, 2005 at 06:28:19 -

I hope mmf2 adresses the abundance of object-specific bugs. I fin it very hard to specif specific objects correctly, which is really annoying.

 
n/a

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
8th February, 2005 at 10:18:39 -

*braces for tigerworks linking to his knowledge base article for the millionth time*

http://www.clickteam.info/kb/start/index.php?showtopic=43

 
www.thenatflap.co.uk

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
8th February, 2005 at 18:46:51 -

i used spread value in one of the other values to determine a difference.

but you need to a new line for every event for each new object
maybe yours would look like (if you did what i did)

(Alterable Value A = AV A b=1)
(Alterable Value A = AV A b=2)
(Alterable Value A = AV A b=3)
(Alterable Value A = AV A b=4)
(Alterable Value A = AV A b=5)

i think it would work in this case.

 
.

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
9th February, 2005 at 02:23:15 -

I don't really use fastloop anymore. I used to alot but then i realised that half the time i was using it for totally pointless things i could do anyway.

 
n/a

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
9th February, 2005 at 10:47:32 -

Objects will always follow their own alterable values, unless you break MMF's object selection process by using Compare Two General Values or something.

I.e. set X position to X + Value A will move each object independantly of its own alterable values.

 
- Tigerworks

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
10th February, 2005 at 10:03:12 -

i did have a problem with making an object a certain direction, each one was the same and it only worked when i spread value a. I probably used compare two values though now i think about it.

 
.

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
15th February, 2005 at 22:53:23 -

Hmm... maybe it's just a problem with the qualifiers then (again). Damn that idiot who said that qualifiers were bug-free.

Fast loop is even more event-specific, so it only makes the problem more complicated, even though it looks a bit nicer. Fast loop's getting over-rated. All these 'wannabe veterans' keep saying, "you can only solve problem X by using fast loop" even if it doesn't help things the least bit .

No offense, Tiles. I mean other people .

Image Edited by the Author.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
21st February, 2005 at 18:57:59 -

Are you using the qualifier for all the events and actions involved in this part? Because sometimes if you, say, used a qualifier for the event, but the actual active object for the action, it can go wrong. Also, when are you adding to the Rock's value A? And are you using "Add to Value" or "Set Value A to Value A + 1" because I'd reccomend the first option because it could end up setting it's value to one of the other rock's values instead especailly if using a qualifier.

 
http://www.fzgames.com

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
21st February, 2005 at 20:01:36 -

It's not a problem with the qualifiers. It rarely is.

 
n/a

RC



Registered
  17/02/2004
Points
  141
22nd February, 2005 at 02:55:10 -

I completely agree with what Muz said last .. however, the specific prob you mentioned at the beggining of your post should be able to be handled fine... UNLESS you want collision. I agree that the fastloops are overrated. This shouldnt NEED to be done like this. Every programming/scripting language known to man that can create games has a way around this kind of prob except Clickteam products. I've also told them time and time again. Meh, well I'm sure they'll do something about it in MMF2. Or.. if they don't, I am boycotting Click.. seriously .. I've told them to fix this specific prob forever. And, to think about how it doesnt handle comparisons between 2 object's alt values.. try one object colliding with another instance of itself? haha but anyway i am being over nitpicking. In general you can do the most things you want doing things the long way. Fastloops do create quite a bit of unnececary slowdown for something that should be built in, tho : /

 
http://www.sepwich.com/solemnity/projects/s4comingsoon.JPG
Sonic: Corrupted Chaos. Coming soon..

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
22nd February, 2005 at 10:38:17 -

Fastloops are not overrated, they are incredibly useful. Fantastically useful. Everything I make in MMF uses fastloops in one way or another. What ISN'T good is throwing fastloop at a problem and hoping it will solve it.

I know that alterable values and qualifiers work perfectly. I have used them on a titanic scale in Terminal Orbit and there have never been any problems related to them. I think you need to describe your problem in more detail or provide a sample app which doesn't work.

All references to "OMG WTF THE COMMUNITY IS DYING" have been removed from this post

 
- Tigerworks

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
22nd February, 2005 at 16:20:23 -

RC, I think you're just being awkward. Most of the things you are after can be done just aren't obvious how, with a little work you can usually do it.

And you say scripting languages have ways of doing it, yes. Using the exact same thing a fastloop. I think you're just afraid of using it. If the other game-making methods are so much better to you, then why don't you use them instead. clickteam products are amazing and if you were to boycott them, you'd be very alone.

I agree with you, Tigerworks. Fastloops are great but I don't get how suddenly people think they're the answer to every problem.

 
http://www.fzgames.com
   

Post Reply



 



Advertisement

Worth A Click