Jump to content


Photo
* * * * * 1 votes

String Distortion


  • Please log in to reply
47 replies to this topic

#1 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 02 February 2010 - 05:34 PM

  • Title: String distortion example
  • Description: Add great effects to strings, by moving the letters around at will
  • GM Version: GM8.1 - The code should work on GM7 and probably GM6, but it's saved in GM8.1 The separate versions (by themselves) are GM8 files
  • Registered: Version 2 and 3 are, but Version 1 is not
  • File Type: .gmk and .exe (for those without gm8)
  • File Size: 32KB
  • File Link: .gmk .exe
Additional Info

Please reply if you download this!

This example shows an interesting effect that I've named "string distortion". Basically, it splits up a string into separate characters, which are then able to be manipulated individually. This allows for some weird and wonderful effects. Try them out!

I've compiled the three versions into one file, so you can see all the different effects without having to download each version separately. It's very simple to use. Click on which version you'd like to see and press Escape to go back to the menu. Each example tells you what controls you can use.

Menu Screen

Posted Image

Posted Image

Posted Image


The posts related to each separate version are listed below:

String Distortion Version 3
String Distortion Version 2
String Distortion Version 1:
Spoiler

Edited by Dark Matter, 06 August 2011 - 11:42 AM.

  • 9

#2 mango ken

mango ken

    GMC Member

  • New Member
  • 15 posts

Posted 03 February 2010 - 05:24 PM

that is a VERY nice idea B-) however it is quite basic..... but well done making this in your spare time.

you said it could be used for credits, could u make a credit schrolling function on it???

thanks mango
  • 0

#3 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 03 February 2010 - 05:27 PM

To make the text scroll down, you can simply put in something like
y+=2
in the step event. This will move all the text down, and you can distort it while it's scrolling.
  • 0

#4 Kolink

Kolink

    Almighty Shinx

  • GMC Member
  • 2351 posts

Posted 03 February 2010 - 06:48 PM

I saw a similar feature on Pokémon Ranger B-)
It's very cool. It's pretty good if you've got long credits and want to give the user something to do :)
  • 0

#5 Newly Discovered

Newly Discovered

    Harmonious Genius

  • New Member
  • 2467 posts
  • Version:GM8

Posted 03 February 2010 - 06:51 PM

wow this is very cool!
I'm glad to see you did it using arrays, not entirely out of objects like a majority of gmc members would...

congrats on a great example.
  • 0

#6 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 03 February 2010 - 09:45 PM

@Kolink - actually, that's just the game I was thinking of when I created this example B-) Although credits is probably the most obvious thing this can be used for, it could just as easily be used to do things like make the letters fly from all directions, spelling out the title or options or something. I have tried to make it very versitile, so it can be used in a wide range of ways.

@Newly discovered - thanks! Using objects would be a very slow an in-efficient way of doing it. I've tried to make it as efficient as I can, so it can be used in games without reducing the fps too much.
  • 0

#7 mrsmes

mrsmes

    GMC Member

  • GMC Member
  • 972 posts
  • Version:Unknown

Posted 04 February 2010 - 05:17 AM

love the example it's brilliant.
  • 0

#8 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 04 February 2010 - 04:34 PM

Thanks! Feel free to say anything you think should be added or adjusted to the example. Also, try out the smilies ( :) ::lmao:: :P :) =) =( =P =D <3 o_O O_o o.O O.o >.< >_< ) Just type those into the string, and they'll appear as smilies, which can be pushed around just like the letters.
  • 0

#9 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16788 posts
  • Version:GM:Studio

Posted 04 February 2010 - 04:56 PM

Hehehe!! I like this a lot! Itīs fun and has some nice features (like being able to drag letters with the mouse!) although I do feel that half the scripts are unnecessary and could have been included in the object instead (like the "Find" scripts and the "Setting Data") as each script called has a small overhead (in GM8 it is VERY small, but none the less itīs there!) and for one line it seems pointless... It also may be more confusing to those that are new to scripts or GML...

Iīm reminded of the "Instance Based Text" example that is on these forums (and that I used extensively in my game Minimal) and the moment I can, I will find a use for this too!!!

Good job!!

PS: Would using data structures (ds_list, ds_grid) instead of arrays not add more functionality? Imagine the ds_list_shuffle command to scramble the letters, for example... Just a thought...
  • 0

#10 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 04 February 2010 - 05:16 PM

Thanks for the comment. The scripts were basically there because, in my opinion, they are easier to read in the code - I'm not sure if other people find this or not :) They can be deleted and as long as the code for the few times they are used is changed, it won't make any impact.

I hadn't seen the Instance Based Text before, but now having looked at it, yes - the idea is similar, but the way it's done it quite different.

I was thinking of using the ds functions, but I just like using the normal arrays more for some reason ::lmao:: It might add a bit more functionality, but nothing that can't be done with a little code. The main good reasons for using ds functions is they don't have a limit, or at least, more than 32000 - but then again, I doubt you're going to need a string that long - and even if you did, the fps would be so low it wouldn't be worth playing the game :)
  • 0

#11 js_123

js_123

    GMC Member

  • New Member
  • 41 posts

Posted 05 February 2010 - 12:44 PM

hey i liked it a lot...........
  • 0

#12 peter john

peter john

    GMC Member

  • New Member
  • 18 posts

Posted 05 February 2010 - 06:08 PM

Good idea and also nice implementation!!............

Liked it ...lol!
  • 0

#13 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 05 February 2010 - 06:20 PM

Great! I'm glad you enjoyed using it :D
I've tried to make it as easy as I can to understand. Feel free to ask me to explain anything though :GM074:
  • 0

#14 skulldragon

skulldragon

    GMC Member

  • New Member
  • 73 posts

Posted 05 February 2010 - 06:21 PM

This is very good. A means to blast the letters and send them bouncing around the screen would be great!
Should I give credit if I use this in one of my games?

Edited by skulldragon, 06 February 2010 - 02:27 PM.

  • 0

#15 skulldragon

skulldragon

    GMC Member

  • New Member
  • 73 posts

Posted 05 February 2010 - 06:35 PM

Oh, you said to. Sorry, missed it at first.
  • 0

#16 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 05 February 2010 - 06:37 PM

If you decide to use this in your own game, please credit Dark Matter.


Thank you! Creating your own effects shouldn't be too hard at all. Look in the step event of the test object and see how the explosion and implosion was done. You should pick it up very quickly :GM074:
  • 0

#17 ratchet22

ratchet22

    GMC Member

  • GMC Member
  • 67 posts

Posted 05 February 2010 - 09:08 PM

I like it very much Dark Matter especially the emotes :GM074:
  • 0

#18 supersniper

supersniper

    GMC Member

  • New Member
  • 38 posts

Posted 06 February 2010 - 12:29 AM

woah i had an account here???

but what's the point of all this dm?
  • 0

#19 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 06 February 2010 - 07:25 AM

Really, it's just a fancy effect. You could maybe use it so the credits aren't so boring, or you could make words be created letter by letter. It just gives a nice touch to a game.
  • 0

#20 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16788 posts
  • Version:GM:Studio

Posted 06 February 2010 - 07:58 AM

@Supersniper: Itīs in the details... a great game has little details that round out the product, and this could be just one of them!!!!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users