User Tag List

Results 1 to 7 of 7

Thread: Mid string from an alterable string?

  1. #1
    Clicker 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
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mid string from an alterable string?

    Sorry, since I likely ask something, that has already been answered elsewhere, but I did not find such an answer yet.

    In short, I have active objects. I have made them hostile by setting alterable string A as "hostile_(x)" to do this. I have changed the string to "hostile_devour", "hostile_leech" and so on in order to create objects with more specialized attacks.

    However, since there are situations where I'd like to address all hostiles at once, is Left$ a way to get all object with "hostile"- status to do something, like choosing a direction or dying all at once?

    (And since I'm still learning to be better with Fusion 2.5, be gentle with better ideas of how to make the hostile thing happen altogether. )

    EDIT: I think I might have some other uses for mid alterable string in the future, so I'm asking this not just to get the current project finished but to possibly use the same method again later on...

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to single out objects, or address them rather, you have to compare their alterable values/strings directly, and not using Compare two general values... So Mid & Left won't work in this case unfortunately. You could use two alterable strings to specify the type. Like:

    alterable String A = "hostile"
    alterable String B = "devour"

    etc.

  3. #3
    Clicker 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
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for letting me know. Damn... This means I have some editing to do. It will be a task to do but still easier than to add all hostile types to any event involving hostiles. I hope I will not run out of alterable strings, if I end up needing more of them...

    Are there a list or some tutorial as to how many things you can not do with alterable strings of objects? I presume that they have more limitations in comparison to string objects than only the situation I asked about? Or are there so many limitations that it's easier to tell what CAN they do in stead of what they CAN'T do?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    If this is a "binary" kind of job (you need to tell object which are hostile and which are not)
    you could think of using a flag for that:

    flag 0 ON >>> hostile, all will do stuff
    flag 0 OFF >>> not hostile, all don't do stuff

    then you can use your string to detail your hostile-types if those are more than two
    (since you want to save them for other uses, being limited in number)


    additional note:
    you could use left$(string) in a foreach loop
    but it would be worse performing..

  5. #5
    Clicker 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
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the answer. I will likely do that to save me some trouble. I could also try left$ if I really need it and make sure the loop is not constantly running.

    It was somewhat silly to first use alterable string to set different hostile-states and THEN realize that I have a reason to address all hostiles at the same time. I had seen some bits and pieces of tutorials with strings and didn't realize to think that alterable strings of objects would run into such obstacles. Well, learning the hard way helps to remember.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,299
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Your best bet by far, is to use two alterable values.

    hostile - 0:false, 1:true
    attackType - 0:none, 1:leech, 2:devour...
    (make sure you include a comment listing what each value corresponds to)

    Alterable strings are best saved for when you actually need them, since you don't get many.
    Flags are usually best avoided (unless you're running out of alterable values), since they are numbered rather than named, which makes code harder to read. Again, if you do use a flag, make sure you include a comment in situ describing what it does, as well as a comment listing all the flags used in the frame, so you don't lose track.

    And yes, it is worth going back and re-writing your code, rather than trying to bodge it using loops or anything like that.

  7. #7
    Clicker 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
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the latest answer. Those tips seem really useful.

Similar Threads

  1. Put an alterable string in a string problem
    By arthurh in forum Fusion 2.5
    Replies: 7
    Last Post: 6th December 2014, 02:00 PM
  2. Alterable String Example
    By Popcorn in forum File Archive
    Replies: 1
    Last Post: 23rd June 2012, 12:49 PM
  3. Alterable String
    By Guitaristinmakin in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th June 2007, 12:14 AM
  4. Alterable Value and Alterable String conflict
    By Patrick in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 28th September 2006, 02:51 PM
  5. Alterable String problems
    By Strider in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th August 2006, 03:10 AM

Posting Permissions

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