Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mensajes - deathmetal

1
Por lo que entiendo, estás usando sprites diferentes para las piernas que para el torso... ¿Porqué?

Aunque utilices D&D debes manejar los operadores If (el icono del polígono morado con un signo de interrogación) para hacer condiciones de variables.

Puedes comenzar uniendo tus sprites de torso y piernas y hacer sprites para cada movimiento (caminar, saltar, arrastrarse, disparo arriba, disparo abajo) sólo no le pongas armas, y has los sprites de las armas aparte.

Luego ya que sabes todo esto, declaras una variable para cada movimiento

direccion=0 //0 será derecha y 1 será izquierda.
saltar=0// 0 será que no está saltando y 1 que sí está saltando
arrastrarse=0 //0 será que no está arrastrándose y 1 que sí
disparar=0 // 0 será que no está disparando y 1 que sí


luego manipula las variables en los eventos de Keyboard y Keypress según desees. Ten en cuenta que keyboard se ejecuta mientras la tecla está presionada, keypress solo cuando presionas la tecla, aunque la sigas presionando no seguirá ejecutándose hasta que la sueltes y la presiones de nuevo.

Por ejemplo keyboard left pondrias

direccion=1

Keyboard right

direccion=0

Keypress up

saltar=1

Etcétera.

En el evento step puedes manipular todos los sprites

Por ejemplo

if direccion=1{ //si está mirando a la izqueirda

if saltar=1{ sprite_index=saltandoizquierda}
if arrastrarse=1{sprite_index=arrastrándoseizquierda}
if disparando=1{sprite_index=disparandoizquierda}
if saltar=0 and arrastrarse =0 and disparando=0 {sprite_index=caminandoizquierda}
} else{

repites todo pero con el de la derecha}


Hace falta pulir un poco el código pero esa es la idea. El if, repito, es el icono morado con el signo de interrogación, los corchetes son los triangulitos morados, y lo que está entre los corchetes pues lo buscas en las librerias respectivas.
2
Preguntas y respuestas / Re:Funciones de string
Agosto 08, 2013, 05:06:59 AM
El manual me lo he leído ya varias veces y entiendo bien el inglés. Lo que no entiendo es cómo se usan. Además, las funciones de strings no son tantas...
3
Preguntas y respuestas / Re:Funciones de string
Agosto 07, 2013, 10:57:55 PM
No sé, porque no lo entiendo: No explica nada. Pero gracias por la respuesta.
4
Preguntas y respuestas / Funciones de string
Agosto 07, 2013, 02:33:28 AM
Hola, en la realización de mi sistema de diálogos me he topado con que no sé utilizar las funciones de strings. Alguien que las domine sería tan amable de poner un ejemplo de cada una? ya que la ayuda del manual de GM no es muy especifica, o al menos no me ha sido de mucha ayuda... Uso GM8
5
Gracias, el manual de GM8 no dice en qué orden deben estar los caracteres. Ahora, no ubico el formato gmspr, no puedo abrir el archivo :C

EDITADO: Listo, gracias de verdad.
6
Preguntas y respuestas / Re:Ayuda para iniciar
Agosto 06, 2013, 05:47:13 AM
Un RPG es muy complicado para comenzar; sin embargo, puedes hacerlo. Creo que la verdadera pregunta aquí es si tienes experiencia con algun lenguaje de programación para usar el GML o comenzarás desde cero con el D&D. Yo comencé con el D&D y actualmente sólo utilizo GML y ya trabajo en RPG's.

Puedes comenzar probando los eventos de teclado con acciones de movimiento, las colisiones con los objetos sólidos para darle cuerpo al juego. Y usa los ejemplos de ésta página para darle mejor calidad al juego.
7
En realidad no, el mapa de caracteres, al menos he visto comienza con " ! ", y siendo honesto copié el código de otro lado así que en primer caracter tengo colocado sólo: 33 y funciona bien con texto sin acentos ni ñ. Espero alguien de con la solución.
8
Quiero dibujar texto con un sprite pero no dibuja las ñ ni los acentos. en otros temas he visto como solucionar el problema pero usando fuentes normales y no de sprite. en  el manual encontré que el sprite debe estar en el mismo orden que el formato ascii por lo que le añadí a mi sprite las ñ y los acentos en donde deberían de estar basandome en el mapa de caracteres del windows, pero sigue sin aparecer. ¿Es posible hacer eso?
9
Preguntas y respuestas / View que tiembla
Agosto 05, 2013, 06:40:12 PM
Hola.

Tengo una view de 320 y 320 que sigue al objeto de personaje en un margen de 160. Quiero hacer que la view tiemble en un momento dado, para dar el efecto de que toda la tierra tiembla. Cómo se lograría?
10
Preguntas y respuestas / Re:Dibujar variable
Agosto 05, 2013, 06:35:47 PM
No entiendo bien lo que pides pero creo que usando una variable global bastaría

Declaras la variable, por ejemplo en un evento Game Start

global.variable=100

En un evento draw cualquiera pones

draw_text(global.variable,x,y)

Ahora, para dibujar una variable local de otro objeto usas lo siguiente

draw_text(object.variable,x,y)

No puedes dibujar, hasta donde yo sé, una variable local de un objeto que no está en la room
11
Si tienes todos los objetos en la pantalla puedes hacer esto.

Objeto1
[Ev Animation End]

Código:

image_speed=0
with object02 { image_single=-1}

Objeto 2

[Ev Create]

Código

image_single=0

[Ev animation end]

image_single=última imagen (ponle el número)

with object03 {image_single=-1}

y así lo haces.

Si no están todos los objetos en la pantalla en lugar del image single pones instance_create


Espero te sirva
12
A menos que quieras que se pueda disparar manteniendo la tecla presionada sin tener que levantar y presionar una y otra vez. Si es así, debes crear un tiempo de retraso mediante una variable. Podemos llamarla
wait=0

if wait=0{ acciones de dispar; reproducir sonido; wait=1; alarm[0]=5}

esto es con códigos pero con D&D es similar, en la pestaña control tienes la condicional (el poligono morada con un ? y los corchetes son los iconos triangulares arriba y abajo.
13
Puedes usar alarmas o variables de tiempo.

Por ejemplo, si tu sprite animado tiene 15 subimágenes programas alarmas cada 15 steps. No puedo mostrarte algo porque no sé si usas un objeto diferente o si sólo dibujas los sprites...
14
Autores originales: Carl Larsson, aka Megabrain, Enigma or Teslago
Editado por: Meziku Asukana

Este escript utiliza la version de GM 5 :GM5:
Es de diálogos al estilo pokemon. Lo que hace es que primero dibujar el cuadro de diálogo en las coordenadas scr_dialog_x y scr_dialog_y. El sprite es del tamaño de toda la pantalla. Después dibuja el texto que le asignamos en el argument0 letra por letra. Si le texto es mayor a cierta cantidad (Que creo que es la variable splitamt) automaticamente lo dibuja después de que le des a la tecla S o A.

/*
Originally written by: Carl Larsson, aka Megabrain, Enigma or Teslagon.
Edited by: Meziku Asukana
You'll have to give credit to the creator, and I'd like it if you gave credit to me too.
EX: scr_dialog("TEXT", true, 0)
0=black text
1=white text
Check the sprite "spr_textbox" and you'll see them. Thats where this comes from.
And you can add more, although it'd kinda wreck a pokemon fan game. :D
Oh yeah, the "bg" is 240x161, so umm, yeah. You'll have to do just that.
*/
if argument1 = true
/*
Checks to see if dialog asked for is wanted.
Tip: You could use a global variable, set to true at first, allowing
the game to execute the dialog, then some event happens, and you don't
want it to be able to be read anymore. Like a postsign or something.
There's also a piece of script at the end of this that uses this variable.
*/
{
  keyboard_clear(vk_enter);
  /*
  The player might've clicked space/enter at the end of a dialog, and
  might be reading somemore, so this stops it from going on, so the
  player is allowed, humanely, to read it. lol
  */
  scr_dialog_x = view_x[0];
  //Sets View X variable, usually set to 0.
  scr_dialog_y = view_y[0]+view_height[0];
  /*
  Sets View Y variable and adds how tall it is, in this case *in a pokemon
  game*, it should be 160 or so. Game Screen: 240x160 WxH
  And both two lines of script above should end up to be the lower left corner.
  */
  draw_sprite(spr_textbox,0,scr_dialog_x,scr_dialog_y-160);
  /*
  So first, we have to draw the dialog box. Its up first, before the letters are drawn,
  b/c then, the letters will appear over the box. lol. *made it complicated probably*
  */
  scr_dialog_pause = false;
  //Added to fix a glitch that skipped pieces of text.
  scr_dialog_split = false;
  //Saves a variable to false. Will be explained further on.
  scr_dialog_texttype=argument2;
  //Determines which dialog text to use. Explained at the very top.
  scr_dialog_text = argument0;
  /*
  Saves the first thing typed in "scr_dialog(1, 2, 3)" into a variable.
  It SHOULD be text wrapped in QUOTES.
  */
  scr_dialog_pos  = 1;
  scr_dialog_disp  = '';
  scr_dialog_wait = 0;
  scr_dialog_finished = false;
  /*
  Above are miscallaneous, and are required for proper functionality. Ok?
  You pay the price for messing with it. :D
  */
  scr_dialog_splitamt = 55;
  /*
  Will be explained further on. *coexists with split var*
  Those set all the dialog variables.
  */
 
  if string_length(scr_dialog_text) > scr_dialog_splitamt
  {
  scr_dialog_text = string_copy(argument0,1,scr_dialog_splitamt);
  while string_char_at(scr_dialog_text,scr_dialog_splitamt)!=' '
  {
  if scr_dialog_splitamt < 70
  {
    scr_dialog_splitamt+=1;
  }
  scr_dialog_text = string_copy(argument0,1,scr_dialog_splitamt);
  if scr_dialog_splitamt = 70
  {
    break;
  }
  }
  scr_dialog_split = true;
  scr_dialog_resttext = string_copy(argument0,scr_dialog_splitamt,(string_length(argument0)-string_length(scr_dialog_text))+1);
  /*
  This explains both two lines of script above.
  If the text in the first argument is bigger than the splitamt value
  It'll save the split value to true, which happens around the end of this
  And save the rest of the text after the number of chars in splitamt.
  This is a handy function that lets the game itself seperate the text.
  */
  }
 
  //The rest of the script will explained later...I'm tired now and want to SCRIPT! :0
  scr_dialog_text = string_replace_all(scr_dialog_text,'#','');
  if string_length(scr_dialog_text) > 35
  {
    scr_dialog_lines = 1;
  }
  if string_length(scr_dialog_text) < 36
  {
    scr_dialog_lines = 0;
  }
  if string_char_at(scr_dialog_text,1) = ' '
  {
    scr_dialog_text = string_replace(scr_dialog_text,' ','');
  }
  for (scr_dialog_li=1;scr_dialog_li<=scr_dialog_lines;scr_dialog_li+=1)
  {
    scr_dialog_add_13 = 0;
      while string_char_at(scr_dialog_text,(35*scr_dialog_li)-scr_dialog_add_13) != ' ' or scr_dialog_add_13 < 7
      {
        if string_char_at(scr_dialog_text,(35*scr_dialog_li)-scr_dialog_add_13) = ' ' or scr_dialog_add_13 > 7
        {
          break;
        }
        scr_dialog_add_13 += 1;
      }
    scr_dialog_mark_13[scr_dialog_li] = (35*scr_dialog_li)-scr_dialog_add_13;
    scr_dialog_text = string_insert(" #",scr_dialog_text,(35*scr_dialog_li)-scr_dialog_add_13);
  } 
  scr_dialog_text = string_replace_all(scr_dialog_text,'# ','#');
}


if scr_dialog_finished = false
{
  scr_dialog_disp = string_copy(scr_dialog_text,1,scr_dialog_pos);
  if keyboard_check(global.ctrl_cancel)=true
  {
    scr_dialog_pos += 3;
  }
  else
  {
    scr_dialog_pos += 1;
  }
  /*
  Explains ALL nine LINES above, including the {'s -_-. This gives it the effect as typing it, letter by letter.
  That +=1 there makes it one letter by letter, if you change it to 2, it'll do 2 by 2
  */
  if scr_dialog_texttype=1
  {
    draw_text_sprite(scr_dialog_x+16,scr_dialog_y-38,scr_dialog_disp,16,999,spr_textwhite,'!',1);
  }
  else
  {
    if scr_dialog_texttype=0
    {
      draw_text_sprite(scr_dialog_x+16,scr_dialog_y-38,scr_dialog_disp,16,999,spr_textblack,'!',1);
    }
  }
  screen_refresh();
  if scr_dialog_text = scr_dialog_disp
  {
    scr_dialog_finished = true;
  }
}

if keyboard_check(vk_space)
{
  keyboard_clear(vk_enter);
  screen_refresh();
}

if scr_dialog_finished = true
{
  screen_refresh();
  io_clear();
  if scr_dialog_pause = false
  {
    do
    {
      keyboard_wait();
      if keyboard_lastkey=global.ctrl_trigger
      {
        scr_dialog_wait=1;
      }
      else
      {
        if keyboard_lastkey=vk_f12
        {
          event_perform_object(type_bts,ev_keyrelease,vk_f12);
          io_clear();
        }
        else
        {
          io_clear();
        }
      }
    }
    until (scr_dialog_wait=1)
  }
  sound_play(sfx_dialog)
  //You know, the pokemon games have that sound effect. Its removable.
  screen_redraw();
  io_clear();
  if scr_dialog_split = true
  /*
  So yeah. That split var from before. Let me explain it now.
  The splitamt var is set to a number of how many chars should be able
  to fit in the dialog box. This split variable sees if the dialog is over
  the splitamt. It is set to true if it is over splitamt, else, the
  the following script doesn't happen.
  */
  {
    scr_dialog(scr_dialog_resttext,true,scr_dialog_texttype);
    /*
    So then, the text saved from before is now shown, and loops
    if it continously is bigger than the splitamt value.
    */
  }
}
else
{
  sleep(50);
  //Sets some time between drawing letters.
  scr_dialog(argument0,false,scr_dialog_texttype);
}



PERO yo lo quiero usar en GM 8  :GM8: por lo que traté de adaptarlo y este fue el resultado.
Las adaptaciones que hice fue mover las coordenadas para ajustarlas a mi view, así como eliminar la funcion de draw_tex_sprite por otro script que lo único que hace es dibujar texto con sprite.

Argument0= //Texto a dibujar
Argument1= //No tengo ni idea
Argument2= //El color del texto 0=rojo, 1=blanco


//
//Originally written by: Carl Larsson, aka Megabrain, Enigma or Teslagon.
//Edited by: Meziku Asukana
//You'll have to give credit to the creator, and I'd like it if you gave credit to me too.
//EX: scr_dialog("TEXT", true, 0)
//0=black text
//1=white text

if argument1 = true

//Checks to see if dialog asked for is wanted.
//Tip: You could use a global variable, set to true at first, allowing
//the game to execute the dialog, then some event happens, and you don't
//want it to be able to be read anymore. Like a postsign or something.
//There's also a piece of script at the end of this that uses this variable.

{
  keyboard_clear(vk_enter);
  /*
  The player might've clicked space/enter at the end of a dialog, and
  might be reading somemore, so this stops it from going on, so the
  player is allowed, humanely, to read it. lol
  */
  scr_dialog_x = view_xview;
  //Sets View X variable, usually set to 0.
  scr_dialog_y = view_yview+100;
  /*
  Sets View Y variable and adds how tall it is, in this case *in a pokemon
  game*, it should be 160 or so. Game Screen: 240x160 WxH
  And both two lines of script above should end up to be the lower left corner.
  */
  draw_sprite(dialog_box_spr,0,scr_dialog_x,scr_dialog_y);
  /*
  So first, we have to draw the dialog box. Its up first, before the letters are drawn,
  b/c then, the letters will appear over the box. lol. *made it complicated probably*
  */
  scr_dialog_pause = false;
  //Added to fix a glitch that skipped pieces of text.
  scr_dialog_split = false;
  //Saves a variable to false. Will be explained further on.
  scr_dialog_texttype=argument2;
  //Determines which dialog text to use. Explained at the very top.
  scr_dialog_text = argument0;
  /*
  Saves the first thing typed in "scr_dialog(1, 2, 3)" into a variable.
  It SHOULD be text wrapped in QUOTES.
  */
  scr_dialog_pos  = 1;
  scr_dialog_disp  = '';
  scr_dialog_wait = 0;
  scr_dialog_finished = false;
  /*
  Above are miscallaneous, and are required for proper functionality. Ok?
  You pay the price for messing with it. :D
  */
  scr_dialog_splitamt = 55;
  /*
  Will be explained further on. *coexists with split var*
  Those set all the dialog variables.
  */
 
  if string_length(scr_dialog_text) > scr_dialog_splitamt
  {
  scr_dialog_text = string_copy(argument0,1,scr_dialog_splitamt);
  while string_char_at(scr_dialog_text,scr_dialog_splitamt)!=' '
  {
  if scr_dialog_splitamt < 70
  {
    scr_dialog_splitamt+=1;
  }
  scr_dialog_text = string_copy(argument0,1,scr_dialog_splitamt);
  if scr_dialog_splitamt = 70
  {
    break;
  }
  }
  scr_dialog_split = true;
  scr_dialog_resttext = string_copy(argument0,scr_dialog_splitamt,(string_length(argument0)-string_length(scr_dialog_text))+1);
  /*
  This explains both two lines of script above.
  If the text in the first argument is bigger than the splitamt value
  It'll save the split value to true, which happens around the end of this
  And save the rest of the text after the number of chars in splitamt.
  This is a handy function that lets the game itself seperate the text.
  */
  }
 
  //The rest of the script will explained later...I'm tired now and want to SCRIPT! :0
  scr_dialog_text = string_replace_all(scr_dialog_text,'#','');
  if string_length(scr_dialog_text) > 35
  {
    scr_dialog_lines = 1;
  }
  if string_length(scr_dialog_text) < 36
  {
    scr_dialog_lines = 0;
  }
  if string_char_at(scr_dialog_text,1) = ' '
  {
    scr_dialog_text = string_replace(scr_dialog_text,' ','');
  }
  for (scr_dialog_li=1;scr_dialog_li<=scr_dialog_lines;scr_dialog_li+=1)
  {
    scr_dialog_add_13 = 0;
      while string_char_at(scr_dialog_text,(35*scr_dialog_li)-scr_dialog_add_13) != ' ' or scr_dialog_add_13 < 7
      {
        if string_char_at(scr_dialog_text,(35*scr_dialog_li)-scr_dialog_add_13) = ' ' or scr_dialog_add_13 > 7
        {
          break;
        }
        scr_dialog_add_13 += 1;
      }
    scr_dialog_mark_13[scr_dialog_li] = (35*scr_dialog_li)-scr_dialog_add_13;
    scr_dialog_text = string_insert(" #",scr_dialog_text,(35*scr_dialog_li)-scr_dialog_add_13);
  } 
  scr_dialog_text = string_replace_all(scr_dialog_text,'# ','#');
}


if scr_dialog_finished = false
{
  scr_dialog_disp = string_copy(scr_dialog_text,1,scr_dialog_pos);
  if keyboard_check(vk_space)=true
  {
    scr_dialog_pos += 3;
  }
  else
  {
    scr_dialog_pos += 1;
  }
  /*
  Explains ALL nine LINES above, including the {'s -_-. This gives it the effect as typing it, letter by letter.
  That +=1 there makes it one letter by letter, if you change it to 2, it'll do 2 by 2
  */
  if scr_dialog_texttype=1
  {
  draw_set_color(c_white)
    dialogo_script(scr_dialog_disp,scr_dialog_x+8,scr_dialog_y+4);
  }
  else
  {
    if scr_dialog_texttype=0
    {
    draw_set_color(c_red)
      dialogo_script(scr_dialog_disp,scr_dialog_x+8,scr_dialog_y+4);
    }
  }
  screen_refresh();
  if scr_dialog_text = scr_dialog_disp
  {
    scr_dialog_finished = true;
  }
}



if scr_dialog_finished = true
{
  screen_refresh();
  io_clear();
  if scr_dialog_pause = false
  {
    do
    {
      keyboard_wait();
      if keyboard_lastkey=vk_space
      {
        scr_dialog_wait=1;
      }
      else
      {
        if keyboard_lastkey=vk_f12
        {
          event_perform_object(type_bts,ev_keyrelease,vk_f12);
          io_clear();
        }
        else
        {
          io_clear();
        }
      }
    }
    until (scr_dialog_wait=1)
  }
  //sound_play(sfx_dialog)
  //You know, the pokemon games have that sound effect. Its removable.
  screen_redraw();
  io_clear();
  if scr_dialog_split = true
  /*
  So yeah. That split var from before. Let me explain it now.
  The splitamt var is set to a number of how many chars should be able
  to fit in the dialog box. This split variable sees if the dialog is over
  the splitamt. It is set to true if it is over splitamt, else, the
  the following script doesn't happen.
  */
  {
    scr_dialog(scr_dialog_resttext,true,scr_dialog_texttype);
    /*
    So then, the text saved from before is now shown, and loops
    if it continously is bigger than the splitamt value.
    */
  }
}
else
{
  sleep(50);
  //Sets some time between drawing letters.
  scr_dialog(argument0,false,scr_dialog_texttype);
}


El problema es que.... el texto nunca se dibuja en las coordenadas que le puse. Se dibuja donde se le da la gana. Tanto el texto como el cuadro de diálogo. Imagino que habrá alguna variable que modifique las coordenadas... pero no la encuentro. Alguien ve el problema? :C

EDIT

Cuando quieres dibujar algo fuera del evento draw, además de refrescar la pantalla debes usar las funciones de view_xport y view_yport, en lugar de view_xview y view_yview...
15
Juegos en desarrollo / Re:The underground
Julio 31, 2013, 06:18:51 PM
Con lento me refiero a que podrías agregarle la función de correr y no solo caminar, y ese tipo de cosas. Me gustaría ver un poco de más movimiento xD