Solved Changelevelproperty (wall) question. Which one? I have 7

Question that is answered or resolved.

PS_VITA

Active member
I'm interested in spawning two walls outside of the playing area and changing their position later during game play. When using "changelevelproperty" for walls, how do I tell openbor to know which wall I'm wanting to change if I have 7 walls in the stage and the bottom two walls I created/listed are the ones I'm trying to manipulate.

Edit: If possible, could someone list the values changelevelproperty("wall" has?

changelevelproperty("wall",???,???,???,???,???);



Thanks
 
Last edited:
Solution
Hi @PS_VITA,

how do I tell openbor to know which wall I'm wanting to change if I have 7 walls in the stage and the bottom two walls I created/listed are the ones I'm trying to manipulate.
The walls and holes IDs are defined according to the order you add them in the level file.

Code:
wall        699 403 0 570 3000 3000 285 1000 //WALL ID 0
wall        2853 457 0 128 1000 1000 65 1000 //WALL ID 1
hole        1623 477 0 0 50 50 19 10 //HOLE ID 0
hole        1879 477 0 0 50 50 19 10 //HOLE ID 1


If possible, could someone list the values changelevelproperty("wall" has?
Here's all the wall properties directly from the source code:

C:
static const char *terrainlist[] =
{
    /*
        Walls and holes.
        */...
Hi @PS_VITA,

how do I tell openbor to know which wall I'm wanting to change if I have 7 walls in the stage and the bottom two walls I created/listed are the ones I'm trying to manipulate.
The walls and holes IDs are defined according to the order you add them in the level file.

Code:
wall        699 403 0 570 3000 3000 285 1000 //WALL ID 0
wall        2853 457 0 128 1000 1000 65 1000 //WALL ID 1
hole        1623 477 0 0 50 50 19 10 //HOLE ID 0
hole        1879 477 0 0 50 50 19 10 //HOLE ID 1


If possible, could someone list the values changelevelproperty("wall" has?
Here's all the wall properties directly from the source code:

C:
static const char *terrainlist[] =
{
    /*
        Walls and holes.
        */

    "depth",
    "height",
    "lowerleft",
    "lowerright",
    "type",
    "upperleft",
    "upperright",
    "x",
    "z",
};


Here's how you can code a function in order to change any wall property:

C:
changelevelproperty("wall", id_number, "property", value);

Example:
C:
void removeWall(int id)
{//Remove defined wall by ID

    changelevelproperty("wall", id, "x", 9999);
    changelevelproperty("wall", id, "z", 9999);
    changelevelproperty("wall", id, "depth", 0);
    changelevelproperty("wall", id, "height", 0);
}
 
Solution
Hi @PS_VITA,


The walls and holes IDs are defined according to the order you add them in the level file.

Code:
wall        699 403 0 570 3000 3000 285 1000 //WALL ID 0
wall        2853 457 0 128 1000 1000 65 1000 //WALL ID 1
hole        1623 477 0 0 50 50 19 10 //HOLE ID 0
hole        1879 477 0 0 50 50 19 10 //HOLE ID 1



Here's all the wall properties directly from the source code:

C:
static const char *terrainlist[] =
{
    /*
        Walls and holes.
        */

    "depth",
    "height",
    "lowerleft",
    "lowerright",
    "type",
    "upperleft",
    "upperright",
    "x",
    "z",
};


Here's how you can code a function in order to change any wall property:

C:
changelevelproperty("wall", id_number, "property", value);

Example:
C:
void removeWall(int id)
{//Remove defined wall by ID

    changelevelproperty("wall", id, "x", 9999);
    changelevelproperty("wall", id, "z", 9999);
    changelevelproperty("wall", id, "depth", 0);
    changelevelproperty("wall", id, "height", 0);
}
Thank you @Kratus ,

Absolutely and exactly what I was looking for.

Have an awesome day!
 
Back
Top Bottom