User Tag List

Results 1 to 3 of 3

Thread: Loading Materials through a For Each Loop. Help!

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Question Loading Materials through a For Each Loop. Help!

    Hello brains.

    OK, so just starting out on Firefly. Done some tutorials. All seems fine and straightforward.
    Tried (Dispite a complete lack of comments in the code or naming of assets) to understand the race car example in the store, which is what I've been deconstructing and messing with to learn the system.

    Think I'm all on board with how it works, but I'm a little stuck on something rather simple.

    I want to draw my level in 2D (top view) in the MMF editor, then load in 3D assets via code at runtime.

    At the moment I have a ForEach loop that cycles through a bunch of PinkSquares (active objects) and uses their positioning to spawn/position a bunch of Firefly Primitive Cubes (that I'm using for walls).

    The problem I'm having is that if I set the 3D Primitive's position in the ForEach loop it works, but if I try and load a material into it, it doesn't.

    Effectively

    (the following only runs once):
    On Each one of WallPositioner, loop name "makeWalls"
    ->Create Object Primitive
    ->Set Object Primitive position (blah)
    ->Load Material 4 in to slot 0 of Object Primitive.

    Run the game, no materials on walls.

    If I brute force it (load material on walls when key pressed), it works. So it's not the primitive, I think it's some issue with the forloop.

    I've hacked the small bit of my code where I'm having the problem out, and attached below with comments. Look at the event editor and it should explain what I'm trying to do.
    Any help appreciated!

    I should stress that while I realise there are other ways to do this, I will eventually want to load a large number of assets At the start of the level and using a foreach will be essential to that.

    Example.mfa

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    To follow this up, it seems that you also can't change the animation frames of a Dynamic Mesh within a ForEach loop either.

    Seriously, anyone any idea? I can't see anything in (scarce) documentation or tutorials about this.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2016
    Posts
    366
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    a lot of this kind of thing was done as part of squatters wolfenstien clone example - have you looked into that ? or the dungeon crawler example.

Similar Threads

  1. Create new mesh & adding materials
    By danjo in forum Firefly
    Replies: 4
    Last Post: 28th December 2016, 11:19 PM
  2. Properties of reals materials
    By Xenon3000 in forum Fusion 2.5
    Replies: 1
    Last Post: 29th November 2013, 06:42 PM
  3. External materials hidden against other users
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 12th August 2011, 04:35 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
  •