Need help to create 3D Isometric Game

it was about the code i posted in that topic, the tutorial site was free but does not exist anymore.

    render.getWindowWidth()
    #Gets the width of the window (in pixels)
    #Return type:    integer
    
    render.getWindowHeight()
    #Gets the height of the window (in pixels)
    #Return type:    integer

for visibility:

  • check if you have the engine running on glsl
  • set the render option on bottom from material to texture
  • check if the face direction is correct (flip normals if needed (or rotate the plane 180 degree and see if it then stays visible))

it can be anything and we can’t see that with a screenshot

Ok, thanks for this.
I’ve changed different parameters :

Is this a good configuration ?
After a few tests, the bug has not re-emerged for now.

I just need how to get an object situated in another scene if you know.

seems good.

just google it xD

anyway:

def get_scene(scene_name):
    
    scenes = logic.getSceneList()      
    scene = None
         
    for sce in scenes:
        if sce.name == scene_name:
            scene = sce
    
    return scene

to use this just write a line like:

scene = get_scene('scene_name')
object = scene.objects['object_name']

or use:

def get_scene(scene_name):
    
    scenes = logic.getSceneList()      
    scene = None
         
    for sce in scenes:
        if sce.name == scene_name:
            scene = sce
    
    return scene    

def get_object(scene_name, object_name):
      
    scene   = get_scene(scene_name)
    object  = scene.objects[object_name]
    
    return object

and simply make a line:

obj = get_object('scene_name', 'object_name')

Thanks, now i’m working on collisions:
I’m planning in my game that the character can take diffrenets effects from several zones:

After a few tests, i realized that every collision sensor can detect only one object…

Is there a way to detect the two zones with the same property at the same time ?

  1. learn python (if you did not already)
  2. use python
def detection(cont): 
    
    own = cont.owner
    
    collision = cont.sensors['Collision']
    
    if collision.positive:
        hit_obj  = collision.hitObject
        
        if 'some_property' in hit_obj:
            #do something
        elif 'some other property' in hit_obj:
            #do something else
            
        #repeat as many times you want 
  1. leave the collision brick property field empty
  2. no true pulse needed

I already have this in my code except the line “if ‘some_property’ in hit_obj” , which can be useful to add. But I found this that it missing in my code:
(if it can help)

sol

The for loop runs trough all things hit/touched by the collision sensor.
if you are sure to have multiple collisions at the same time then use the for loop else use mine.

Yes it can happen in my game.
The characters must be able to react to the water and a poison gas
in the same time, for example.

Do you know how to change the material in-game ?
I just found this :

image
ttv
tbv

In standard BGE, you’ll have to replace the mesh itself; own.replaceMesh(meshName) – this means you need to have an alternate version of the mesh using a separate material ready in your scene somewhere.

In UPBGE, you can copy the mesh at runtime, replace it, then replace the material on that copied mesh.

Great, it works thanks!

So it can also change the form, may be used otherwise than a simple graphic effect :slight_smile:

With this method, i tried to reduce the hitbox in order to create a ‘sneak movement’ and to pass through narrow passages like Under these yellow-orange blocks.
av2

av4

despite the visual change, the entity cannot still pass below these blocks…
(the red line doesn’t have collisions)

av3

Do you have a solution ? here’s his physic configuration:

back in the day that only would work with triangle bounds. but this in time will have issues itself, so you need to see if you have some issues with it.

so object and the new mesh needs to be set as triangle collision

-Back from store, here an example:
crouch below something.blend (508.3 KB)
(w and s to move, Q to crouch)

Thank you! it seems the 2 “true” added are indispensables for it, i just don’t know their signification

1 copy the material
2 copy the physics

Ah ok. Today i tried to add textures in materials.

bjd3

This is the result in-game (with 2 kind of texture in the same block),
some textures are not visible:

bjd1

Here’s the video that served me as a tutorial : https://www.youtube.com/watch?v=6gRUUeFteQg

It’s a part of my code for generate the land:

Do you know how to avoid this missing textures ?

well you need to APPLY the textures in the game engine, not in render or cycles.
why the faces disappear is not clear but you can simply select the cube got into edit mode and recalculate the normals.

in edit mode, hit T to open side menu hit the shading/uv tab, under normals you can then hit recalculate or flip direction.

1 Like

So what your Issue is is not that textures are missing but that your material has backface culling enabled. You can disable it in the materials tab and it should work fine.

I hope I was able to help you :slight_smile:

1 Like