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 - dixon

46
Juegos completos / La chica del campamento
Enero 11, 2022, 09:50:46 PM



47
Hola, saludos, espero que esten muy bien.


Bueno, hoy les traigo una nueva actualización del script para los botones táctiles en juegos html5, ahora los botones tendrán una mejor imagen  "se ven geniales" XD, tambien se le ha corregido un error pero lamentablemente aun presenta otro error grave donde se quedan pegadas las teclas.

El nuevo código es este:



<div id="contenedorFlecha">
<div class="botones" id="botonLeft" onmousedown='funcionBoton(37,"pulsar")' onmouseup='funcionBoton(37,"soltar")' onmouseleave='funcionBoton(37,"soltar")'></div>
<div class="botones" id="botonUp" onmousedown='funcionBoton(38,"pulsar")' onmouseup='funcionBoton(38,"soltar")' onmouseleave='funcionBoton(38,"soltar")'></div>
<div class="botones" id="botonRight" onmousedown='funcionBoton(39,"pulsar")' onmouseup='funcionBoton(39,"soltar")' onmouseleave='funcionBoton(39,"soltar")'></div>
<div class="botones" id="botonDown" onmousedown='funcionBoton(40,"pulsar")' onmouseup='funcionBoton(40,"soltar")' onmouseleave='funcionBoton(40,"soltar")'></div>
</div>
<div id="contenedorBotones">
<div class="botones" id="botonA" onmousedown='funcionBoton(65,"pulsar")' onmouseup='funcionBoton(65,"soltar")' onmouseleave='funcionBoton(65,"soltar")'></div>
<div class="botones" id="botonW" onmousedown='funcionBoton(87,"pulsar")' onmouseup='funcionBoton(87,"soltar")' onmouseleave='funcionBoton(87,"soltar")'></div>
<div class="botones" id="botonS" onmousedown='funcionBoton(83,"pulsar")' onmouseup='funcionBoton(83,"soltar")' onmouseleave='funcionBoton(83,"soltar")'></div>
<div class="botones" id="botonD" onmousedown='funcionBoton(68,"pulsar")' onmouseup='funcionBoton(68,"soltar")' onmouseleave='funcionBoton(68,"soltar")'></div>
</div>

<div id="botonEnter" onmousedown='funcionBoton(13,"pulsar")' onmouseup='funcionBoton(13,"soltar")' onmouseleave='funcionBoton(13,"soltar")'></div>
<div id="botonScreen" onmousedown="toggleFullScreen()"></div>
<div id="botonReiniciar" onmousedown='funcionBoton(113,"pulsar")' onmouseup='funcionBoton(113,"soltar")' onmouseleave='funcionBoton(113,"soltar")'></div>


<style>
body{
text-align: center;
background: black;
}

#botonEnter,#botonScreen, #botonReiniciar{
background: brown;
background: transparent;
border: 1px solid red;
color: red;
width: 30px;
height:24px;
position: absolute;
left: 5vw;
}

#botonScreen{
top: 10px;
}

#botonReiniciar{
top: 55px;
}

#botonEnter{
top: 100px;
width: 60px;
}

canvas{
background: transparent;
border: 1px solid white;

width: 40vw;
max-height: 90vh;
position: absolute;
top: 5vh;
left: 30vw;
}

#contenedorFlecha{
background: navy;
background: transparent;
width: 20vw;
height: 35vh;
position: absolute;
bottom: 5vh;
left: 4vw;
}

#contenedorBotones{
background: navy;
background: transparent;
width: 20vw;
height: 35vh;
position: absolute;
bottom: 5vh;
right: 4vw;
}

.botones{
width: 30%;
height: 30%;
position: absolute;
}


#botonUp, #botonW{
background: brown;
background: transparent;
border: 1px solid white;
top: 0px;
left: 35%;
}

#botonLeft, #botonA{
background: green;
background: transparent;
border: 1px solid white;
bottom: 35%;
left: 0%;
}

#botonRight, #botonD{
background: purple;
background: transparent;
border: 1px solid white;
bottom: 35%;
right: 0px;
}

#botonDown, #botonS{
background: blue;
background: transparent;
border: 1px solid white;
bottom: 0%;
left: 35%;
}

@media (orientation: portrait) {

#botonEnter,#botonScreen, #botonReiniciar{
left: 40vw;
}

#botonScreen{
top: 70vh;
left: 5vw;
}

#botonReiniciar{
top: 70vh;
right: 5vw;
left: auto;
}

#botonEnter{
top: 70vh;
left: calc(50vw-30px);
}


canvas{
width: 90vw;
top: 2vh;
left: 5vw;
}

#contenedorBotones{
width: 38vw;
height: 20vh;
}

#contenedorFlecha{
width: 38vw;
height: 20vh;
}

}



#botonRight{
background-image: url("imagenes/botonRight_up.png");
}
#botonRight:active{
background-image: url("imagenes/botonRight_down.png");
}
#botonUp{
background-image: url("imagenes/botonUp_up.png");
}
#botonUp:active{
background-image: url("imagenes/botonUp_down.png");
}
#botonLeft{
background-image: url("imagenes/botonLeft_up.png");
}
#botonLeft:active{
background-image: url("imagenes/botonLeft_down.png");
}
#botonDown{
background-image: url("imagenes/botonDown_up.png");
}
#botonDown:active{
background-image: url("imagenes/botonDown_down.png");
}

#botonA{
background-image: url("imagenes/botonA_up.png");
}
#botonA:active{
background-image: url("imagenes/botonA_down.png");
}
#botonW{
background-image: url("imagenes/botonW_up.png");
}
#botonW:active{
background-image: url("imagenes/botonW_down.png");
}
#botonD{
background-image: url("imagenes/botonD_up.png");
}
#botonD:active{
background-image: url("imagenes/botonD_down.png");
}
#botonS{
background-image: url("imagenes/botonS_up.png");
}
#botonS:active{
background-image: url("imagenes/botonS_down.png");
}



#botonEnter{
background-image: url("imagenes/botonEnter_up.png");
}
#botonEnter:active{
background-image: url("imagenes/botonEnter_down.png");
}

#botonReiniciar{
background-image: url("imagenes/botonReiniciar_up.png");
}
#botonReiniciar:active{
background-image: url("imagenes/botonReiniciar_down.png");
}

#botonScreen{
background-image: url("imagenes/botonScreen_up.png");
}
#botonScreen:active{
background-image: url("imagenes/botonScreen_down.png");
}



#botonRight, #botonLeft, #botonUp, #botonDown, #botonA, #botonW, #botonD, #botonS, #botonEnter, #botonReiniciar, #botonScreen{
border: 0px;
background-size: 100% 100%;
}


</style>



<!-- Código JavaScript-->

<script>

/////////////////Funcion de botones
////////////////SIMULANDO TECLADO
////////////////////////////////////////////////////////////////////////////////
function funcionBoton(codigoBoton, accionBoton){
    //alert(codigoBoton);
var eventObj_izquierda = document.createEventObject ?
    document.createEventObject() : document.createEvent("Events");
eventObj_izquierda.keyCode = codigoBoton;
eventObj_izquierda.which = codigoBoton;
eventObj_izquierda.key=' ';
eventObj_izquierda.code='Space';
if(accionBoton == "pulsar")
{
if(eventObj_izquierda.initEvent){eventObj_izquierda.initEvent("keydown", true, true)}
document.dispatchEvent ? document.dispatchEvent(eventObj_izquierda) : document.fireEvent("onkeydown", eventObj_izquierda);
}
if(accionBoton == "soltar")
{
if(eventObj_izquierda.initEvent){eventObj_izquierda.initEvent("keyup", true, true)}
document.dispatchEvent ? document.dispatchEvent(eventObj_izquierda) : document.fireEvent("onkeyup", eventObj_izquierda);
}
}
//////////////////////////////////////////////////////////////////////////////////


///////////////FUNCION PANTALLA COMPLETA
////////////////////////////////////////////////////////////////////////////////
function toggleFullScreen() {
  if ((document.fullScreenElement && document.fullScreenElement !== null) ||   
    (!document.mozFullScreen && !document.webkitIsFullScreen)) {
    if (document.documentElement.requestFullScreen) {
    document.documentElement.requestFullScreen();
    } else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}}}
/////////////////////////////////////////////////////////////////////////////////


/////////////Funcion para pantallas tactiles
//////////////////////////////////////////////////////////////////////////////////
//Detectando si existe pantalla tactil.
var touchDevice = ('ontouchstart' in document.documentElement);
var botonesId = ["botonLeft","botonUp","botonRight","botonDown","botonA","botonW","botonS","botonD","reiniciar","botonEnter"];
var botonesCodigos = [37,38,39,40,65,87,83,68,113,13];
    var botonId = "";
    var botonCodigo = 0;
    var numeroArray =[];
   
if(touchDevice == true)
{

//Analizando todos los botones contenidos en el array
//Recorriendo el array que contiene los nombres de los botones.

        numeroX=0;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[0],"pulsar");funcionBoton(botonesCodigos[2],"soltar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[0],"soltar");}, false);


        numeroX=1;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[1],"pulsar");funcionBoton(botonesCodigos[3],"soltar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[1],"soltar");}, false);

        numeroX=2;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[2],"pulsar");funcionBoton(botonesCodigos[0],"soltar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[2],"soltar");}, false);

    numeroX=3;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[3],"pulsar");funcionBoton(botonesCodigos[1],"soltar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[3],"soltar");}, false);

    numeroX=4;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[4],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[4],"soltar");}, false);

    numeroX=5;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[5],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[5],"soltar");}, false);


    numeroX=6;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[6],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[6],"soltar");}, false);

    numeroX=7;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[7],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[7],"soltar");}, false);


    numeroX=8;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[8],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[8],"soltar");}, false);

    numeroX=9;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[9],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[9],"soltar");}, false);
}
///////////////////////////////////////////////////////////////////////////////////////



</script>


El proceso para integrar los botones a tu juego "HTML5" es el siguiente:
1.   Crea tu juego html5 empleando las teclas del teclado:
Vk_left (código ascii 37);
Vk_up (código ascii 38);
Vk_rigth (código ascii 39);
Vk_down (código ascii 40);
A (código ascii 65);
W (código ascii 87);
D (código ascii 68);
S (código ascii 83);
Enter (código ascii 13);
F12: para reiniciar el juego. (código ascii 113);

2.   Exporta tu juego html5.
3.   Copia el código para botones táctiles de este post.
4.   Abre con el block de notas el index.html  de tu juego.
5.   Pega el código al final del archivo justo por encima de la etiqueta de cierre </body> como se indica aquí abajo:



6. Descarga el paquete de imágenes de los botones "aquí";
7.Crea una carpeta llamada imágenes la cual debe encontrarse en la misma carpeta de tu juego como se indica en la imagen:


8. En esa carpeta deberás pegar las imágenes que descargastes para que te quede algo como esto:


9. Listo eso es todo.

Si quieres ver cómo quedó el diseño puedes  acceder al juego "30pepas".



Listo eso es todo, seguimos programando, nos vemos luego.


48
Hola, saludos a todos espero que estén bien.


Aquí les traigo una nueva actualización del script que dota a los juegos html5 de botones táctiles permitiendo que los juegos puedan ser jugados desde cualquier plataforma. Ahora la implementación es muy fácil solo tendrán que copiar y pegar.

El código es el siguiente:


<div id="contenedorFlecha">
<div class="botones" id="botonLeft" onmousedown='funcionBoton(37,"pulsar")' onmouseup='funcionBoton(37,"soltar")' onmouseleave='funcionBoton(37,"soltar")'><</div>
<div class="botones" id="botonUp" onmousedown='funcionBoton(38,"pulsar")' onmouseup='funcionBoton(38,"soltar")' onmouseleave='funcionBoton(38,"soltar")'>^</div>
<div class="botones" id="botonRight" onmousedown='funcionBoton(39,"pulsar")' onmouseup='funcionBoton(39,"soltar")' onmouseleave='funcionBoton(39,"soltar")'>></div>
<div class="botones" id="botonDown" onmousedown='funcionBoton(40,"pulsar")' onmouseup='funcionBoton(40,"soltar")' onmouseleave='funcionBoton(40,"soltar")'>\/</div>
</div>
<div id="contenedorBotones">
<div class="botones" id="botonA" onmousedown='funcionBoton(65,"pulsar")' onmouseup='funcionBoton(65,"soltar")' onmouseleave='funcionBoton(65,"soltar")'>A</div>
<div class="botones" id="botonW" onmousedown='funcionBoton(87,"pulsar")' onmouseup='funcionBoton(87,"soltar")' onmouseleave='funcionBoton(87,"soltar")'>W</div>
<div class="botones" id="botonS" onmousedown='funcionBoton(83,"pulsar")' onmouseup='funcionBoton(83,"soltar")' onmouseleave='funcionBoton(83,"soltar")'>S</div>
<div class="botones" id="botonD" onmousedown='funcionBoton(68,"pulsar")' onmouseup='funcionBoton(68,"soltar")' onmouseleave='funcionBoton(68,"soltar")'>D</div>
</div>


<div id="botonEnter" onmousedown='funcionBoton(13,"pulsar")' onmouseup='funcionBoton(13,"soltar")' onmouseleave='funcionBoton(13,"soltar")'>Enter</div>
<div id="screen" onmousedown="toggleFullScreen()">Screen</div>
<div id="reiniciar" onmousedown='funcionBoton(113,"pulsar")' onmouseup='funcionBoton(113,"soltar")' onmouseleave='funcionBoton(113,"soltar")'>Restart</div>


<style>
body{
text-align: center;
background: black;
}

#botonEnter,#screen, #reiniciar{
background: brown;
background: transparent;
border: 1px solid red;
color: red;
width: 60px;
height:24px;
position: absolute;
left: 5vw;
}

#screen{
top: 10px;
}

#reiniciar{
top: 55px;
}

#botonEnter{
top: 100px;
}

canvas{
background: transparent;
border: 1px solid white;

width: 40vw;
max-height: 90vh;
position: absolute;
top: 5vh;
left: 30vw;
}

#contenedorFlecha{
background: navy;
background: transparent;
width: 20vw;
height: 35vh;
position: absolute;
bottom: 5vh;
left: 4vw;
}

#contenedorBotones{
background: navy;
background: transparent;
width: 20vw;
height: 35vh;
position: absolute;
bottom: 5vh;
right: 4vw;
}

.botones{
width: 30%;
height: 30%;
position: absolute;
}

#botonUp, #botonW{
background: brown;
background: transparent;
border: 1px solid white;
top: 0px;
left: 35%;
}

#botonLeft, #botonA{
background: green;
background: transparent;
border: 1px solid white;
bottom: 35%;
left: 0%;
}

#botonRight, #botonD{
background: purple;
background: transparent;
border: 1px solid white;
bottom: 35%;
right: 0px;
}

#botonDown, #botonS{
background: blue;
background: transparent;
border: 1px solid white;
bottom: 0%;
left: 35%;
}

@media (orientation: portrait) {

#botonEnter,#screen, #reiniciar{
left: 40vw;
}

#screen{
top: 70vh;
left: 5vw;
}

#reiniciar{
top: 70vh;
right: 5vw;
left: auto;
}

#botonEnter{
top: 70vh;
left: calc(50vw-30px);
}


canvas{
width: 90vw;
top: 2vh;
left: 5vw;
}

#contenedorBotones{
width: 38vw;
height: 20vh;
}

#contenedorFlecha{
width: 38vw;
height: 20vh;
}

}


</style>



<!-- Código JavaScript-->

<script>

/////////////////Funcion de botones
////////////////SIMULANDO TECLADO
////////////////////////////////////////////////////////////////////////////////
function funcionBoton(codigoBoton, accionBoton){
    //alert(codigoBoton);
var eventObj_izquierda = document.createEventObject ?
    document.createEventObject() : document.createEvent("Events");
eventObj_izquierda.keyCode = codigoBoton;
eventObj_izquierda.which = codigoBoton;
eventObj_izquierda.key=' ';
eventObj_izquierda.code='Space';
if(accionBoton == "pulsar")
{
if(eventObj_izquierda.initEvent){eventObj_izquierda.initEvent("keydown", true, true)}
document.dispatchEvent ? document.dispatchEvent(eventObj_izquierda) : document.fireEvent("onkeydown", eventObj_izquierda);
}
if(accionBoton == "soltar")
{
if(eventObj_izquierda.initEvent){eventObj_izquierda.initEvent("keyup", true, true)}
document.dispatchEvent ? document.dispatchEvent(eventObj_izquierda) : document.fireEvent("onkeyup", eventObj_izquierda);
}
}
//////////////////////////////////////////////////////////////////////////////////


///////////////FUNCION PANTALLA COMPLETA
////////////////////////////////////////////////////////////////////////////////
function toggleFullScreen() {
  if ((document.fullScreenElement && document.fullScreenElement !== null) ||   
    (!document.mozFullScreen && !document.webkitIsFullScreen)) {
    if (document.documentElement.requestFullScreen) { 
    document.documentElement.requestFullScreen(); 
    } else if (document.documentElement.mozRequestFullScreen) { 
document.documentElement.mozRequestFullScreen(); 
} else if (document.documentElement.webkitRequestFullScreen) { 
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); 

} else { 
if (document.cancelFullScreen) { 
document.cancelFullScreen(); 
} else if (document.mozCancelFullScreen) { 
document.mozCancelFullScreen(); 
} else if (document.webkitCancelFullScreen) { 
document.webkitCancelFullScreen(); 
}}}
/////////////////////////////////////////////////////////////////////////////////


/////////////Funcion para pantallas tactiles
//////////////////////////////////////////////////////////////////////////////////
//Detectando si existe pantalla tactil.
var touchDevice = ('ontouchstart' in document.documentElement);
var botonesId = ["botonLeft","botonUp","botonRight","botonDown","botonA","botonW","botonS","botonD","reiniciar","botonEnter"];
var botonesCodigos = [37,38,39,40,65,87,83,68,113,13];
    var botonId = "";
    var botonCodigo = 0;
    var numeroArray =[];
   
if(touchDevice == true)
{

//Analizando todos los botones contenidos en el array
//Recorriendo el array que contiene los nombres de los botones.

        numeroX=0;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[0],"pulsar");funcionBoton(botonesCodigos[2],"soltar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[0],"soltar");}, false);


        numeroX=1;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[1],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[1],"soltar");}, false);

        numeroX=2;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[2],"pulsar");funcionBoton(botonesCodigos[0],"soltar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[2],"soltar");}, false);

    numeroX=3;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[3],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[3],"soltar");}, false);

    numeroX=4;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[4],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[4],"soltar");}, false);

    numeroX=5;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[5],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[5],"soltar");}, false);


    numeroX=6;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[6],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[6],"soltar");}, false);

    numeroX=7;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[7],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[7],"soltar");}, false);


    numeroX=8;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[8],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[8],"soltar");}, false);

    numeroX=9;
botonId = botonesId[numeroX];
var elementoTouch= document.getElementById(botonId);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
funcionBoton(botonesCodigos[9],"pulsar");}}, false);
elementoTouch.addEventListener('touchend', function(event){
funcionBoton(botonesCodigos[9],"soltar");}, false);
}
///////////////////////////////////////////////////////////////////////////////////////



</script>




Este es un código que combina html, css y javascript y para implementarlo en sus juegos html5 tendrán que seguir estos sencillos pasos:

1.   Crea tu juego html5 empleando las siguientes teclas del teclado:
Vk_left (código ascii 37);
Vk_up (código ascii 38);
Vk_rigth (código ascii 39);
Vk_down (código ascii 40);
A (código ascii 65);
W (código ascii 87);
D (código ascii 68);
S (código ascii 83);
Enter (código ascii 13);
F12: para reiniciar el juego. (código ascii 113);

2.   Exporta tu juego html5.
3.   Copia el código para botones táctiles de este post.
4.   Abre con el block de notas el index.html  de tu juego.
5.   Pega el código al final del archivo justo por encima de la etiqueta de cierre </body> como se indica aquí abajo:

6.   Listo.


Dudas y preguntas aquí.
Pueden ver este código funcionando  en el juego "30pepas" publicado recientemente.

Tengo planeado mejorar el código y darle una mejor apariencia a los botones, ya le he encontrado varios errores pero si Dios quiere pronto serán corregidos.
49
Juegos completos / 30pepas 😅
Enero 04, 2022, 08:16:10 AM
50
Hola, saludos.



Quizás hiciste algo como esto:

draw_text(x,y,"Soy el objeto x");


Lo adecuado es introducir el texto dentro de una variable y usar esa variable como el siguiente código:

variableTexto="soy el objeto x";
draw_text(x,y,variableTexto);


En el evento creación (CREATE) también deberás colocar:
variableTexto="soy el objeto x";

Ahora mencionas a un objeto que capturará el texto que contenga la instancia luego de colisionar con ella.

Para resolver eso debemos identificar a los objetos que intervienen en el proceso:

objetoTexto: objeto que contiene el texto, el cual tiene varias instancias.
objetoCapturador: objeto que capturará el texto de alguna instancia del objetoTexto.
Tambien debemos identificar las variables que intervendrán en el proceso:
variableTexto: es la variable del objetoTexto que contiene el texto del objeto la cual varía en cada instancia.
variableCaptura: es la variable del objetoCapturador la cual almacenará el texto que contenga la instancia con la cual colisione.
Entonces el proceso es el siguiente:
1.   El objetoCapturador colisiona con una instancia del objetoTexto.
2.   El objetoCapturador identifica a la instancia.
3.   El objetoCapturador toma el texto almacenado en la variableTexto del objetoTexto.
4.   El objetoCapturador almacena el texto capturado en su propia variableCaptura.

Códigos necesarios para el objetoCapturador:
   "OBJETOCAPTURADOR."
1.   El objetoCapturador colisiona con una instancia del objetoTexto.
Supongo que estás usando un evento de colision o quizás estas usando place_empty o place_free o place_meeting, u otra técnica para interpretar una colision.

2.   El objetoCapturador identifica a la instancia:
En el evento de colisión deberás colocar:

nnn=instance_nearest(x,y,objectTexto);
variableCaptura = nnn.variableTexto;


   Listo, el objeto capturador tiene en su variableCaptura el valor de la variableTexto de la instancia con la cual ha colisionado.

¿Cómo funciona?
1.   La función instance nearest devuelve o retorna el id o identificador único de la instancia más cercana al punto indicado, en este cado los puntos son x,y los cuales hacen referencia a la posición del objetoCapturador.
2.   ¿Cómo es eso que devuelve? , Respuesta: Eso quiere decir que nos dará el nombre único de la instancia.
3.   ¿Qué es el nombre único? , Respuesta: Es el id, o el identificador único que tiene cada instancia, es su nombre.
4.   ¿Para qué quiero el identificador único? , Respuesta: Con el identificador único podemos acceder a cualquier variable interna de la instancia.
5.   ¿Cómo obtenemos una variable interna de la instancia? ,Respuesta:
a.   Primero almacenamos su identificador único en una variable, en este caso la llamaremos nnn.

nnn=instance_nearest(x,y,objetoTexto);

Esto quiere decir que ahora la variable nnn contiene el nombre único de la intancia.

b.   Luego le colocamos un punto seguido de la variable para acceder a cualquier otra variable interna de la instancia.

nnn.x
nnn.y
nnn.sprite_index
nnn.speed
nnn.hspeed
nnn.image_index

c.   Luego almacenamos en una variable el valor de la variable a obtener:

variableCapturadora = nnn.variableTexto;

51
Preguntas y respuestas / Re: Controles
Enero 01, 2022, 04:49:48 AM
Hola, saludos Elvis espero que estés bien.



Esa pregunta puede tener múltiples soluciones y trataré de darte lo que tengo hasta ahora.

1.   Si te refieres a colocar un botón y ejecutar una función de una tecla.
Respuesta:
*Crea un objeto botón y en el evento mouse enter le colocas keyboard_check(tecla).




       2. Si te refieres a botones para pantallas táctiles.

   Respuesta: Tienes que emplear el draw gui, los siguientes tutoriales me ayudaron a comprender eso:
https://www.youtube.com/watch?v=j2L9tWaTA7k&t=21s
https://www.youtube.com/watch?v=ZcIk17YA3Ig&t=96s





3.   Si te refieres a los temas que voy desarrollando sobre joystick táctiles para juegos html5. El tema está dividido en dos métodos, el primero emplea un molesto y complejo sistema de escalas el cual no se lo aconsejo a nadie XD, y el segundo emplea javascript y es más eficiente, adecuado y fácil de entender.

Aquí te dejo el post.
https://www.comunidadgm.org/general/joystick-tactiles-para-juegos-html5-en-proceso/

   Si te refieres a este último lo recomendable es exportar a html5 y editar el index.html resultante, de la siguiente manera.
1.   Crear un botón dentro de código html como este:

<button id="boton_izquierda" onmousedown="pulsar_boton(37)" onmouseup="soltar_boton(37)" onmouseout="soltar_boton(37)">L</button>


2.   Luego deberás agregarle un código javascript como este:


//Boton izquierda
nombre_boton="boton_izquierda";
var elementoTouch= document.getElementById(nombre_boton);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
pulsar_boton(37);}}, false);
elementoTouch.addEventListener('touchend', function(event){
soltar_boton(37);
}, false);



3.   Y luego finalizas con el simulador de tecla presionada:



//Simulando el teclado
var variable_1 = document.getElementById("variable_1");
function pulsar_boton(key){
var eventObj = document.createEventObject ?
    document.createEventObject() : document.createEvent("Events");
eventObj.keyCode = key;
eventObj.which = key;
eventObj.key=' ';
eventObj.code='Space';
if(eventObj.initEvent){eventObj.initEvent("keydown", true, true)}
document.dispatchEvent ? document.dispatchEvent(eventObj) : document.fireEvent("onkeydown", eventObj);}

function soltar_boton(key){
var eventObj = document.createEventObject ?
    document.createEventObject() : document.createEvent("Events");
eventObj.keyCode = key;
eventObj.which = key;
eventObj.key=' ';
eventObj.code='Space';
if(eventObj.initEvent){eventObj.initEvent("keyup", true, true)}
document.dispatchEvent ? document.dispatchEvent(eventObj) : document.fireEvent("onkeyup", eventObj);}




Lamentablemente no he realizado un manual explicativo para comprender a fondo los códigos. Por ahora sólo recomiendo estudiar lo básico de html, css y javascript.
52
General / fastGame
Diciembre 26, 2021, 02:05:02 AM
Hola saludos cordiales.



Aquí les dejo un video donde se presenta la primera etapa de mi nueva idea para hacer video juegos.


https://youtu.be/NXL_HwBLQ1U


Por ahora mi objetivo es enseñar a hacer video juegos sencillos con materiales reciclados aplicando una técnica fácil.
1.   Primero se hace la maqueta real.
2.   Luego se grava el video.
3.   Se le agregan los efectos de sonido.
4.   Por último se sube a una plataforma online que estoy construyendo la cual no está terminada.
5.   Finalmente se obtiene un video juego muy básico.






Aquí les dejo un bosquejo de un juego que tengo en mente.
https://www.youtube.com/watch?v=vZkJlTH2pvk

chao, nos vemos.
53
General / GAME CGM
Diciembre 11, 2021, 01:53:33 AM



Este juego lo cree gracias al canal Jeff Aporta de youtube, el cual ofrece el siguiente tutorial:
https://youtu.be/n8ujo9spBR4
54
Hola, saludos a todos.



Aquí les traigo un html5 donde se logró implementar los botones de javascript, pueden verificar su funcionamiento en pc y móviles.



html5+game_maker+Javascript
El objetivo del proyecto es crear un joystick virtual para pantallas táctiles que funcione en navegadores, de esta forma se podrán crear juegos html5 con botones que funcionen en todos los dispositivos.

Aquí les dejo el index.html del proyecto exportado con game maker a html5.

<!DOCTYPE html>
<html lang="es">
    <head>
        <!-- Generated by GameMaker:HTML5 http://http://www.yoyogames.com/gamemaker/html5 -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge" >
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name ="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
        <meta charset="utf-8"/>

        <!-- Set the title bar of the page -->
        <title>Game Maker HTML 5</title>

        <!-- Set the background colour of the document -->
        <style>
            body {
              background: #222;
              color:#cccccc;
            }

#container{
width: 90vw;
height: 90vh;
//background: blue;
margin: 0 auto;
text-align: center;

}


            canvas {
                      image-rendering: optimizeSpeed;
                      -webkit-interpolation-mode: nearest-neighbor;
height: 75%;
width: auto;
            }
@media screen and (orientation: portrait) {canvas{width: 95%;height: auto;}}

button{
background: gray;
font-size: 24px;
}

.clead_fix{
clear: both;
}

#boton_reiniciar{
background: green;
margin-left:0px;
}
        </style>
    </head>

    <body>
            <!-- Create the canvas element the game draws to -->
<div id="container">
    <button id="boton_reiniciar" onmousedown="pulsar_boton(113)" onmouseup="soltar_boton(113)" onmouseout="soltar_boton(113)">Reiniciar</button>
<button id="boton_pantalla" onmousedown="toggleFullScreen()">Pantalla completa</button>
<br/>
            <canvas id="canvas" width="256" height="256">
               <p>Your browser doesn't support HTML5 canvas.</p>
            </canvas>
<br/>
<button id="boton_arriba" onmousedown="pulsar_boton(38)" onmouseup="soltar_boton(38)" onmouseout="soltar_boton(38)">U</button> 
<br/>
<button id="boton_izquierda" onmousedown="pulsar_boton(37)" onmouseup="soltar_boton(37)" onmouseout="soltar_boton(37)">L</button> 
<button id="boton_derecha" onmousedown="pulsar_boton(39)" onmouseup="soltar_boton(39)" onmouseout="soltar_boton(39)">R</button>
<br/>
<br/>

<!--<h1 id="variable_1">variable_1: </h1>-->
</div>

        <!-- Run the game code -->
        <script type="text/javascript" src="html5game/html5_botones.js?RDPAC=1661301485"></script>

<script>
var variable_1 = document.getElementById("variable_1");
var nombre_boton ="";
var numero_boton =0;


//////////FUNCION PANTALLA COMPLETA
function toggleFullScreen() {
  if ((document.fullScreenElement && document.fullScreenElement !== null) ||   
   (!document.mozFullScreen && !document.webkitIsFullScreen)) {
    if (document.documentElement.requestFullScreen) { 
      document.documentElement.requestFullScreen(); 
    } else if (document.documentElement.mozRequestFullScreen) { 
      document.documentElement.mozRequestFullScreen(); 
    } else if (document.documentElement.webkitRequestFullScreen) { 
      document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); 
    } 
  } else { 
    if (document.cancelFullScreen) { 
      document.cancelFullScreen(); 
    } else if (document.mozCancelFullScreen) { 
      document.mozCancelFullScreen(); 
    } else if (document.webkitCancelFullScreen) { 
      document.webkitCancelFullScreen(); 
    } 
  } 
}


//Detectando si existe pantalla tactil.
var touchDevice = ('ontouchstart' in document.documentElement);

//Boton arriba
nombre_boton="boton_arriba";
var elementoTouch= document.getElementById(nombre_boton);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
pulsar_boton(38);}}, false);
elementoTouch.addEventListener('touchend', function(event){
soltar_boton(38);
}, false);

//Boton izquierda
nombre_boton="boton_izquierda";
var elementoTouch= document.getElementById(nombre_boton);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
pulsar_boton(37);}}, false);
elementoTouch.addEventListener('touchend', function(event){
soltar_boton(37);
}, false);

//Boton derecha
nombre_boton="boton_derecha";
var elementoTouch= document.getElementById(nombre_boton);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
pulsar_boton(39);}}, false);
elementoTouch.addEventListener('touchend', function(event){
soltar_boton(39);
}, false);

//Boton reiniciar
nombre_boton="boton_reiniciar";
var elementoTouch= document.getElementById(nombre_boton);
elementoTouch.addEventListener('touchstart', function(event){
//Comprobamos si hay varios eventos del mismo tipo
if (event.targetTouches.length == 1) {
var touch = event.targetTouches[0];
// con esto solo se procesa UN evento touch
pulsar_boton(113);}}, false);
elementoTouch.addEventListener('touchend', function(event){
soltar_boton(113);
}, false);


//Simulando el teclado
var variable_1 = document.getElementById("variable_1");
function pulsar_boton(key){
var eventObj = document.createEventObject ?
    document.createEventObject() : document.createEvent("Events");
eventObj.keyCode = key;
eventObj.which = key;
eventObj.key=' ';
eventObj.code='Space';
if(eventObj.initEvent){eventObj.initEvent("keydown", true, true)}
document.dispatchEvent ? document.dispatchEvent(eventObj) : document.fireEvent("onkeydown", eventObj);}

function soltar_boton(key){
var eventObj = document.createEventObject ?
    document.createEventObject() : document.createEvent("Events");
eventObj.keyCode = key;
eventObj.which = key;
eventObj.key=' ';
eventObj.code='Space';
if(eventObj.initEvent){eventObj.initEvent("keyup", true, true)}
document.dispatchEvent ? document.dispatchEvent(eventObj) : document.fireEvent("onkeyup", eventObj);}



</script>

    </body>
</html>




En este código podremos ver algunos códigos claves:
1.   El código html para visualizar los botones.
2.   El código que verifica si estamos usando pantalla táctil.
3.   Los códigos para eventos de pantalla táctil.
4.   El conjunto de códigos que simula la presión de una tecla del teclado (este es el más importante.).

Conclusiones:
La simulación de teclas es efectiva, los botones de javascript puden simular que una tecla ha sido presionada y esto a su vez es reconocido por game maker correctamente.

Bueno eso es todo por ahora seguimos programando.

55
General / Crash Orient Express
Diciembre 04, 2021, 04:12:08 AM
56
General / Historias: la estrella horrible
Diciembre 02, 2021, 02:00:14 AM
57
General / Historias
Noviembre 22, 2021, 03:17:23 AM
58
Desarrollo de Scripts / draw_text_ext_html5(x,y,str,w);
Noviembre 05, 2021, 03:36:22 AM
Autor del script: Reyes Dávila
Nombre del script: draw_text_ext_html5(x,y,str,w);
Breve descripción de su función: Ajusta un texto al ancho indicado al exportar a html5.
Versiones usadas: Game maker html5, debe funcionar en studio.
Version del script: 1

Código del script

//draw_text_ext_html5(x,y,str,w);
//Para crear textos ajustados a un ancho al exportar a html5.
//Serial del script: _WXP2F

posicion_x_WXP2F=argument0;
posicion_y_WXP2F=argument1;
string_x_WXP2F=argument2;
ancho_x_WXP2F=argument3;

length_x_WXP2F=string_length(string_x_WXP2F);
length_x_prev_WXP2F=length_x_WXP2F;
index_WXP2F=1;
count_WXP2F=1;
width_min_WXP2F=string_width("X");
for(i_WXP2F=1;i_WXP2F<=length_x_WXP2F;i_WXP2F+=1)
{

copy_x_WXP2F=string_copy(string_x_WXP2F,index_WXP2F,count_WXP2F);
width_x_WXP2F=string_width(copy_x_WXP2F);

count_x_WXP2F=string_count(" ",copy_x_WXP2F);
c1_WXP2F=(width_x_WXP2F>ancho_x_WXP2F);
c2_WXP2F=(ancho_x_WXP2F>width_min_WXP2F);
c3_WXP2F=(i_WXP2F>1);
c4_WXP2F=(length_x_WXP2F<length_x_prev_WXP2F*2);
c5_WXP2F=(count_x_WXP2F);

if(c1_WXP2F and c2_WXP2F and c3_WXP2F and c4_WXP2F and c5_WXP2F)
{

index_WXP2F=i_WXP2F;count_WXP2F=1;
copy_x2_WXP2F=string_copy(string_x_WXP2F,index_WXP2F,count_WXP2F);
while(copy_x2_WXP2F!=" " and i_WXP2F>2)
    {
        i_WXP2F-=1;
        index_WXP2F=i_WXP2F;count_WXP2F=1;
        copy_x2_WXP2F=string_copy(string_x_WXP2F,index_WXP2F,count_WXP2F);
    }

string_x_WXP2F=string_insert(chr(35),string_x_WXP2F,i_WXP2F+1);
length_x_WXP2F+=1;
index_WXP2F=i_WXP2F+3;
count_WXP2F=0;
}

count_WXP2F+=1;
}

draw_text(posicion_x_WXP2F,posicion_y_WXP2F,string_x_WXP2F);


Detalles:
La función original draw_text_ext(x,y,str,sep,w) no funciona al exportar a html5 por esta causa se ha creado este script como sustituto, el cual en su primera versión no emplea el argumento "sep" que hace referencia a la separación de las líneas.

Mejoras a futuro:
1. Agregar el argumento sep.
2. Correcciones internas.
3. Mejorar precisión.
4. Crear conjunto de script para el control de textos que permita medir el alto de los párrafos con gran precisión al exportar en html5.
59
General / Re: Concepción de juego
Octubre 26, 2021, 07:10:25 PM







60
Desarrollo de Scripts / ini_file(str)
Octubre 06, 2021, 08:49:03 PM
Autor del script: Reyes Dávila
Nombre del script: ini_file(str)
Breve descripción de su función: Habilita a game maker 4.3 para trabajar con archivos ini de igual manera como en las versiones superiores.
Versiones usadas: Solo para game maker 4.3.
Version del script: 1

Código del script


///ini_file(str);
//Script para game maker 4.3, para abrir archivos ini.
//Serial del script: 123

str_in_123=argument0;
str_length_123=string_length(str_in_123);

//Escaneando string
funcion_encontrada_123=0;

str_pos_123=string_pos("(",str_in_123);//Posicion del primer paréntesis
for(i=str_pos_123;i<=str_length_123;i+=1)
{
str_copy_123=string_copy(str_in_123,i,1);
if(str_copy_123="(")
{
//Copiando nombre de funcion
funcion_str_123="";
continuar_123=1;
str_copy_123="";
for(i2=i-1;i2>=1 and continuar_123;i2-=1)
{
str_copy_2_123=string_copy(str_in_123,i2,1);
if(ord(str_copy_2_123)<=65 || ord(str_copy_2_123)>=122)
{
//Deteniendo el proceso.
continuar_123=0
}
else
{
//Copiando caracter.
funcion_str_123=string(str_copy_2_123)+string(funcion_str_123);
}
}

//Funcion encontrada
funciones_posibles='ini_close(,ini_key_delete(,ini_key_exists(,ini_open(,
ini_open_from_string(,ini_read_real(,ini_read_string(,ini_section_delete(,ini_section_exists(,ini_write_real(,ini_write_string(,';
str_count_123=string_count(funcion_str_123+string("("),funciones_posibles);
if(str_count_123=1)
{
funcion_encontrada_123+=1;
funcion_123[funcion_encontrada_123,0]=funcion_str_123;

//Verificando que la primera funcion sea ini_open(str);
c1_123=(funcion_123[1,0]="ini_open");
c2_123=(funcion_123[1,0]="ini_open_from_string");
//if(!c1_123 and !c2_123){show_message("Falta funcion: ini_open(name) o ini_open_from_string(string)")}
}

/////////////////Copiando argumentos de la funcion
index_123=i;
//length_123=string_length(str_in_123)-index_123+1;
length_123=string_length(str_in_123);

continuar_123=1;
count_comillas_123=0;
count_comillas2_123=0;
pos_parentesis_cierre=1;

//Encontrando el parentesis correcto de cierre de la función.
for(i2=index_123;i2<length_123 and continuar_123;i2+=1)
{
//Esto se hace para no tomar en cuenta los parentesis
//Que se encuentren dentro de comillas.
index_123=i2;count_123=1;
str_ram2_123=string_copy(str_in_123,index_123,count_123);
if(str_ram2_123="'"){count_comillas_123+=1}
if(str_ram2_123='"'){count_comillas2_123+=1}
c1_123=(frac(count_comillas_123/2)=0);
c2_123=(frac(count_comillas2_123/2)=0);
c3_123=(str_ram2_123=")");
if(c1_123 and c2_123 and c3_123)
{
pos_parentesis_cierre=i2;
continuar_123=0;
}
}

index_123=i+1;
count_123=pos_parentesis_cierre-index_123;
str_ram_123=string_copy(str_in_123,index_123,count_123);

//Describiendo a los argumentos
count_123=string_count(",",str_ram_123);
count2_123=string_count(".",str_ram_123);
length_123=string_length(str_ram_123);
str_inicial_123=string_copy(str_ram_123,1,1);
str_final_123=string_copy(str_ram_123,length_123,1);

//Condiciones para las funciones
if(funcion_123[funcion_encontrada_123,0]="ini_close"){argumentos_123=0;devolucion_123="none"}
if(funcion_123[funcion_encontrada_123,0]="ini_key_delete"){argumentos_123=2;devolucion_123="none"}
if(funcion_123[funcion_encontrada_123,0]="ini_key_exists"){argumentos_123=2;devolucion_123="binario"}
if(funcion_123[funcion_encontrada_123,0]="ini_open"){argumentos_123=1;devolucion_123="none"}
if(funcion_123[funcion_encontrada_123,0]="ini_open_from_string"){argumentos_123=1;devolucion_123="none"}
if(funcion_123[funcion_encontrada_123,0]="ini_read_real"){argumentos_123=3;devolucion_123="real"}
if(funcion_123[funcion_encontrada_123,0]="ini_read_string"){argumentos_123=3;devolucion_123="string"}
if(funcion_123[funcion_encontrada_123,0]="ini_section_delete"){argumentos_123=1;devolucion_123="none"}
if(funcion_123[funcion_encontrada_123,0]="ini_section_exists"){argumentos_123=1;devolucion_123="binario"}
if(funcion_123[funcion_encontrada_123,0]="ini_write_real"){argumentos_123=3;devolucion_123="none"}
if(funcion_123[funcion_encontrada_123,0]="ini_write_string"){argumentos_123=3;devolucion_123="none"}


//Asignando cantidad de argumento a funciones.

funcion_123[funcion_encontrada_123,1]=argumentos_123;
//Asignando tipo de respuesta, salida o return.
funcion_123[funcion_encontrada_123,2]=devolucion_123;

//Para las funciones con un argumento
if(argumentos_123=1)
{
//Asignando argumento a la posicion correcta
funcion_123[funcion_encontrada_123,3]=str_ram_123;
}

//Para las funciones con más de un argumento.
analizando_argumento_123=3;
if(argumentos_123>1)
{
for(i3=1;i3<=argumentos_123;i3+=1)
{
//Extrayendo argumentos.
continuar_123=1;
count_comillas_123=0;
count_comillas2_123=0;
length_123=string_length(str_ram_123);

if(i3<argumentos_123)
{
for(i2=1;i2<=length_123 and continuar_123;i2+=1)
{
index_123=i2;count_123=1;
str_ram2_123=string_copy(str_ram_123,index_123,count_123);
if(str_ram2_123="'"){count_comillas_123+=1}
if(str_ram2_123='"'){count_comillas2_123+=1}
c1_123=(frac(count_comillas_123/2)=0);
c2_123=(frac(count_comillas2_123/2)=0);
c3_123=(str_ram2_123=",");

if(c1_123 and c2_123 and c3_123)
{
continuar_123=0;
index_123=1;count_123=i2-1;
funcion_123[funcion_encontrada_123,analizando_argumento_123]=string_copy(str_ram_123,index_123,count_123);

index_123=count_123+2;count_123=string_length(str_ram_123)-index_123+1;
str_ram_123=string_copy(str_ram_123,index_123,count_123);
analizando_argumento_123+=1;
}
}

}//if(i3<argumentos_123)
else
{
//Asignando argumento y borrando comillas
funcion_123[funcion_encontrada_123,analizando_argumento_123]=str_ram_123;
}
}
}

////////////////////////////////Buscando variable de salida.
if(funcion_123[funcion_encontrada_123,2]!="none")
{
posicion_variable_123=funcion_123[funcion_encontrada_123,1]+3;
funcion_123[funcion_encontrada_123,1]+=1;
iniciar_copia_123=0;
igualdad_encontrada_123=0;

//Asignando variable de salida.
str_capture_123="";
continuar_123=1;
for(i2=i;i2>1 and continuar_123;i2-=1)
{
str_ram2_123=string_copy(str_in_123,i2,1);

//Iniciar copia
c1=(str_ram2_123=chr(ord("=")));
c2=(str_ram2_123!=chr(ord("=")));//Para iniciar copia;
c3=(ord(str_ram2_123)=59 || ord(str_ram2_123)=41 || ord(str_ram2_123)=13 || ord(str_ram2_123)=10);//Finalizar copia;

if(c1){igualdad_encontrada_123=1}
if(igualdad_encontrada_123 and c2){iniciar_copia_123=1}

//Finalizando copia
if(c3)
{
//Finalizando copia
continuar_123=0;
iniciar_copia_123=0;
igualdad_encontrada_123=0;
}

if(iniciar_copia_123)
{
//Copiando
str_capture_123=string(str_ram2_123)+string(str_capture_123);
}
}


///Integrando al array el nombre de la variable de salida
funcion_123[funcion_encontrada_123,posicion_variable_123]=str_capture_123;
}


//////////////////////////FIN Buscando variable de salida.

//Posicionando al final de la funcion, despues del parentesis
index_123=i+string_length(str_ram_123)+2;
count_123=string_length(str_in_123)-index_123+1;
str_in_123=string_copy(str_in_123,index_123,count_123);
str_length_123=string_length(str_in_123);
i=1;

}//Fin if(str_copy_123="(")
}

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////Analizando archivo ini

//Analizando funcion por funcion
archivo_ini_123="";

for(i=1;i<=funcion_encontrada_123;i=i+1)
{
//Funciones para leer archivo ini
if(funcion_123[i,0]="ini_open" || funcion_123[i,0]="ini_open_from_string")
{
///Leyendo archivo ini desde file
if(funcion_123[i,0]="ini_open")
{
//Verificando argumento
c1=string_count("'",funcion_123[i,3]);
c2=string_count('"',funcion_123[i,3]);

if(c1 || c2)
{
//Para abrir archivo desde string con comillas
abrir_archivo_123=string_replace_all(funcion_123[i,3],"'","");
abrir_archivo_123=string_replace_all(abrir_archivo_123,'"',"");
file_open_read(abrir_archivo_123);
ubicacion_archivo_ini_123=abrir_archivo_123;
}
else
{
//Para abrir archivo desde variable
str_xx_123="file_open_read([x])";
str_xx_123=string_replace(str_xx_123,"[x]",funcion_123[i,3]);
execute_string(str_xx_123);

str_xx_123="ubicacion_archivo_ini_123=[x]";
str_xx_123=string_replace(str_xx_123,"[x]",funcion_123[i,3]);
execute_string(str_xx_123);
}

while(!file_eof())
{
archivo_ini_123=archivo_ini_123+file_read_string()+chr(13)+chr(10);
file_readln();
}
file_close();
}

//Leyendo string ini
if(funcion_123[i,0]="ini_open_from_string")
{
archivo_ini_123=funcion_123[i,3];
ubicacion_archivo_ini_123="string";
}

//Corrigiendo final de string ini
index=string_length(archivo_ini_123);
count=1;
x1=string_copy(archivo_ini_123,index,count);
while(x1=chr(13) || x1=chr(10))
{
str=archivo_ini_123;
index=1;
count=string_length(archivo_ini_123)-1;
archivo_ini_123=string_copy(str,index,count);
index=string_length(archivo_ini_123);
count=1;
x1=string_copy(str,index,count);
}
archivo_ini_123+=chr(13)+chr(10);

/////////////////////////////////////////////////////////////
//Archivo ini para ini_key_delelete, ini_section_delete,
//ini_real_write, ini_string_write.
//archivo_ini_real_123.
//Separando linea por linea
archivo_ini_real_123=archivo_ini_123;
count_lineas_123=string_count(chr(13)+chr(10),archivo_ini_real_123);
for(i4=0;i4<count_lineas_123;i4=i4+1)
{
pos_x_123=string_pos(chr(13)+chr(10),archivo_ini_real_123);
index=1;
count=pos_x_123-1;
linea_ini[i4]=string_copy(archivo_ini_real_123,index,count);
index=count+3;
count=string_length(archivo_ini_real_123)-index+1;
archivo_ini_real_123=string_copy(archivo_ini_real_123,index,count);

//Quitando espacios en blanco del inicio
str=linea_ini[i4];//Entrada
index=1;count=1;
str_ram_x=string_copy(str,index,count);
while(str_ram_x=chr(10) || str_ram_x=chr(13) || str_ram_x=chr(32))
{
index=2;
count=string_length(str)-1;
str=string_copy(str,index,count);
index=1;count=1;
str_ram_x=string_copy(str,index,count);
}
linea_ini[i4]=str;//Salida
}
lineas_ini_123=i4;
///////////////////////////////////////////////////////////

//Corrigiendo saltos de linea
str=archivo_ini_123;
substr=chr(13)+chr(10)+chr(13)+chr(10);
while(string_count(substr,str))
{
newstr=chr(13)+chr(10);
archivo_ini_123=string_replace_all(str,substr,newstr);
str=archivo_ini_123;
}

//Analizando archivo ini.
secciones_123=string_count("[",archivo_ini_123);//Cantidad de secciones
i2=1;

for(i2=1;i2<=secciones_123;i2=i2+1)
{
//Obteniendo nombre de funcion
pos_123=string_pos("[",archivo_ini_123);//Buscando corchete de apertura.
pos2_123=string_pos("]",archivo_ini_123);//Buscando corchete de cierre.
index=pos_123+1;
count=pos2_123-pos_123-1;
seccion_ini_123[i2,0]=string_copy(archivo_ini_123,index,count);

//Recortando archivo ini
length_123=string_length(archivo_ini_123);
index=pos2_123+1;
count=length_123-index+1;
archivo_ini_123=string_copy(archivo_ini_123,index,count);

//Quitando caracteres del inicio
//Corrigiendo saltos de linea
str=archivo_ini_123;
index=1;count=1;
str_ram_x=string_copy(str,index,count);
while(str_ram_x=chr(10) || str_ram_x=chr(13))
{
index=2;
count=string_length(archivo_ini_123)-1;
archivo_ini_123=string_copy(str,index,count);
index=1;count=1;
str=archivo_ini_123;
str_ram_x=string_copy(str,index,count);
}


//Buscando corchete posterior
pos_123=string_pos("[",archivo_ini_123);//Buscando corchete de apertura.
pos2_123=string_pos("]",archivo_ini_123);//Buscando corchete de cierre.

//si ya no hay mas secciones
secciones_restantes_123=string_count("[",archivo_ini_123);
if(secciones_restantes_123=0)
{
pos_123=string_length(archivo_ini_123)+1;
}

//Buscando cantidad de claves.
index=1;count=pos_123-1;
string_posterior_123=string_copy(archivo_ini_123,index,count);
claves_123=string_count("=",string_posterior_123);
seccion_ini_123[i2,1]=claves_123;

//Extrayendo las claves y valores
for(i3=1;i3<=claves_123;i3=i3+1)
{
index=1;
count=string_pos("=",string_posterior_123)-1;
clave_x_123=string_copy(string_posterior_123,index,count);
index=count+2;
count=length_123-index+1;
string_posterior_123=string_copy(string_posterior_123,index,count);

index=1;
count=string_pos(chr(10),string_posterior_123)-2;
valor_x_123=string_copy(string_posterior_123,index,count);

//Corrigiendo espacios en blanco
//Quitando espacios en blanco
index_x2=1;
count_x2=1;
string_xy_123=string_copy(valor_x_123,index_x2,count_x2);
while(string_xy_123=chr(32))
{
index_x2=2;
count_x2=string_length(valor_x_123)-index_x2+1;
valor_x_123=string_copy(valor_x_123,index_x2,count_x2);
index_x2=1;
count_x2=1;
string_xy_123=string_copy(valor_x_123,index_x2,count_x2);
}

index=count+3;
count=length_123-index+2;
string_posterior_123=string_copy(string_posterior_123,index,count);

//////////////////Limpiando claves

//Quitando espacio inicial
str=clave_x_123;
index=1;count=1;
x1=string_copy(str,index,count);
while(x1=chr(32))
{
index=2;
count=string_length(clave_x_123)-1;
clave_x_123=string_copy(str,index,count);
str=clave_x_123;
index=1;count=1;
x1=string_copy(str,index,count);
}

//Quitando espacio final
str=clave_x_123;
index=string_length(str);count=1;
x1=string_copy(str,index,count);
while(x1=chr(32))
{
index=1;
count=string_length(clave_x_123)-1;
clave_x_123=string_copy(str,index,count);
str=clave_x_123;
index=string_length(str);count=1;
x1=string_copy(str,index,count);
}

//Almacenando clave y valor
seccion_ini_123[i2,i3+1]=clave_x_123;
seccion_ini_123[i2,i3+1+claves_123]=valor_x_123;

}//fin for(i3=1;i3<=claves_123;i3=i3+1)

}//fin for(i2=1;i2<=secciones;i2=i2+1)

}//fin if(funcion_123[i,0]="ini_open".....

///////////Devoliendo valores en variables
///Comparando funciones

//////////////////////////////////Funcion Clave existe
seccion_buscada_123="";
clave_buscada_123="";
seccion_existe_123=0;
clave_existe_123=0;
variable_salida_123="";
str_salida_123="";
continuar_123=1;
numero_seccion_123=0;
numero_clave_123=0;
argumento3_123="";
valor_123="";
argumentos_123=-1;

if(funcion_123[i,0]="ini_key_exists")
{
argumentos_123=2;
seccion_buscada_123=funcion_123[i,3];
clave_buscada_123=funcion_123[i,4];
variable_salida_123=funcion_123[i,5];
}

if(funcion_123[i,0]="ini_section_exists")
{
argumentos_123=1;
seccion_buscada_123=funcion_123[i,3];
variable_salida_123=funcion_123[i,4];
}

if(funcion_123[i,0]="ini_read_real")
{
argumentos_123=3;
seccion_buscada_123=funcion_123[i,3];
clave_buscada_123=funcion_123[i,4];
argumento3_123=funcion_123[i,5];
variable_salida_123=funcion_123[i,6];
}


if(funcion_123[i,0]="ini_read_string")
{
argumentos_123=3;
seccion_buscada_123=funcion_123[i,3];
clave_buscada_123=funcion_123[i,4];
argumento3_123=funcion_123[i,5];
variable_salida_123=funcion_123[i,6];

}

if(funcion_123[i,0]="ini_key_delete")
{
argumentos_123=2;
seccion_buscada_123=funcion_123[i,3];
clave_buscada_123=funcion_123[i,4];
}

if(funcion_123[i,0]="ini_section_delete")
{
argumentos_123=1;
seccion_buscada_123=funcion_123[i,3];
}

if(funcion_123[i,0]="ini_write_string")
{
argumentos_123=3;
seccion_buscada_123=funcion_123[i,3];
clave_buscada_123=funcion_123[i,4];
argumento3_123=funcion_123[i,5];
}

if(funcion_123[i,0]="ini_write_real")
{
argumentos_123=3;
seccion_buscada_123=funcion_123[i,3];
clave_buscada_123=funcion_123[i,4];
argumento3_123=funcion_123[i,5];
}
///Asignando valores correctos a argumentos
//Cambiando valores entre valores de strings y valores de variables.

//Organizando argumentos
for(i2=1;i2<=argumentos_123;i2=i2+1)
{
//Entrada principal
if(i2=1){str_entrada_123=seccion_buscada_123};
if(i2=2){str_entrada_123=clave_buscada_123};
if(i2=3){str_entrada_123=argumento3_123;};

if(string_length(str_entrada_123))
{
c1=string_count("'",str_entrada_123);
c2=string_count('"',str_entrada_123);
if(c1 || c2)
{
str_entrada_123=string_replace_all(str_entrada_123,"'","");
str_entrada_123=string_replace_all(str_entrada_123,'"',"");
}
else
{
str_ram_x_123="str_entrada_123="+string(str_entrada_123);
execute_string(str_ram_x_123);
}



//Quitando espacios en blanco iniciales.
str=str_entrada_123;//Entrada
index=1;count=1;
str_ram_x=string_copy(str,index,count);
while(str_ram_x=chr(10) || str_ram_x=chr(13) || str_ram_x=chr(32))
{
index=2;
count=string_length(str)-1;
str=string_copy(str,index,count);
index=1;count=1;
str_ram_x=string_copy(str,index,count);
}
str_entrada_123=str;//Salida

//Quitando espacios en blanco finales.
str=str_entrada_123;//Entrada
index=string_length(str);count=1;
str_ram_x=string_copy(str,index,count);
while(str_ram_x=chr(10) || str_ram_x=chr(13) || str_ram_x=chr(32))
{
index=1;
count=string_length(str)-1;
str=string_copy(str,index,count);
index=string_length(str);count=1;
str_ram_x=string_copy(str,index,count);
}
str_entrada_123=str;//Salida


}

//Salida principal
if(i2=1){seccion_buscada_123=str_entrada_123};
if(i2=2){clave_buscada_123=str_entrada_123};
if(i2=3){argumento3_123=str_entrada_123};

}//Fin for(i2=1;i2<=funcion_123[i2,1];i2=i2+1)
//Fin organizando argumentos


//Verificando que existe la seccion
for(i2=1;i2<=secciones_123 and continuar_123;i2=i2+1)
{
if(seccion_ini_123[i2,0]=seccion_buscada_123)
{
seccion_existe_123=1;
numero_seccion_123=i2;
continuar_123=0;
}
}


//Buscando clave
if(seccion_existe_123)
{
claves_123=seccion_ini_123[numero_seccion_123,1];
continuar_123=1;
for(i3=1;i3<=claves_123 and continuar_123;i3=i3+1)
{
if(seccion_ini_123[numero_seccion_123,i3+1]=clave_buscada_123)
{
clave_existe_123=1;
numero_clave_123=i3+1;
continuar_123=0;
}
}
}

//Mostrando respuesta
if(string_length(variable_salida_123))
{
str_salida_123=string(variable_salida_123)+"=";
if(funcion_123[i,0]="ini_key_exists"){str_salida_123+=string(clave_existe_123)}
if(funcion_123[i,0]="ini_section_exists"){str_salida_123+=string(seccion_existe_123)}
if(funcion_123[i,0]="ini_read_real")
{
if(clave_existe_123)
{
agumentos_x_123=seccion_ini_123[numero_seccion_123,1];
valor_123=seccion_ini_123[numero_seccion_123,numero_clave_123+agumentos_x_123];
str_salida_123+="real(string_digits(valor_123))";
}
else
{
str_salida_123+=string(argumento3_123);
}
}

if(funcion_123[i,0]="ini_read_string")
{
if(clave_existe_123)
{
agumentos_x_123=seccion_ini_123[numero_seccion_123,1];
valor_123=seccion_ini_123[numero_seccion_123,numero_clave_123+agumentos_x_123];
str_salida_123+="valor_123";
}
else
{
str_salida_123+="'"+string(argumento3_123)+"'";
}
}

execute_string(str_salida_123);
}





//////////////////////////////////////////////////////////////////////////
//Para las funciones ini_key_delete, ini_section_delete, ini_real_write, ini_string_write

c1=funcion_123[i,0]="ini_section_delete";
c2=funcion_123[i,0]="ini_key_delete";
c3=funcion_123[i,0]="ini_write_real";
c4=funcion_123[i,0]="ini_write_string";

if(c1 || c2 || c3 || c4)
{
seccion_encontrada_123=0;
linea_seccion_123=-1;

buscar_clave_123=1;
if(funcion_123[i,0]="ini_section_delete"){buscar_clave_123=0;}
//clave_buscada_123;
clave_encontrada_123=0;
linea_clave_123=-1;

buscar_linea_vacia_123=0;
if(funcion_123[i,0]="ini_section_delete"){buscar_linea_vacia_123=1;}
linea_vacia_123=-1;

//Buscando las lineas de las claves.
//Analizando archivo ini
//Leer linea por linea
//Buscando seccion
//Buscar posicion de la seccion
seccion_buscada_123="["+string(seccion_buscada_123)+"]";
continuar_x_123=1;
for(i4=0;i4<lineas_ini_123 and continuar_x_123;i4=i4+continuar_x_123)
{
index=1;
count=string_length(seccion_buscada_123);
str_123=string_copy(linea_ini[i4],index,count);
if(str_123=seccion_buscada_123)
{
//Encontrar la linea de la seccion
seccion_encontrada_123=1;
linea_seccion_123=i4;
continuar_x_123=0;
}
}


//Buscar clave si se encuentra la seccion
//Buscar linea de la clave
c1=buscar_clave_123;
c2=seccion_encontrada_123;
if(c1 and c2)
{
str_123="";
continuar_x_123=1
for(i5=linea_seccion_123;i5<lineas_ini_123 and continuar_x_123;i5=i5+1)
{
//clave_buscada_123
index=1;
count=string_length(clave_buscada_123);
str_123=string_copy(linea_ini[i5],index,count);
if(str_123=clave_buscada_123)
{
clave_encontrada_123=1;
linea_clave_123=i5;
continuar_x_123=0;
}
}
//Buscando linea de la clave
}

//Buscando linea vacia para ini_section_delete
c1=buscar_linea_vacia_123;
if(c1)
{
continuar_i5_123=1;
for(i5=linea_seccion_123+1;i5<lineas_ini_123 and continuar_i5_123;i5=i5+continuar_i5_123)
{
c1=(string_length(linea_ini[i5])=0);
c2=(linea_vacia_123=-1);
if(c1 and c2)
{
//Encontrar la linea de la seccion
continuar_i5_123=0;//break
}
}
linea_vacia_123=i5;
}

//Reemplazar linea con clave y valor
//Crear lineas del nuevo archivo ini
if(clave_encontrada_123)
{
if(funcion_123[i,0]="ini_write_string")
{
clave_x_123=clave_buscada_123;
valor_x_123=argumento3_123;
linea_ini[linea_clave_123]=string(clave_x_123)+" = "+string(valor_x_123);
}

if(funcion_123[i,0]="ini_write_real")
{
clave_x_123=clave_buscada_123;
valor_x_123=argumento3_123;
linea_ini[linea_clave_123]=string(clave_x_123)+" = "+string(valor_x_123);
}

if(funcion_123[i,0]="ini_key_delete")
{
lineas_ini_123=lineas_ini_123-1;
for(i6=linea_clave_123;i6<lineas_ini_123;i6=i6+1)
{
linea_ini[i6]=linea_ini[i6+1];
}
}
}

if(seccion_encontrada_123)
{
if(funcion_123[i,0]="ini_section_delete")
{
resta_123=linea_vacia_123-linea_seccion_123+1;
lineas_ini_123=lineas_ini_123-resta_123;
for(i6=linea_seccion_123;i6<lineas_ini_123;i6=i6+1)
{
linea_ini[i6]=linea_ini[i6+resta_123];
}
}
}

//Redactando archivo ini
//Crear un nuevo archivo ini
//Redactar linea por linea

//Creando nuevo archivo ini
archivo_ini_123="";
for(i5=0;i5<lineas_ini_123;i5=i5+1)
{
archivo_ini_123+=linea_ini[i5]+chr(13)+chr(10);
}

if(ubicacion_archivo_ini_123!="string")
{
file_open_write(ubicacion_archivo_ini_123);
for(i6=0;i6<lineas_ini_123;i6=i6+1)
{
file_write_string(linea_ini[i6]);
file_writeln();

}
file_close();
}


}//if(c1 || c2 || c3 || c4)








}//for(i=1;i<=funcion_encontrada_123;i+=1)








return str_in_123;

////Caracteres que intervienen en el proceso:
//Espacio en blanco: chr(32).
//" Comillas dobles, comilla tipográfica: chr(34).
//' Comillas simples: chr(39).

//( Paréntesis de apertura: chr(40).
//) Paréntesis de cierre: chr(41).
//, Coma: chr(44).
//. Punto: chr(46).
// "/" Barra: chr(47).
//0 Numero 0: chr(48).
//9 Número 9: chr(57).


//; Punto y coma: chr(59).

//= Signo de igualdad: chr(61).

//A Letra A mayúscula: chr(65).
//Z Letra Z mayúscula: chr(90).

//_ Línea baja, piso: chr(95).

//a Letra A minúscula: chr(97).
//z Letra Z minúscula: chr(122).

//á Letra A con tilde: chr(225).
//ú Letra U con tilde: chr(250).


//Funciones ini
//ini_close();
//ini_key_delete(section, key);
//ini_key_exists(section, key);
//ini_open(name);
//ini_open_from_string(string);
//ini_read_real(section, key, default);
//ini_read_string(section, key, default);
//ini_section_delete(section);
//ini_section_exists(section);
//ini_write_real(section, key, value);
//ini_write_string(section, key, value);


Detalles:
ini_file(str) en su primera versión es un script exclusivo de game maker 4.3 el cual le permite administrar archivos ini de igual modo que en las versiones superiores. Este script recibe como argumento una cadena que contiene las funciones necesarias para trabajar con este tipo de archivos.

Modo de uso:
1. Crear script: Con el código entregado se creará un script el cual deberá ser llamado ini_file.
2. Usar script: ini_file(str), dentro de str deberás colocar una cadena que contenga las funciones básicas para administración de archivos ini.

Ejemplo:


ini_file('   

ini_open("archivo_ini.ini");
ini_write_real("Usuario_1","clave",2112);
ini_close();

');




Mejoras a futuro:
1. Aumentar compatibilidad: Permitir que este script pueda ser usado en versiones superiores para que se pueda trabajar con ini_open_from_string(str) en todas las versiones.

Metas propuestas:
Tengo el objetivo de crear un editor html5 muy básico de video juegos y para lograrlo necesitaré cumplir las siguientes metas:



Bueno eso es todo, saludos.