Results 1 to 1 of 1
  1. #1
    Member Cotaks's Avatar
    Join Date
    May 2012
    The Netherlands

    Cotaks resources

    This page shows the resources that i share.

    They all are free to use but you may not sell it to others(of course you may sell it as/in a game). It are free resources and it should stay that way! Most of these blends/script are python based.

    If you can use it, use it.
    One of the blends not working in Bge? feel free to send me a pm.

    All things below should work in Bge from version 2.6+ until latest release (2.78a)
    i dont give suport to UPbge but they should all work up to 0.1.4 (some things have changed compared to bge use the console output to see what you need to change).

    .txt dialog/quest/book system

    Random front and last name generator

    RTS building placement with pre requirements

    Double tap or more to run (w = walk, w again is running)
    double w is running.blend (pure bricks, no python)

    FPS engine bundle: (merged some scripts into 1)

    Random assets placer:

    Game settings / Launcher:

    Save and load:


    Loading screen with Async, progress bar and text:

    First person movement script with keybindings

    Third person Tera/Eso style movement system with key and mouse bindings (8 directional):

    Endless runner:

    Mini and world map with the option to rotate and zoom:

    Key and mouse bindings:

    Light manager:

    Click to move:

    Low poly human model:

    Teleport script:

    Track to nearest property (single and all axis):

    - Level of detail:
    # LoD by cotax
    # Place a property on the object that needs LoD, call it lod_mesh and put the origional mesh name in it.
    # Now duplicate it as much as you like. 
    # Make a low poly mesh, call that mesh: origionalname_far (so put _far behind the origional mesh name).
    # You can use the property on the low poly instead of the high one, easier to work with ;).
    # (only 1 mesh type needs a property, either the high one or low one depending on what you place in the main scene)
    # Use the update_lod_list(cont) to update the list when needed
    def lod(cont):
        own = cont.owner
        if not 'lod_list' in own:
        player = own.scene.objects['player']
        for obj in own['lod_list']:
            distance    = player.getDistanceTo(obj)
            mesh_name   = obj['lod_mesh']
            # get LOD distances
            min, max  = own['lod_distances'][mesh_name][0], own['lod_distances'][mesh_name][1]
            if distance <= min:
                visible(obj, True)           
                change_mesh(obj, mesh_name)
            elif distance > min and distance <= max:
                visible(obj, True)
                change_mesh(obj, mesh_name + '_far')
                visible(obj, False)  
    def update_lod_list(cont):
        own = cont.owner   
        own['lod_list'] = [obj for obj in own.scene.objects if 'lod_mesh' in obj]
    def get_distances(cont):
        own = cont.owner
        own['lod_distances'] = { # mesh name - min - max
                        'tree_green_leaves':    [30,60], 
                        'flower_red':           [20,50],
                        'flower_blue':          [20,40],
                        'platform_stone':       [40,75],
                        'platform_grass':       [40,75],
                        'platform_sand':        [40,75],
                        'platform_tree':        [40,75]
    def visible(obj, state):
        if state:
            if not obj.visible:
                obj.visible = True
        elif not state:
            if obj.visible:
                obj.visible = False
    def change_mesh(obj, mesh_name):
        mesh = obj.meshes[0].name
        if mesh != mesh_name:

    - Key event strings to readable/show able text. (from ZEROKEY to 0, ONEKEY to 1, etc)
    def key_event_readable(key_event_name):
        text_to_number = {  
                            'ZEROKEY'           :"0",
                            'ONEKEY'            :"1",
                            'TWOKEY'            :"2",
                            'THREEKEY'          :"3",
                            'FOURKEY'           :"4",
                            'FIVEKEY'           :"5",
                            'SIXKEY'            :"6",
                            'SEVENKEY'          :"7",
                            'EIGHTKEY'          :"8",
                            'NINEKEY'           :"9",
                            'ACCENTGRAVEKEY'    :"`",
                            'BACKSPACEKEY'      :"<-",
                            'COMMAKEY'          :",",
                            'EQUALKEY'          :"=",
                            'LEFTBRACKETKEY'    :"[",
                            'RIGHTBRACKETKEY'   :"]",
                            'MINUSKEY'          :"-",
                            'PERIODKEY'         :".",
                            'SEMICOLONKEY'      :";",
                            'SLASHKEY'          :"/",
                            'BACKSLASHKEY'      :"\\",
                            'QUOTEKEY'          :"'",
                            'RETKEY'            :"Return",
                            'PADPLUSKEY'        :"Pad +",
                            'PADSLASHKEY'       :"Pad /",
                            'PADASTERKEY'       :"Pad *",
                            'PADPERIOD'         :"Pad .",
                            'PADMINUS'          :"Pad -",
                            'WHEELUPMOUSE'      :"Scroll up",
                            'WHEELDOWNMOUSE'    :"Scroll down",
                            'LEFTMOUSE'         :"LB",
                            'RIGHTMOUSE'        :"RB",
                            'MIDDLEMOUSE'       :"MMB"
        if key_event_name in text_to_number:
            return text_to_number[key_event_name]
        elif key_event_name.endswith('KEY'):
            return key_event_name[:-3]
        elif key_event_name.endswith('MOUSE'):
            return key_event_name[:-5]
            return key_event_name

    If you readed it all and still have nothing to do try my Crazy flipper(pinball) game:
    Last edited by Cotaks; 31-Dec-17 at 14:51.
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?

Posting Permissions

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