User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Create Object Expression

  1. #1
    No Products Registered

    Join Date
    Oct 2007
    Location
    MA
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Object Expression

    Hi,

    Is there a way to create an object with an expression based on a value pulled from a SQL database

    ie..

    If I pull the string: "testObject_a"
    is there a way to have MMF create "testObject_a" in the frame?

    The only way I can think to do it is have 1000s of events one for each object that creates the intended object at the set location.

    Any Ideas?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    OK.

    +Live Receiver On Data Received.
    +Data Received = "testObject_a"
    -Create object "testObject_a"

    I have a feeling that didn't help you at all....

  3. #3
    No Products Registered

    Join Date
    Jun 2006
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    I dont think so, but I know of someone that got around this (somewhat) for the 20 event compo.

    Basically when you create your object, you create every possible object. Then you only keep the one that you want (I think they all need to share a common qualifier for this to work). So if you wanted to create object B, out of Object A, Object B, and Object C based on some value, you could create A, B, and C, and then destroy the objects that do not have the value equal to the desired object's value, and you would test that through the qualifier.

    Maybe its easier this way to understand what I mean:
    Counter = 1
    Alt Value A of object A = 0
    Alt Value A of object B = 1
    Alt Value A of object C = 2
    Object A, Object B, and Object C are in Group.0

    User clicks
    > Create Object A
    > Create Object B
    > Create Object C
    > Set flag 0 of Object A on
    > Set flag 0 of Object B on
    > Set flag 0 of Object C on

    Flag 0 of Group.0 is on
    + Alt Value A of Group.0 is different than Counter
    > Destroy Group.0

    Flag 0 of Group.0 is on
    > Set Flag 0 off

    That should end up leaving you with Object B, since its value A is equal to the counter.

  4. #4
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    HAHA very inivative.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Jun 2006
    Location
    UK
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    I like that, it's clever .

  6. #6
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    Using object picking combined with qualifiers and shooting objects you can do this with 1 event. But it is very complicated and I'm using it for my entry to the 20 event compo, so I don't want to reveal any details yet.

  7. #7
    No Products Registered

    Join Date
    Oct 2007
    Location
    MA
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    Thanks for the feedback

    xerus I don't want to create every object as they are load on call and would eat up unnecessary memory.

    pinacoladaxb I'm not following. The problem I'm havening is that the create object does not except expressions.

    I know I could for example create a dummy object and set it's alterable string to the SQL value and then have a behavior on it that had one event for each object that checked for the value of the alterable string, and created the appropriate object before deleting it's self but thats so messy and requires a ton of script overhead.

    I'm wondering how hard it would be to make an extension that would make the create object except script.

  8. #8
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Feb 2007
    Location
    Queensland, Australia
    Posts
    317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    I think this would just be something Clickteam will have to add; and we all know they're very busy.

    I've often wanted this though, level editors would have FAR less code involved in the loading system - maybe we could get a comment from Yves or Francois on it?

  9. #9
    No Products Registered

    Join Date
    Apr 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    Hey Kalnar. This was a bitch for the level editor that i'm making and there's no way around it as far as I know. I believe every unique object needs it's own event.
    What I did to reduce the amount of coding was use fast loops, qualifiers, and alterable value a.
    Whenever my level editor needs to create an object it runs the "create object" fast loop.
    in the loop is the list of 50 or so events that create the objects. (It was a bit of a pain making these events but it didn't take that long. It depends on how many unique objects you have). First I put a unique value into the alterable value a of all my objects. Then I added qualifier 99 to all of them. (the qualifier number obviously doesn't matter).

    on loop "create objects"
    global value a=1
    >create object 1 (object with 1 as alterable value a)


    on loop "create objects"
    global value a=2
    >create object 2...

    etc.

    on loop "create objects"
    >set x pos group.99 (value from array or database)
    > set y pos...
    > etc.

    Only the "create object" actions you need unique events for. Everything else can be done with groups using expressions. Also if the objects you're creating don't have animations (My level edior creates several "backdrops" from active objects) then you can use different animations on a single active object. Just correspond the object "type" with an alterable value and link that to the animation value.
    Cheers

  10. #10
    Clicker Multimedia Fusion 2 Developer
    Jax's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    702
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Create Object Expression

    I don't know of a way of creating objects in the SDK, but you can definitely destory them. So I suppose you could probably have an extension that destories objects with a specific name. Which doesn't really help.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. [Request] MMF2 Create Object From Expression
    By Bipolar_Games in forum Extension Development
    Replies: 95
    Last Post: 16th October 2011, 04:45 AM
  2. Expression Evaluator object?
    By ChrisBurrows in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 7th October 2011, 12:42 AM
  3. The Expression Evaluator Object 1.07
    By Jeff in forum Released Extensions
    Replies: 0
    Last Post: 22nd September 2006, 12:11 AM
  4. DataGrid object expression error
    By waffles in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 2nd September 2006, 11:02 AM
  5. shoot an object using the 'Expression Editor'
    By the_raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 21st July 2006, 08:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •