|
Post by claudiamoral on Oct 27, 2020 10:01:36 GMT
Reading and watching tutorials I have not found how to pick up an object and it appears outside the play area. 
|
|
|
Post by Minilop on Oct 27, 2020 17:27:41 GMT
It's not something you can do if you want the item to still count as being GOT by the player, since if you use PUT (PUT X Y OBJ#) where your x and y are outside the play area - although the object will display OK, it will no longer be in the players inventory. To get around this, what I have done is to create some block icons to represent the GOT objects and then display those outside the play area
i.e. in the player event
DETECTOBJ IF OBJ = 13 AT 1 1 PUTBLOCK 20 ENDIF
Of course, if this is something your game will be doing a lot the code could quickly become quite long.
|
|
|
Post by Packobilly on Oct 27, 2020 17:54:44 GMT
I use standard AGD. In the player script you have to specify that it can catch objects with DETECT OBJ so that it can interact with them. When you design an object, you have to specify on which screen you want it to appear and by pressing P, position it in the place where you want it to be located. To pick up an object, for example object number 1, you have to enter IF OBJ = 1 GETOBJ ENDIF in the player script. Sorry, but I'm on my cell phone at work. Good luck and greetings. You can!
|
|
|
Post by claudiamoral on Oct 27, 2020 20:54:33 GMT
It's not something you can do if you want the item to still count as being GOT by the player, since if you use PUT (PUT X Y OBJ#) where your x and y are outside the play area - although the object will display OK, it will no longer be in the players inventory. To get around this, what I have done is to create some block icons to represent the GOT objects and then display those outside the play area i.e. in the player event DETECTOBJ IF OBJ = 13 AT 1 1 PUTBLOCK 20 ENDIF Of course, if this is something your game will be doing a lot the code could quickly become quite long. Yes, I had thought to represent the objects with blocks, but there are 10 objects in my game that would be 40 blocks. The memory expenditure I think would be excessive. I thought there was an easier way.
|
|
|
Post by claudiamoral on Oct 27, 2020 20:58:19 GMT
I use standard AGD. In the player script you have to specify that it can catch objects with DETECT OBJ so that it can interact with them. When you design an object, you have to specify on which screen you want it to appear and by pressing P, position it in the place where you want it to be located. To pick up an object, for example object number 1, you have to enter IF OBJ = 1 GETOBJ ENDIF in the player script. Sorry, but I'm on my cell phone at work. Good luck and greetings. You can! Thank you Packobilly, that first step is clear to me. I wanted that when I picked up the object it could appear outside the playing area, something similar to Wally games from Mikrogen.
|
|
|
Post by Minilop on Oct 27, 2020 22:22:33 GMT
It's not something you can do if you want the item to still count as being GOT by the player, since if you use PUT (PUT X Y OBJ#) where your x and y are outside the play area - although the object will display OK, it will no longer be in the players inventory. To get around this, what I have done is to create some block icons to represent the GOT objects and then display those outside the play area i.e. in the player event DETECTOBJ IF OBJ = 13 AT 1 1 PUTBLOCK 20 ENDIF Of course, if this is something your game will be doing a lot the code could quickly become quite long. Yes, I had thought to represent the objects with blocks, but there are 10 objects in my game that would be 40 blocks. The memory expenditure I think would be excessive. I thought there was an easier way. That's true, that's why I create a smaller version of the object in a single block.
|
|
|
Post by jltursan on Oct 28, 2020 18:38:20 GMT
If I'm not wrong, you can still write messages outside the window area (where the map screens are displayed); so, if you haven't used yet all your font chars, you can get 37 chars after uppercase letters and adding another 3 you'll have enough to print your 10 objects Maybe it's an option for you...
|
|
|
Post by claudiamoral on Oct 28, 2020 22:02:03 GMT
If I'm not wrong, you can still write messages outside the window area (where the map screens are displayed); so, if you haven't used yet all your font chars, you can get 37 chars after uppercase letters and adding another 3 you'll have enough to print your 10 objects Maybe it's an option for you...
Great idea, if I fall short I will use it. Thank you so much 
|
|
|
Post by ramon on Oct 29, 2020 8:39:00 GMT
Aquí tienes un ejemplo: Hay cuatro elementos relacionados: La mochila, El inventario, Las Pantallas y Los Objetos. La mochila es el área fuera del juego donde mostraremos nuestra colección de Objetos y sus Nombres. El inventario es una lista interna donde van los objetos que cogemos de las pantallas. Las pantallas son las dueñas de los objetos. Puede decirse que cada pantalla es una lista de objetos. los objetos. Podemos referirnos a ellos por su índice en memoria o por el lugar que ocupan en el inventario. Para este ejemplo no usamos el inventario por que intercambiamos los objetos con la mochila, que es otra cosa. Sabremos en todo momento cuantos objetos tenemos (i), cuales: A y B, y sus nombres message A y message B. En el momento de hacer "drop" en una pantalla podemos reservar ese objeto para comprobar si hemos cumplido nuestra mission o si seguimos el destino de nuestra aventura. Por ejemplo, si deja las llaves en la habitación de salida podrás abrir la puerta. Si dejas la máscara mágica en el salon del trono liberas al espíritu del asesino.
Al inicio del juego empiezas con mochila vacía. i = 0
EVENT GAMEINIT ... LET I = 0 ; COSAS EN MI MOCHILA ...
Cada vez que cambies de pantalla dentro de cualquier EVENT tienes que añadir el código siguiente antes de SCREENLEFT, SCREENRIGHT, ... etc. Para llevarte la mochila de pantalla en pantalla.
... IF I > 0 IF I = 2 GET A GET B ; ME LLEVO MIS COSAS ELSE GET A ; ME LO LLEVO ENDIF ENDIF SCREENLEFT ... IF I > 0 IF I = 2 GET A GET B ; ME LLEVO MIS COSAS ELSE GET A ; ME LO LLEVO ENDIF ENDIF SCREENRIGHT ... etc
El siguiente código detecta el objeto, hace los cambios en la mochila y no vuelve a cambiar la mochila hasta que dejes de colisionar con el objeto que dejas (drop). Recoges en la variable C ese objeto que después puedes usar para comprobar si cumples la aventura o la misión.
EVENT PLAYER ... DETECTOBJ IF OBJ <> 255 ; did we detect an object IF I < 3 ; ¿NUEVO INTERCAMBIO? GET OBJ ; COGEMOS EL NUEVO OBJETO PARA INVENTARIO IF I = 2 ; ¿MOCHILA LLENA? LET C = B ; RESERVA C PARA LOGIA DE AVENTURA GET B ; BORRO OBJETO B DE MOCHILA PUT X Y B ; PINTO OBJETO B EN LUGAR DEL PLAYER, (DROP) GET A ; BORRO OBJETO A DE MOCHILA PUT 0 16 A ; PINTO OBJETO A EN SEGUNDA POSICION DE MOCHILA AT 2 2 MESSAGE A ; PINTO NOMBRE OBJETO EN SEGUNDA POSICION DE MOCHILA LET B = A ; CAMBIO OBJETO B POR A LET A = OBJ ; CAMBIO OBJETO A POR NUEVO OBJETO PUT 0 0 A ; PINTO OBJETO A EN PRIMERA POSICION DE MOCHILA AT 0 2 MESSAGE A ; PINTO NOMBRE OBJETO EN PRIMERA POSICION DE MOCHILA BEEP 25 LET I = 3 ; I = 3 -> flag: ESTAMOS CAMBIANDO OBJETO ELSE ; MOCHILA NO LLENA, AÑADIMOS 1 A LA MOCHILA IF I = 0 LET A = OBJ ; CAMBIO OBJETO A POR NUEVO OBJETO PUT 0 0 A ; PINTO OBJETO A EN PRIMERA POSICION DE MOCHILA AT 0 2 MESSAGE A ; PINTO NOMBRE OBJETO EN PRIMERA POSICION DE MOCHILA ADD 1 TO I ; I = 1 -> TENGO UNA COSA BEEP 25 ELSE LET B = OBJ ; CAMBIO OBJETO B POR NUEVO OBJETO PUT 0 16 B ; PINTO OBJETO B EN SEGUNDA POSICION DE MOCHILA AT 2 2 MESSAGE B ; PINTO NOMBRE OBJETO EN SEGUNDA POSICION DE MOCHILA ADD 1 TO I ; I = 2 -> TENGO 2 COSAS = MOCHILA LLENA BEEP 25 ENDIF ENDIF ENDIF ELSE ; NO, we don't detect anything IF I = 3 ; ¿ESTABAS CAMBIANDO OBJETO? LET I = 2 ; AHORA QUE NO COLISIONAS PUEDES CAMBIAR DE NUEVO ENDIF ENDIF ...
Cada vez que se pinta el fondo, tienes que colocar tu mochila.
EVENT RESTARTSCREEN ... IF I > 0 IF I = 2 PUT 0 0 A ; COLOCO MI COSA PUT 0 16 B ; COLOCO MI OTRA COSA ELSE PUT 0 0 A ; COLOCO MI UNICA COSA ENDIF ENDIF
REDRAW ...
Cuando mueres, tambien tienes que llevarte la mochila a la tumba.
EVENT KILLPLAYER ... ; ME LLEVO MIS COSAS IF I > 0 IF I = 2 GET A GET B ; ME LLEVO MIS COSAS ELSE GET A ; ME LO LLEVO ENDIF ENDIF ...
Para que aparezcan los nombres correspondientes, debes escribirlos en el mismo orden que los índices de objetos en memoria. ejemplo: el objeto 0 -> message " LLAVES MAZMORRA".
DEFINEMESSAGES
" LLAVES MAZMORRA" " HIMAN IMANDU " " MASCARA DEL REO"
Espero que te funcione.
|
|
|
Post by claudiamoral on Oct 29, 2020 12:18:57 GMT
Osti Ramon...Me parece super interesante, voy a ver como lo desarrollo, y estudiarme función por función. Acabo de empezar con esto y voy asimilando poco a poco. Esto me abre muchas posibilidades. Muchas gracias I find it super interesting, I'm going to see how I develop it, and study myself function by function. I just started with this and I am assimilating little by little. This opens up many possibilities for me. Thank you very much
|
|
|
Post by ramon on Oct 29, 2020 13:52:15 GMT
Te va a ir bien. 
|
|
|
Post by claudiamoral on Oct 29, 2020 16:33:06 GMT
Te va a ir bien.  Perdona, se me olvido decir que utilizo AGD 4.8, y no consigo que acepte el comando AT, no se si tiene eso algo que ver. Sorry, I forgot to say that I use AGD 4.8, and I can't get it to accept the AT command, I don't know if that has something to do with it.
|
|
|
Post by ramon on Oct 29, 2020 17:15:02 GMT
AT 2 2 MESSAGE A ; PINTO NOMBRE OBJETO EN SEGUNDA POSICION DE MOCHILA (MPAGD)
LET LINE = 2 LET COLUMN = 2 MESSAGE A ; PINTO NOMBRE OBJETO EN SEGUNDA POSICION DE MOCHILA (AGD4.8)
|
|
|
Post by Jonathan Cauldwell on Nov 1, 2020 12:45:48 GMT
There should be another way of having the object displayed in the status panel while in the player's inventory.
Temporarily PUT the object in the panel, then use AT and PRINT to delete it with 4 spaces. Then GET the object. The engine will then attempt to delete the object from the status panel by XORing it (that's like using OVER 1 in BASIC), but as it has already been deleted using PRINT the object will be re-drawn.
|
|
|
Post by claudiamoral on Nov 1, 2020 15:10:43 GMT
I get to practice with it. I am a very beginner and I go step by step.
Thank you all
|
|