User Tag List

Results 1 to 3 of 3

Thread: Counting different types of objects

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Oct 2016
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Counting different types of objects

    I have various active objects named with a running index (i.e., 'item1', item2', ...) and create them randomly using 'create object by name'. Each has a alterable value with the same name (say, 'price')
    If possible, I want to add the values of existing objects together in one expression.

    What works is: NCount("item1")*price("item1")+NCount("item2")*pri ce("item2")+...
    However, this requires me to maintain a long expression for each addition item type. Alternatively, I can create an event fore each type and add it to a global counter - but this also requires maintaining one event per new object type.

    I was wondering whether there is a simpler way to do it.
    I was hoping to do it using a fast loop, each iteration adding the following to a global counter: NCount("item"+Str$(LoopIndex("counter")))*price(it em"+Str$(LoopIndex("counter")))
    However, this doesn't validate in the expression editor (it expects only actual strings pointing to actual objects).

    Is it possible to do something like this?
    Is there a better way to create 'similar but different' objects and do identical operations on them?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can't you use a qualifier for these objects?

    Then you only need to run a for each object on the qualifier at the NCount of the qualifier and then you can easily get the total price value of all objects.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Oct 2016
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes! this is exactly what I was looking for. I'm new to this environment, and didn't think to look for that feature under 'events'.

    Thanks

Similar Threads

  1. counting objects overlapping an object
    By dascribe in forum Fusion 2.5
    Replies: 3
    Last Post: 22nd March 2016, 07:28 PM
  2. Counting number of objects and FPS
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th October 2012, 07:13 AM
  3. counting objects of a certain value?
    By Bigfoot in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 1st February 2012, 07:32 PM
  4. Counting objects over another object
    By EdibleWare in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th January 2011, 05:22 PM
  5. Counting the number of invisible objects?
    By BrandonC in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 14th January 2007, 09:34 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
  •