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.

Temas - sephiroth.sefirot

1
Hola a todos, tengo un script antiguo, basado en el texto pokémon de la gba, que se hizo en su día en gm5, tiene la particularidad que quiero yo, que se escriba letra a letra asta llegar al final y pasar al siguiente contenido si no entra o continuar con el evento nada mas terminarse ese script. Se ejecutaría así texto("hola",true,true,true);.
El caso es que lleva dos funciones que no son ya funcionales en gms (screen_refresh(), sleep()) a parte de que hay que cambiar los view_x y view_y. El caso que al no saber con que sustituir esas funciones de refresco y de espera, las elimino pero los draw del script como que no dibujan sin refrescar al parecer.
Como no sabia como remediarlo, intente extraer lo de los caracteres pero no pillo bien el truco del script como para extraer esa característica.
Aquí dejo el script, son tres.

Primero están los sprites l_a, l_b, l_r y l_v que son las letras, la caja del texto que es textos y el icono mas.

y ahora esta los siguientes scripts

Nombre: get_letter
letter = argument0
if ord(letter) >= ord("A") and ord(letter) <= ord("Z") //if it is an uppercase letter
{
  return (32 + (ord(letter) - ord("A"))) //return a value for the letter
}
if ord(letter) >= ord("a") and ord(letter) <= ord("z") //if it is a lowercase letter
{
  return (64 + (ord(letter) - ord("a"))) //return a value for the letter
}
if letter = "!" //exclamation mark
{
  return 0
}
if letter = " "
{
return 2
}
if letter = 'é' //quotations
{
  return 96
}
  if letter = 'É' //quotations
{
  return 96
}
  if letter = '¿' //quotations
{
  return 100
}
  if letter = '¡' //quotations
{
  return 101
}
  if letter = 'í' //quotations
{
  return 97
}
  if letter = 'ó' //quotations
{
  return 98
}
  if letter = 'ú' //quotations
{
  return 99
}
  if letter = 'á' //quotations
{
  return 95
}
   if letter = 'Í' //quotations
{
  return 97
}
  if letter = 'Ó' //quotations
{
  return 98
}
  if letter = 'Ú' //quotations
{
  return 99
}
  if letter = 'Á' //quotations
{
  return 95
}
if letter = '"' //quotations
{
  return 1
}
if letter = 'Ñ' //quotations
{
  return 93
}
if letter = 'ñ' //quotations
{
  return 94
}
if letter = "#" //number sign
{
  return 2
}
if letter = "$" //dollar sign
{
  return 3
}
if letter = "%" //percent sign
{
  return 4
}
if letter = "&" //ampersand
{
  return 5
}
if letter = "'" //semi-qute
{
  return 6
}
if letter = "(" //parentheses
{
  return 7
}
if letter = ")" //parentheses
{
  return 8
}
if letter = "*" //asterisk
{
  return 9
}
if letter = "+" //plus sign
{
  return 10
}
if letter = "," //comma
{
  return 11
}
if letter = "-" //dash
{
  return 12
}
if letter = "." //period
{
  return 13
}
if letter = "/" //slash
{
  return 14
}
if letter = "0" //0
{
  return 15
}
if letter = "1" //1
{
  return 16
}
if letter = "2" //2
{
  return 17
}
if letter = "3" //3
{
  return 18
}
if letter = "4" //4
{
  return 19
}
if letter = "5" //5
{
  return 20
}
if letter = "6" //6
{
  return 21
}
if letter = "7" //7
{
  return 22
}
if letter = "8" //8
{
  return 23
}
if letter = "9" //9
{
  return 24
}
if letter = ":" //colon
{
  return 25
}
if letter = ";" //semi colon
{
  return 26
}
if letter = "<" //less than
{
  return 27
}
if letter = "=" //equal to
{
  return 28
}
if letter = ">" //greater than
{
  return 29
}
if letter = "?" //question mark
{
  return 30
}
if letter = "@" //at sign
{
  return 31
}
if letter = "[" //bracket
{
  return 58
}
if letter = "\" //slash
{
  return 59
}
if letter = "]" //bracket
{
  return 60
}
if letter = "^" //carot
{
  return 61
}
if letter = "_" //underscore
{
  return 62
}
if letter = "'" //quotation mark
{
  return 63
   }



Nombre: texto
//argument0 = the text
//argument1 = whether or not to draw the box at the end
//argument2 = whether or not to initiate the text
//argument3 = whether or not to draw the text box
//argument4 = the font to use
//` = white text
//^ = red text
//{ = blue text
//} = green text
global.drawingtext = true //the game is drawing text
if argument2 = true //if it is the first time through
{
  self.position = 1//set the position as 1
  self.done = false //the text isn't done
}
global.text = argument0
global.more = argument1
global.font = l_b //set the font at the beggining of the script
//sets the postion of the pointer, so it knows how much text should be drawn
if keyboard_check(vk_enter) = true //if enter is pushed
{
  self.done = true //you are done
  self.position = string_length(global.text) //end the text
  self.curstring = global.text //set the string to the text
  keyboard_clear(vk_enter) //stop generating events
}
if self.done = false //if the text line isn't done
{
  self.curstring = string_copy(global.text, 1, self.position) //the first line is a part of the actual first line
  if string_length(self.curstring) = string_length(global.text) //if the text is done
   {
    self.done = true //this line is done
    self.position = 1  //reset the start point
   }
}
if self.done = false //if not all text is done
{
  self.position += 1 //add one to the position
}

//draws the important stuff
if argument3 = true //if you should draw the text box
{
  draw_sprite(textos, 0, view_x[0] + 0, view_y[0] + 112) //draw the text box
}
self.pointx = 16 //a little to the right...
self.pointy = 117 //a little down...
for(i = 1; i < string_length(self.curstring) + 1; i += 1) //once for every character
{
  self.lettertemp = string_copy(self.curstring, i, 1) //get the letter
  if self.pointx >= 225 //if it is too far over
   {
    self.pointx = 22 //go back a bit
    self.pointy += 16 //go down a line
   }
  if self.lettertemp <> " " and self.lettertemp <> "ª" //if it isn't a space or a tilde
   {
    if self.lettertemp <> "`" and self.lettertemp <> "^" and self.lettertemp <> "{" and self.lettertemp <> "}" //if it's not changing the font
     {
      self.todraw = get_letter(self.lettertemp) //get the imagesingle of the value
      draw_sprite(global.font, self.todraw, view_x[0] + self.pointx, view_y[0] + self.pointy)
      self.pointx += 6//move over for the next letter
     }
    else //if it is changing the font
     {
      if self.lettertemp = "`" //set it white
       {
        global.font = l_b //sets it
       }
      if self.lettertemp = "^" //the caret
       {
        global.font = l_r //sets it
       }
      if self.lettertemp = "{" //blue
       {
        global.font = l_a //sets it
       }
      if self.lettertemp = "}" //green
       {
        global.font = l_v //sets it
       }
     }
   }
  if self.lettertemp = " " //if it is a space
   {
    self.pointx += 6 //move over for the next letter
   }
  if self.lettertemp = "ª" //if it is a tilde
   {
    self.pointy += 16 //move down for the next letter
    self.pointx = 16 //reset to the start of the line
   }
}
screen_refresh() //refreshes the screen so you can actually see it

if self.done = true and global.more = true //if we need to draw an arrow
{
  draw_sprite(mas, 0, view_x[0] + 212, view_y[0] + 140) //draw the arrow
}

if self.done = false //if the text isn't done
{
   sleep(30) //pretty fast
   texto(argument0, argument1, false, argument3) //do it all again
}
else //yer done!
{
  screen_refresh() //refresh the screen
  io_clear();
  do {/*nada*/} until (keyboard_check(ord('Z')) == true);
  io_clear();
  sleep(30)
  global.drawingtext = false
}




Nombre: battle
//argument0 = the text
//argument1 = whether or not to draw the box at the end
//argument2 = whether or not to initiate the text
//argument3 = whether or not to draw the text box
//argument4 = the font to use
//` = white text
//^ = red text
//{ = blue text
//} = green text
global.drawingtext = true //the game is drawing text
if argument2 = true //if it is the first time through
{
  self.position = 1//set the position as 1
  self.done = false //the text isn't done
}
global.text = argument0
global.more = argument1
global.font = l_b //set the font at the beggining of the script
//sets the postion of the pointer, so it knows how much text should be drawn
if keyboard_check(vk_enter) = true //if enter is pushed
{
  self.done = true //you are done
  self.position = string_length(global.text) //end the text
  self.curstring = global.text //set the string to the text
  keyboard_clear(vk_enter) //stop generating events
}
if self.done = false //if the text line isn't done
{
  self.curstring = string_copy(global.text, 1, self.position) //the first line is a part of the actual first line
  if string_length(self.curstring) = string_length(global.text) //if the text is done
   {
    self.done = true //this line is done
    self.position = 1  //reset the start point
   }
}
if self.done = false //if not all text is done
{
  self.position += 1 //add one to the position
}

//draws the important stuff
if argument3 = true //if you should draw the text box
{
  draw_sprite(batalla_text, 0, view_x[0] + 0, view_y[0] + 112) //draw the text box
}
self.pointx = 16 //a little to the right...
self.pointy = 117 //a little down...
for(i = 1; i < string_length(self.curstring) + 1; i += 1) //once for every character
{
  self.lettertemp = string_copy(self.curstring, i, 1) //get the letter
  if self.pointx >= 225 //if it is too far over
   {
    self.pointx = 22 //go back a bit
    self.pointy += 16 //go down a line
   }
  if self.lettertemp <> " " and self.lettertemp <> "ª" //if it isn't a space or a tilde
   {
    if self.lettertemp <> "`" and self.lettertemp <> "^" and self.lettertemp <> "{" and self.lettertemp <> "}" //if it's not changing the font
     {
      self.todraw = get_letter(self.lettertemp) //get the imagesingle of the value
      draw_sprite(global.font, self.todraw, view_x[0] + self.pointx, view_y[0] + self.pointy)
      self.pointx += 6//move over for the next letter
     }
    else //if it is changing the font
     {
      if self.lettertemp = "`" //set it white
       {
        global.font = l_b //sets it
       }
      if self.lettertemp = "^" //the caret
       {
        global.font = l_r //sets it
       }
      if self.lettertemp = "{" //blue
       {
        global.font = l_a //sets it
       }
      if self.lettertemp = "}" //green
       {
        global.font = l_v //sets it
       }
     }
   }
  if self.lettertemp = " " //if it is a space
   {
    self.pointx += 6 //move over for the next letter
   }
  if self.lettertemp = "ª" //if it is a tilde
   {
    self.pointy += 16 //move down for the next letter
    self.pointx = 16 //reset to the start of the line
   }
}
screen_refresh() //refreshes the screen so you can actually see it

if self.done = true and global.more = true //if we need to draw an arrow
{
  draw_sprite(mas, 0, view_x[0] + 212, view_y[0] + 140) //draw the arrow
}

if self.done = false //if the text isn't done
{
   sleep(30) //pretty fast
   battle(argument0, argument1, false, argument3) //do it all again
}
else //yer done!
{
  screen_refresh() //refresh the screen
  io_clear();
  do {/*nada*/} until (keyboard_check(ord('Z')) == true);
  io_clear();
  sleep(30)
  global.drawingtext = false
}




Si sabrían decirme que corregir o corregirlo para que sea funcional en gms os lo agradecería mucho.
Muchas gracias con antelación.
2
Tengo una cuestion y es que quiero hacer un objeto que sirva de camara y mire en un punto en concreto, siendo spirtes en 2d cuando mas cerca del obj camara mayor sea su tamaño. Supuestamente se deveria hacer con el create d3d_start para empezar el 3d tambien el d3d_perspective(true) para activar la perspectiva y en el draw el d3d_set_projection(xfrom,yfrom,zfrom,xto,yto,zto,xup,yup,zup) indicar el punto del objeto y punto en el que mira. Pero no se porque haga lo que haga me deja la pantalla volteada verticalmente no hay manera.
Sabria alguien que deveria utilizar para crear una camara y vision tipo como este juego de esta imagen.

Gracias de antemano con la ayuda.
3
Preguntas y respuestas / Necesito ayuda en esto
Marzo 31, 2011, 03:52:30 PM
Hola a todos, mirad mi problema es que no se como hacer o que funcion es para hacer que cuando tal object salga del view no puede realizar su funcion dentro del view si.
Gracias de antemano.
4
Hola, tengo un problema, estoy haciendo un juego de dragon ball z rpg como el dragon ball z buus fury de gba, mi problema es que hice la transmision instantanea de goku e iba perfecto, luego la IA (aun me falta por terminar alguna cosa) y hay venia mi problema, luego retoque para mejorarlo y ahora esta terminado pero aun asi aveces vay otras se atasca no encuentro el motivo de por que.

EDIT: Ya encontre el fallo, resulta k cuando la IA esta la mitad fuera del view y la otra en lo visible de view se atasca.

ay alguna forma de k cuando el jugador se desplace el view se centre en donde aparece y cuando regrese a su sitio el view se ponga donde la ultimavez?
5
Hola a todos, mi problema es que quiero hacer que si existen uno de los cuatro object no realice nada

Segun yo creo es con el object_exists.

Pero mi problema es que aunque en la room no haya esos cuatro object no me puede realizar la accion.

Mirad lo tengo asi:
if not object_exists(kamehameha_princ_front) and not object_exists(kamehameha_princ_left) and not object_exists(kamehameha_princ_right) and not object_exists(kamehameha_princ_back)
{
if global.playermove=0 and global.kame=0
{
global.kame=1
acciones_jugador_4()
}
}


Gracias de antemano