The Daily Click ::. Forums ::. Klik Coding Help ::. Did you know?
 

Post Reply  Post Oekaki 
 

Posted By Message

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
11th March, 2012 at 11/03/2012 04:08:34 -


I posted this on the clickteam forums but nobody was interested.

Recently, I discovered that multiple instances of the same string object can be displayed at the same time showing different paragraphs?

http://www.whenthereisnoroominhellthedeadwalktheearth.com/MMF/strings.mfa

Did you know about this? You may wonder what the practical application of this, if any, could be.

Well, I am working on another array editor, similar to a spread sheet. Each X column needs a heading. Instead of having hundreds of different string objects displaying 1, 2, 3, 4, 5 etc, I can have 1 string object, with hundreds of paragraphs and display the appropriate paragraph with a loop.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
11th March, 2012 at 11/03/2012 10:49:27 -

Why's that surprising? You can have multiple instances of any object type - even things like arrays (although it's a little trickier with those because they don't have their own alterable values, and you can't directly compare their values - but it's still do-able). They're all handled in exactly the same way.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
11th March, 2012 at 11/03/2012 12:15:46 -

It is surprising because there are very few ways to achieve this. I would imagine it won't have occurred to most users before.

String objects don't have alterable values so you can not refer to through a unique ID. Although they do have a unique fixed value, but fixed values are much harder to utilise. The only way to set a string object to display different text to another instance of the same string object is by refereeing to only that one string object. There are very few ways to do this.

For example:

1. On a create string object event.
2. If string object overlaps whatever.
3. If string object x position = whatever

Also, I don't know why it didn't occur to me before, but this isn't just limited to paragraphs. You can also achieve this by change the alterable string directly.

http://www.whenthereisnoroominhellthedeadwalktheearth.com/MMF/strings2.mfa

Sketchy, you don't find this even remotely interesting?

 
n/a

nim



Registered
  17/05/2002
Points
  7234
11th March, 2012 at 11/03/2012 13:52:15 -

I guess it's a useful thing to discover. I used multiple "String 1" objects and set their Alterable Strings to the contents of an array via a fastloop for a flash card app I wrote for myself. It makes sense when you think about it, but with Clickteam products you never know what might happen!

 
//

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
11th March, 2012 at 11/03/2012 14:37:52 -


Originally Posted by Chris Burrows

Sketchy, you don't find this even remotely interesting?



I just assumed it was something people took for granted anyway - what would give you the idea that active objects were anything special?

You often see duplicate strings being used for things like health counters. They behave exactly the same as anything else.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
11th March, 2012 at 11/03/2012 19:09:07 -

I do this all the time.

I do this with almost every type of object like others have said.

It's very useful to be able to create multiple instances of the same object and have them all be in a different state.

Very useful for having usernames float above characters heads and such.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
12th March, 2012 at 12/03/2012 02:53:41 -


Originally Posted by Sketchy

I just assumed it was something people took for granted anyway



Hmmm maybe you're right. I'd never thought of it until a few days ago. Either way, it is definitely very useful.

I don't think that Active Objects are anything special, but I do think they are easier to handle multiple instances of than String Objects and that is what I find interesting. Even a List Object has alterable values, I wonder why Clickteam chose not to give them to string objects.

Sketchy, on a separate and mostly unrelated note, can you please explain to me how an objects fixed values are assigned?

 
n/a

nivram



Registered
  20/07/2006
Points
  171
12th March, 2012 at 12/03/2012 03:05:18 -

Chris. They are numbered by type and then by order created in the frame editor.

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
13th March, 2012 at 13/03/2012 00:02:25 -

Oh I see. Thanks Marv.

Does anybody know if a list or chart is available showing which fixed value will be assigned to which object type?



 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
14th March, 2012 at 14/03/2012 01:03:27 -

Nope. Fixed values are complicated and only partially understood:
http://www.create-games.com/article.asp?id=2139

Re: String objects not having alterable values - I believe many objects used not to have alterable values, but Clickteam gradually started adding them. They did post on the Clickteam forums that if you needed alterable values added to any object, you could contact them and they'd look at doing it for you.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click