tulamide's Recent Forum Activity

  • howdy yall. I noticed I messed up on the pointer and loop based addressing system in 's'

    oops

    I guess no one was really using those features since no one complained.

    So now I wonder what exactly was wrong with pointers? I mean, I use them for about a year now and didn't have any problem whatsoever

  • As promised, here is another example using hash tables. This time I present one possible way of supporting multi-language-games. The languages are stored in hash tables sharing the same keys. Furthermore, the use of a hash table to randomly select items, while every item is only selected once, is shown here.

    Most of the time people will use a system similar to this:

    1) Generate a random number

    2) Compare it with the previously generated random number

    3) If they match, repeat from step 1

    4) Finally after millions of repetitions, the numbers don't match and stuff can be done

    The hash table approach doesn't need that, as every key that was used is deleted from the hash table, and the random number is always generated based on the number of keys left.

    The .rar file contains a cap and three language files (aka saved hash tables) and the events of the cap are extensively commented.

    Download:

    LanguageExample.rar

    I hope it is a useful example

  • On your "where's my IF at" question

    object.visible --> Do stuff
    |
    else (or you could use: object.invisible) --> Do other stuff[/code:1yzpzpjd]
    
    The IF's are hidden, everything is kind of an IF statement so to speak
    

    You are right with the 'if'-part. All events are structured this way, on the left side is either a condition or a trigger.

    But you are wrong with '(or you could use: object.invisible)' in this case. The reason, why this wouldn't work here, can be read in this thread

  • I'd always prefer maintenance over speed. You never know how much issues you will get with too much wasted RAM or illogical code.

    You shouldn't be too afraid of maintenance slowing your app down, though. I tested an array with 10000 cells, moving the contents of 9999 by one to the left. I could do this on every tick without touching the v-synced framerate of 60 fps. In your app you will never experience a situation, where you would constantly move 10000 cells per tick.

    If you are interested, how actual events would look like (and behave), have a look at Verve!

    The sorting algorithm featured there works simultaneously on 4 arrays, moving the contens of cells, deleting entries, inserting data, etc.

    If you can find a way of identifying your objects with keys, then you could use a hash table and place all data as a tokenized string for the values of the keys. It would cost you another routine to pack and extract the data from the strings, but you would never have gaps in your hash table, no matter how often you delete or add something.

    You could also setup your own array structures (like arrays storing other arrays or sub-arrays) by using the 's'-plugin.

    Python would also allow for custom classes. You could create something like:

    class Profile(object):
        def __init__(self):
            self.name = None
            self.age = None
            self.height = None
    
    class Group(object):
        def __init__(self):
            self.profiles = []
    
        def create(self):
            self.profiles.append(Profile())
    
        def delete(self, index=None):
            if index == None:
                del self.profiles[-1]
            else:
                del self.profiles[index]
    
        def set_age(self, index=None, age=0):
            if index == None:
                self.profiles[-1].age = age
            else:
                self.profiles[index].age = age
    
        def get_age(self, index=None):
            if index == None:
                return self.profiles[-1].age
            else:
                return self.profiles[index][/code:ep387qqo]
    
    You would then use it this way:
    [code:ep387qqo]#Your array
    ProfileArray = Group()
    
    #Create a new profile
    ProfileArray.Create()
    
    #Set the age in the newly created profile to 18
    ProfileArray.set_age(None, 18)[/code:ep387qqo]
    
    Saving the data is as simple as using file.write() after having prepared the values. (Won't go into details here, but it really isn't much effort.)
    
    You see, there are many ways, it is up to you to decide which way to go
  • When working object oriented, you will have an easier life using one of the two object oriented tools: 's'-plugin or python

    In the third post on this page, lucid gives a very fine example of how 's' could help you solve any of your issues.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Damn, I'm terribly sorry. I mixed it up, not with the list object, but with the edit box object.

  • Yes I know about that. Just wanted to bring in some humor with a wink... Didn't work, so I suck at humor, too

  • MS Paint is what comes with Windows, and yes, it sucks!

    I'm not so sure about that

    http://www.metacafe.com/watch/2066909/insane_ms_paint_drawing_audi_allroad_quattro/

    Maybe tools are just as good as the people using it (so yeah, for me MS Paint sucks )

  • It does work, but only if "Multiline" is also enabled.

  • You could post your cap (or send a link by pm), I will have a look then. Hopefully it's just something simple

  • I've used a special effect I created, called "blob_test.fx", which is more comfortable to use (you can select the alpha threshold and give your liquid an outline).

    From an older post:

    Just download "fluid.rar" from my third post in this thread. It contains the effect blob_test.fx

    Copy it to Construct's effect folder.

  • The edit box has two actions called "Focus on" and "Focus off", they set and clear the focus (set the text cursor to the specified edit box, or clear it)

    One tip: Often objects are not documented very well. A way to at least get a hint if some functionality exists, is to right-click the object in the object list (while the layout editor is active) and select "Object information". This lists all ACE of the object and helps sometimes.

tulamide's avatar

tulamide

Member since 11 Sep, 2009

Twitter
tulamide has 3 followers

Trophy Case

  • 15-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

17/44
How to earn trophies