(Solved) Help with walls

Ohh cant wait to try your new project!!!

About walls, I have many bad experiences myself, but about the video, try setting the left walls BEFORE the other walls on the stage.txt. I did it like that on my dd mod (stage 2), however I still had walls problems on the broken highway stage.
 
save copy of your stage then remove all spawns and use obeditor to create all walls, save it when you finish and open txt in notpad to copy walls values to your first original txt file with spawns.
 
Obeditor would be the best option for more complex levels.
Many people seems to use it for that.

bWWd : Is there a visual interface/system to create walls in obeditor?
 
nedflandeurse said:
bWWd : Is there a visual interface/system to create walls in obeditor?

Yes obeditor has it. However as I said, it's different the behavior if you declare first some walls. For example in the next video you can see around 0:26 how the character can slightly pass over one wall when he's staying over another wall. I solved this declaring first that wall in the left and then the "red" wall.

https://m.youtube.com/watch?v=qyTLLXLzu8c
 
magggas said:
Yeah, finally i figured out that the order of setting the walls was the problem. Now i understand what Die_In_Fire was mean.
So, that was my problem.
About obeditor this is helpful too but the dam thing not always loads my stage.

Thank you all guys  ;D

Hi, your mod is very cool. A tip: Remember to put the anim walkoff chars so that when they fall from the platforms, show this animation! ;)
 
I use obeditor only to spawn special objects like walls and holes and before i do that i create special copyu of stage without any spawned enemies, then after i setup all walls and holes i save the stage and open in txt editor to copy values to original txt file, when you use obeditor with spawns and everything on stage then it can screw some commands and move spawns around , like spawn at 1000 as first spawned entity.
 
To be honest, I don't use obeditor to create walls and holes. I use openborstats to manually make them and refresh the stage to see if I do it right. I hear some say the refresh button can't work for looking at walls/holes created, but I don't know if it's true. Like what Die_In_Fire said about starting from left, it's what I did first before I made another.

Here's an example of what I did in stage 2 when I helped Zox with the walls:
8_8_14_9_45_45_AM.png


Look at the colors of the bottom lines (red, green, and blue) of each side. I did the walls to be even and get together without having characters to fall off from there either between, among, or out of walls. You can make the green line (right side of wall) go a little bit over the red line (left side of the other wall) by putting number. For example, with the picture shown above, look at the wall codes and the stage with the wall blocks. The second wall block is 84 pixels in depth between the first one (which is the short) and the third. The first wall has a green line (on its right side) which is a bit over the left side (red line) of the second wall. How I figured out? I used a little simple math work/logic in mind with squares (2,4,8,16,24,32, etc.; whatever number you desire to use for coding walls on existing platforms) by adjusting number on all four corners and a depth but it was hard work for me to create all of them together.

Here:
wall 287 293 0 48 130 178 48 32
wall 416 329 0 84 146 230 84 62
wall 562 329 0 84 126 210 84 79

(130+48=178; 146+84=230)

Just beware of the offset of every character in their walk if they fall or not because an offset is an invisible pixel for walking close to walls. Make sure the walls get close to them. (I gotta get going now. I'm off to work now. I'll come back to explain this)

EDIT:
Like the left and right (red and green lines) corners I discussed about, you can make the depth lines (red and blue) of walls get together and the blue lines can go a little over the red as shown in the screen. If you are so sure that you code the walls correctly, but the walls have wrong function for your characters to go through, use another engine that works for it. Sometimes, walls get funny functions for characters if they get close to the wall and then pop up to the other one above when walls are over each other by base. Example, I was using one character and he's down there walking to the wall that's big (actually side of wall base (whole square) over the other), and then it ends up *pop* he's walking up there over the big wall. He's supposed to walk to it without walking from "teleportation".

Sample of two walls being together:
wall_lines.png


When I said "Not sure if it's right or not" in the picture, what I mean is that I can't remember if it's coded right. However, due to my experience in coding several walls, I tried testing with that one (ones with green lines at the bottom) and it works for me. (Dunno for others.)
 
Thanks! Although I'm not good on understanding scripts as you do, I will try when I get access to a computer with Internet to copy the script!

Ps: cannot wait for your project!!
 
hope you serve

update:
Code:
//#import "data/scripts/respawn.c"
#import "data/scripts/camara.c"


void main()
{
  situar_camara();
  //obtener_respawn_seguro();
}


//drawstring(10, 100, 0, "HOLA");
//changeopenborvariant("xpos", 1900);
//altura_jugador = getentityproperty(self, "y")-110;
//if ((openborvariant("xpos")<252)&&(getentityproperty(self, "y")>=110)) {
//changelevelproperty("scrollspeed", 1);

camera:
Code:
* CONTROLA EL MOVIMIENTO DE LA CAMARA. *
***************************************/


#define MUY_LENTA	0.25	//Definicion de velocidades de camara usuales.
#define LENTA		0.5	//
#define NORMAL		1	//
#define RAPIDA		2	//
#define MUY_RAPIDA	4	//
#define MAXIMA		100000	//

#define NDMDCMIN	3	//Numero de movimientos de camara minimo. 

void situar_camara()
{
  void jugador = getplayerproperty(0, "ent");		//Dispone la entidad del primer jugador.
  int z_jugador = getentityproperty(jugador, "z");	//Posicion en profundidad del primer jugador.
  int x_jugador = getentityproperty(jugador, "x");	//Posicion horizontal del primer jugador.
  int y_jugador = getentityproperty(jugador, "y");	//Posicion en altura del primer jugador.
  int x_camara_actual = openborvariant("xpos");		//Posicion horizontal actual de la camara.
  int y_camara_actual = openborvariant("ypos");		//Posicion vertical actual de la camara.
  int x_camara_objetivo;				//Posicion horizontal que debe alcanzar la camara.
  int y_camara_objetivo;				//Posicion vertical que debe alcanzar la camara.
  float velocidad_camara_x;				//Velocidad horizontal a la que se mueve la camara.
  float velocidad_camara_y;				//Velocidad vertical a la que se mueve la camara.
  float sumatorio_x = getglobalvar("sumatorio_x");	//Distancia en pixels acumulada por el movimiento horizontal.
  float sumatorio_y = getglobalvar("sumatorio_y");	//Distancia en pixels acumulada por el movimiento vertical.
  int parte_entera;					//Parte entera de una distancia en pixels acumulada por el movimiento.
  int x_jugador_anterior = getglobalvar("x_jugador_anterior");		//Posicion horizontal anterior del jugador.
  int z_jugador_anterior = getglobalvar("z_jugador_anterior");		//Posicion de profundidad anterior del jugador.
  int y_jugador_anterior = getglobalvar("y_jugador_anterior");		//Posicion vertical anterior del jugador.
  int estado_jugador_actual = getglobalvar("estado_jugador_actual");	//Estado actual en el que se encuentra el jugador en el escenario.
  int estado_jugador_futuro = getglobalvar("estado_jugador_futuro");	//Estado futuro que alcanzara el jugador en el escenario.


  changelevelproperty("scrollspeed", 0);	//Inmoviliza la camara, para poder controlar su posicion.


  /******************************/
  /*GESTION DE CAMBIO DE ESTADO.*/
  /******************************/
  if ((estado_jugador_actual==estado_jugador_futuro)||(estado_jugador_futuro==-1))	//Detecta si no existe un cambio de estado en proceso.
  {
    /*EL JUGADOR SE ENCUENTRA SOBRE EL PRIMER TRAMO DE SUELO.*/
    if (estado_jugador_actual==0)
    {
      if ((y_jugador==110)&&(y_jugador_anterior==110))	//El jugador pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = 0;
      }

      if ((y_jugador==223)&&(y_jugador_anterior==223))	//El jugador pisa en la primera repisa.
      {
        estado_jugador_futuro = 1;
      }

      if ((y_jugador==226)&&(y_jugador_anterior==226))	//El jugador pisa en la segunda repisa.
      {
        estado_jugador_futuro = 2;
      }

      if ((y_jugador==155)&&(y_jugador_anterior==155))	//El jugador pisa en el bloque de hormigon.
      {
        estado_jugador_futuro = 3;
      }

      if ((estado_jugador_actual==estado_jugador_futuro)&&(y_jugador!=110))	//El jugador no pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = -1;
      }
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE LA PRIMERA REPISA.*/
    if (estado_jugador_actual==1)
    {
      if ((y_jugador==110)&&(y_jugador_anterior==110))	//El jugador pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = 0;
      }

      if ((y_jugador==223)&&(y_jugador_anterior==223))	//El jugador pisa en la primera repisa.
      {
        estado_jugador_futuro = 1;
      }

      if ((estado_jugador_actual==estado_jugador_futuro)&&(y_jugador!=223))	//El jugador no pisa en la primera repisa.
      {
        estado_jugador_futuro = -1;
      }
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE LA SEGUNDA REPISA.*/
    if (estado_jugador_actual==2)
    {
      if ((y_jugador==110)&&(y_jugador_anterior==110))	//El jugador pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = 0;
      }

      if ((y_jugador==226)&&(y_jugador_anterior==226))	//El jugador pisa en la segunda repisa.
      {
        estado_jugador_futuro = 2;
      }

      if ((y_jugador==155)&&(y_jugador_anterior==155))	//El jugador pisa el bloque de hormigon.
      {
        estado_jugador_futuro = 3;
      }

      if ((estado_jugador_actual==estado_jugador_futuro)&&(y_jugador!=226))	//El jugador no pisa en la segunda repisa.
      {
        estado_jugador_futuro = -1;
      }
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL BLOQUE DE HORMIGON.*/
    if (estado_jugador_actual==3)
    {
      if ((y_jugador==110)&&(y_jugador_anterior==110))	//El jugador pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = 0;
      }

      if ((y_jugador==226)&&(y_jugador_anterior==226))	//El jugador pisa en la segunda repisa.
      {
        estado_jugador_futuro = 2;
      }

      if ((y_jugador==155)&&(y_jugador_anterior==155))	//El jugador pisa el bloque de hormigon.
      {
        estado_jugador_futuro = 3;
      }

      if ((y_jugador==200)&&(y_jugador_anterior==200))	//El jugador pisa en el monton de vigas grande.
      {
        estado_jugador_futuro = 4;
      }

      if ((estado_jugador_actual==estado_jugador_futuro)&&(y_jugador!=155))	//El jugador no pisa el bloque de hormigon.
      {
        estado_jugador_futuro = -1;
      }
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL MONTON DE VIGAS GRANDE.*/
    if (estado_jugador_actual==4)
    {
      if ((y_jugador==110)&&(y_jugador_anterior==110))	//El jugador pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = 0;
      }

      if ((y_jugador==155)&&(y_jugador_anterior==155))	//El jugador pisa el bloque de hormigon.
      {
        estado_jugador_futuro = 3;
      }

      if ((y_jugador==200)&&(y_jugador_anterior==200))	//El jugador pisa en el monton de vigas grande.
      {
        estado_jugador_futuro = 4;
      }

      if ((y_jugador==230)&&(y_jugador_anterior==230))	//El jugador pisa el monton de vigas 1, 2 o 3.
      {
        estado_jugador_futuro = 5;
      }

      if ((estado_jugador_actual==estado_jugador_futuro)&&(y_jugador!=200))	//El jugador no pisa el monton de vigas grande.
      {
        estado_jugador_futuro = -1;
      }
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL MONTON DE VIGAS 1, 2 O 3.*/
    if (estado_jugador_actual==5)
    {
      if ((y_jugador==110)&&(y_jugador_anterior==110))	//El jugador pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = 0;
      }

      if ((y_jugador==155)&&(y_jugador_anterior==155))	//El jugador pisa el bloque de hormigon.
      {
        estado_jugador_futuro = 3;
      }

      if ((y_jugador==200)&&(y_jugador_anterior==200))	//El jugador pisa el monton de vigas grande.
      {
        estado_jugador_futuro = 4;
      }

      if ((y_jugador==230)&&(y_jugador_anterior==230))	//El jugador pisa el monton de vigas 1, 2 o 3.
      {
        estado_jugador_futuro = 5;
      }

      if ((y_jugador==275)&&(y_jugador_anterior==275))	//El jugador pisa el monton de vigas 4.
      {
        estado_jugador_futuro = 6;
      }

      if ((estado_jugador_actual==estado_jugador_futuro)&&(y_jugador!=230))	//El jugador no pisa el monton de vigas 1, 2 o 3.
      {
        estado_jugador_futuro = -1;
      }
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL MONTON DE VIGAS 4.*/
    if (estado_jugador_actual==6)
    {
      if ((y_jugador==110)&&(y_jugador_anterior==110))	//El jugador pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = 0;
      }

      if ((y_jugador==155)&&(y_jugador_anterior==155))	//El jugador pisa el bloque de hormigon.
      {
        estado_jugador_futuro = 3;
      }

      if ((y_jugador==200)&&(y_jugador_anterior==200))	//El jugador pisa el monton de vigas grande.
      {
        estado_jugador_futuro = 4;
      }

      if ((y_jugador==230)&&(y_jugador_anterior==230))	//El jugador pisa el monton de vigas 1, 2 o 3.
      {
        estado_jugador_futuro = 5;
      }

      if ((y_jugador==275)&&(y_jugador_anterior==275))	//El jugador pisa el monton de vigas 4.
      {
        estado_jugador_futuro = 6;
      }

      if ((y_jugador==307)&&(y_jugador_anterior==307))	//El jugador pisa el edificio B5.
      {
        estado_jugador_futuro = 7;
      }

      if ((estado_jugador_actual==estado_jugador_futuro)&&(y_jugador!=275))	//El jugador no pisa el monton de vigas 4.
      {
        estado_jugador_futuro = -1;
      }
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL EDIFICIO B5.*/
    if (estado_jugador_actual==7)
    {
      if ((y_jugador==110)&&(y_jugador_anterior==110))	//El jugador pisa el primer tramo de suelo.
      {
        estado_jugador_futuro = 0;
      }

      if ((y_jugador==155)&&(y_jugador_anterior==155))	//El jugador pisa el bloque de hormigon.
      {
        estado_jugador_futuro = 3;
      }

      if ((y_jugador==200)&&(y_jugador_anterior==200))	//El jugador pisa el monton de vigas grande.
      {
        estado_jugador_futuro = 4;
      }

      if ((y_jugador==230)&&(y_jugador_anterior==230))	//El jugador pisa el monton de vigas 1, 2 o 3.
      {
        estado_jugador_futuro = 5;
      }

      if ((y_jugador==275)&&(y_jugador_anterior==275))	//El jugador pisa el monton de vigas 4.
      {
        estado_jugador_futuro = 6;
      }

      if ((y_jugador==307)&&(y_jugador_anterior==307))	//El jugador pisa el edificio B5.
      {
        estado_jugador_futuro = 7;
      }

      if ((estado_jugador_actual==estado_jugador_futuro)&&(y_jugador!=307))	//El jugador no pisa el edificio B5.
      {
        estado_jugador_futuro = -1;
      }
    }
  }


  /************************************/
  /*GESTION DE TRANSITO ENTRE ESTADOS.*/
  /************************************/
  if (estado_jugador_actual!=estado_jugador_futuro)	//Detecta si existe un cambio de estado en proceso.
  {
    /*EL JUGADOR SE ENCUENTRA SOBRE EL PRIMER TRAMO DE SUELO.*/
    if (estado_jugador_actual==0)
    {
      if (estado_jugador_futuro==1)	//Cambia a la primera repisa.
      {					//
        estado_jugador_actual = 1;	//
      }					//

      if (estado_jugador_futuro==2)	//Cambia a la segunda repisa.
      {					//
        estado_jugador_actual = 2;	//
      }					//

      if (estado_jugador_futuro==3)	//Cambia al bloque de hormigon.
      {					//
        estado_jugador_actual = 3;	//
      }					//

      if (estado_jugador_futuro==-1)		//No se sabe si cambia o donde cambia.
      {						//
        velocidad_camara_x = RAPIDA;		//
        x_camara_objetivo = x_jugador-160;	//
      }						//
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE LA PRIMERA REPISA.*/
    if ((estado_jugador_actual!=estado_jugador_futuro)&&(estado_jugador_actual==1))
    {
      if (estado_jugador_futuro==0)	//Cambia al primer tramo de suelo.
      {					//
        estado_jugador_actual = 0;	//
      }					//

      if (estado_jugador_futuro==-1)		//No se sabe si cambia o donde cambia.
      {						//
        velocidad_camara_x = RAPIDA;		//
        x_camara_objetivo = x_jugador-160;	//
      }						//
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE LA SEGUNDA REPISA.*/
    if ((estado_jugador_actual!=estado_jugador_futuro)&&(estado_jugador_actual==2))
    {
      if (estado_jugador_futuro==0)	//Cambia al primer tramo de suelo.
      {					//
        estado_jugador_actual = 0;	//
      }					//

      if (estado_jugador_futuro==3)	//Cambia al bloque de hormigon.
      {					//
        estado_jugador_actual = 3;	//
      }					//

      if (estado_jugador_futuro==-1)		//No se sabe si cambia o donde cambia.
      {						//
        velocidad_camara_x = RAPIDA;		//
        x_camara_objetivo = x_jugador-160;	//
      }						//
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL BLOQUE DE HORMIGON.*/
    if ((estado_jugador_actual!=estado_jugador_futuro)&&(estado_jugador_actual==3))
    {
      if (estado_jugador_futuro==0)	//Cambia al primer tramo de suelo.
      {					//
        estado_jugador_actual = 0;	//
      }					//

      if (estado_jugador_futuro==2)	//Cambia a la segunda repisa.
      {					//
        estado_jugador_actual = 2;	//
      }					//

      if (estado_jugador_futuro==4)	//Cambia al monton de vigas grande.
      {					//
        estado_jugador_actual = 4;	//
      }					//

      if (estado_jugador_futuro==-1)		//No se sabe si cambia o donde cambia.
      {						//
        velocidad_camara_x = RAPIDA;		//
        x_camara_objetivo = x_jugador-160;	//
      }						//
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL MONTON DE VIGAS GRANDE.*/
    if ((estado_jugador_actual!=estado_jugador_futuro)&&(estado_jugador_actual==4))
    {
      if (estado_jugador_futuro==0)	//Cambia al primer tramo de suelo.
      {					//
        estado_jugador_actual = 0;	//
      }					//

      if (estado_jugador_futuro==3)	//Cambia al bloque de hormigon.
      {					//
        estado_jugador_actual = 3;	//
      }					//

      if (estado_jugador_futuro==5)	//Cambia al monton de vigas 1, 2 o 3.
      {					//
        estado_jugador_actual = 5;	//
      }					//

      if (estado_jugador_futuro==-1)		//No se sabe si cambia o donde cambia.
      {						//
        velocidad_camara_x = RAPIDA;		//
        x_camara_objetivo = x_jugador-160;	//
      }						//
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL MONTON DE VIGAS 1, 2 O 3.*/
    if ((estado_jugador_actual!=estado_jugador_futuro)&&(estado_jugador_actual==5))
    {
      if (estado_jugador_futuro==0)	//Cambia al primer tramo de suelo.
      {					//
        estado_jugador_actual = 0;	//
      }					//

      if (estado_jugador_futuro==3)	//Cambia al bloque de hormigon.
      {					//
        estado_jugador_actual = 3;	//
      }					//

      if (estado_jugador_futuro==4)	//Cambia al monton de vigas grande.
      {					//
        estado_jugador_actual = 4;	//
      }					//

      if (estado_jugador_futuro==6)	//Cambia al monton de vigas 4.
      {					//
        estado_jugador_actual = 6;	//
      }					//

      if (estado_jugador_futuro==-1)		//No se sabe si cambia o donde cambia.
      {						//
        velocidad_camara_x = RAPIDA;		//
        x_camara_objetivo = x_jugador-160;	//
      }						//
    }

    /*EL JUGADOR SE ENCUENTRA SOBRE EL MONTON DE VIGAS 4.*/
    if ((estado_jugador_actual!=estado_jugador_futuro)&&(estado_jugador_actual==6))
    {
      if (estado_jugador_futuro==0)
      {
        velocidad_camara_x = RAPIDA;				//Calcula el desplazamiento horizontal que debe realizar la camara.
        x_camara_objetivo = x_jugador-160;			//
        if ((y_camara_actual<188)&&(x_camara_objetivo<1537))	//
        {							//
          x_camara_objetivo = 1537;				//
        } else				//Cambia al primer tramo de suelo.
        {				//
          estado_jugador_actual = 0;	//
        }				//

        velocidad_camara_y = LENTA;	//Calcula el desplazamiento vertical que debe realizar la camara.
        y_camara_objetivo = 188;	//
      }

      if (estado_jugador_futuro==3)
      {
        velocidad_camara_x = RAPIDA;				//Calcula el desplazamiento horizontal que debe realizar la camara.
        x_camara_objetivo = x_jugador-160;			//
        if ((y_camara_actual<188)&&(x_camara_objetivo<1537))	//
        {							//
          x_camara_objetivo = 1537;				//
        } else				//Cambia al bloque de hormigon.
        {				//
          estado_jugador_actual = 3;	//
        }				//

        velocidad_camara_y = LENTA;	//Calcula el desplazamiento vertical que debe realizar la camara.
        y_camara_objetivo = 188;	//
      }

      if (estado_jugador_futuro==4)
      {
        velocidad_camara_x = RAPIDA;				//Calcula el desplazamiento horizontal que debe realizar la camara.
        x_camara_objetivo = x_jugador-160;			//
        if ((y_camara_actual<188)&&(x_camara_objetivo<1537))	//
        {							//
          x_camara_objetivo = 1537;				//
        } else				//Cambia al monton de vigas grande.
        {				//
          estado_jugador_actual = 4;	//
        }				//

        velocidad_camara_y = LENTA;	//Calcula el desplazamiento vertical que debe realizar la camara.
        y_camara_objetivo = 188;	//
      }

      if (estado_jugador_futuro==5)
      {
        velocidad_camara_x = RAPIDA;				//Calcula el desplazamiento horizontal que debe realizar la camara.
        x_camara_objetivo = x_jugador-160;			//
        if ((y_camara_actual<188)&&(x_camara_objetivo<1537))	//
        {							//
          x_camara_objetivo = 1537;				//
        } else				//Cambia al monton de vigas 1, 2 o 3.
        {				//
          estado_jugador_actual = 5;	//
        }				//

        velocidad_camara_y = LENTA;	//Calcula el desplazamiento vertical que debe realizar la camara.
        y_camara_objetivo = 188;	//
      }

      if (estado_jugador_futuro==7)	//Cambia al edificio B5.
      {					//
        estado_jugador_actual = 7;	//
      }					//

      if (estado_jugador_futuro==-1)
      {
        velocidad_camara_x = RAPIDA;				//Calcula el desplazamiento horizontal que debe realizar la camara.
        x_camara_objetivo = x_jugador-160;			//
        if ((y_camara_actual<188)&&(x_camara_objetivo<1537))	//
        {							//
          x_camara_objetivo = 1537;				//
        }							//
      }
    }

pd: you would have to adapt to your mod
 
Back
Top Bottom