User Tag List

Results 1 to 9 of 9

Thread: Append string

  1. #1
    No Products Registered

    Join Date
    Jan 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Append string

    hi I'm new in this forum and I began using this fantastic software (MMF) a few years ago.
    I just need somebody's help...
    I'd like to create a game Monkey-Island like... so...
    when I click on a button I managed to modify the content of a static text object into " Pick up ". Now I want to APPEND (for example)the word "SWORD" after "pick up" when the mouse pointer is over the sword active object... how do I do ??? is there any operator that I can use for appending text to an existing string inside a static text object?

    Thank you and sorry for my bad english... : )

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Append string

    Put all your items in the same qualifer.

    Mouse is over qualifer (negate this)
    Set alterable text to""

    Mouse is over sword
    Set alterable text to "sword"
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    No Products Registered

    Join Date
    Jan 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Append string

    thank you for the quick answer... i had already managed to do what you said but maybe i didn't explain myself... all i need to do is to append the string "x" to the string "Pick up".
    If i do "set text" to "sword" the string "Pick up" goes away...

  4. #4
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Append string

    You can set the string to anything really.

    How about setting a value to 1 after picking up the sword.
    If the value is <1 and mouse is over sword
    Set alterable string "pick up sword"

    Value is >1 set alteable string to "you have the sword"

    or something simular.
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Append string

    You need to set the string to the existing contents of the string + "Sword"

    You can do that under the
    Change alterable string

    Then click the retrieve data from an object and get alterable string

    Then your expression editor will say (something like) string$( "String" )

    Then add on
    string$( "String" )+" Sword"


  6. #6
    No Products Registered

    Join Date
    Jan 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Append string

    ok i made it. my problem was the i tried to write just + "sword" instead of writing

    Text$( "previous content of the static text box" )+"sword"

    Thank you!

  7. #7
    No Products Registered

    Join Date
    Jan 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Append string

    one last question (for now) : )

    is there any operator that makes the opposite operation of + (which appends strings).

    when I select pick up and i move the cursor over the sword I obtain "Pick up sword" which is what i wanted.
    now, when i move the cursor away from the sword i want to obtain pick up...

  8. #8
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Append string

    You can't subtract from a string (I think some of the more flowery scripting languages give it a go, though) - you can just set it directly to "Pick up: " again.

  9. #9
    No Products Registered

    Join Date
    Jul 2006
    Posts
    2,289
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: Append string

    You can use MID$ to choose a set of characters anywhere in a string and remove/change them. So that would be a "subtract" thought it is a little more involved.

    There is also Left$ and Right$ which work with either side of a string.

    There should be some documentation on those string functions in the manual and probably some examples here somewhere if you need more info.

    Also, those are string functions used in BASIC, so there are plenty of references online on how they are used.

    Otherwise, you can rely on us for more on that subject.

Similar Threads

  1. Append a string in a text file
    By Ls2 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th October 2013, 08:53 PM
  2. Append Ini Data To String?
    By stevenart1988 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th June 2013, 10:03 AM
  3. append text to file
    By obiwan in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th June 2007, 12:57 PM
  4. Binary Object - Append strings and get them
    By Looki in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 23rd March 2007, 07:00 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
  •