Posted March 26, 2023 by Carenalga
#godot 4 #godot #godot addon #tool #point n' click #popochiu
Lee la versión en Español más abajo
Popochiu has been preparing for this moment for several months already since the beta versions of Godot 4 started to be released, but with what we achieved in Popochiu 1.9 regarding direct access to game objects from the code editor, and some decisions made regarding file naming, we had to make many changes before we could release this first alpha.
We hope you will help us test it to find bugs and make the official version the best possible.
E.run([])
is now called E.queue([])
, but you don’t need it to queue instructions with that method anymore!!!. You can do that with GDScript 2.0’s await
.
func _on_click() -> void:
# This much better, right?
await C.walk_to_clicked()
await C.face_clicked()
await C.Goddiu.say('My old toy car...')
await I.ToyCar.add()
await A.sfx_toy_car.play()
E.queue([])
, you’ll need to use the queue_
version of each method:
func _on_click() -> void:
# Doing the same in the old way
E.queue([
C.queue_walk_to_clicked(),
C.queue_face_clicked(),
'Player: My old toy car...',
I.ToyCar.queue_add(),
A.sfx_toy_car.queue_play(),
])
on_interact()
and on_click()
methods in Props, Hotspots, Characters and Inventory items are called _on_click()
and _on_right_click()
. We made this change because we wanted the plugin to not impose how to identify such interactions. Thanks go to @StickGrinder for bringing this to our attention.id
property of the PopochiuDialogOption
returned by D.show_inline_dialog(options: Array)
is now a String
number starting at 0.
var op: PopochiuDialogOption = await D.show_inline_dialog([
'Hi', 'Hola', 'Ciao'
])
match int(op.id): # You can compare the String if you prefer
0:
C.Goddiu.say("How is it going?")
1:
C.Goddiu.say("¿Cómo te va?")
2:
C.Goddiu.say("Come sta andando?")
walk_to_room_point(id: String)
is now named walk_to_marker(id: String)
.state
of those objects.
# This won't show anything for autocompletion
C.Goddiu.
# But here Godot will suggest properties and methods in the state script of the character
C.Goddiu.state.
match
to evaluate which option was selected.Popochiu se ha estado preparando, desde que empezaron las publicaciones de las versiones Beta de Godot 4, para este momento, pero con las mejoras que logramos en la versión 1.9 respecto al acceso a los objetos del juego desde el editor de código, y algunas decisiones que tomamos en relación al nombrado de los archivos, tuvimos que hacer varios cambios adicionales con tal de publicar la primera versión alfa.
Esperamos que nos ayuden a probar el plugin para encontrar errores que hagan que el lanzamiento salga lo mejor posible.
E.run([])
ahora se llama E.queue([])
, pero ¡¡¡no será necesario usarlo para encolar instrucciones!!!, para eso puedes usar el await
de GDScript 2/
func _on_click() -> void:
# Esto se ve mucho mejor
await C.walk_to_clicked()
await C.face_clicked()
await C.Goddiu.say('Mi viejo carrito de juguete...')
await I.ToyCar.add()
await A.sfx_toy_car.play()
E.queue([])
, pero tendrás que usar los métodos que empiezan por queue_
:
func _on_click() -> void:
# Así se hace a la antigua
E.queue([
C.queue_walk_to_clicked(),
C.queue_face_clicked(),
'Player: Mi viejo carrito de juguete...',
I.ToyCar.queue_add(),
A.sfx_toy_car.queue_play(),
])
on_interact()
y on_click()
en las Props, las Hotspots, les personajes y les objetos de inventario se llaman _on_click()
y _on_right_click()
. Hicimos este cambio porque no queríamos que el plugin impusiera el modo de nombrar a dichas interacciones. Tenemos que agradecer a @StickGrinder por hacernos caer en cuenta de esto.id
de los PopochiuDialogOption
que retorna la llamada al método D.show_inline_dialog(options: Array)
es ahora número String
que inicia en 0.
var op: PopochiuDialogOption = await D.show_inline_dialog([
'Hi', 'Hola', 'Ciao'
])
match int(op.id): # También podrías comparar directamente el String
0:
C.Goddiu.say("How is it going?")
1:
C.Goddiu.say("¿Cómo te va?")
2:
C.Goddiu.say("Come sta andando?")
walk_to_room_point(id: String)
de la clase PopochiuCharacter ahora se llama walk_to_marker(id: String)
.state
de dichos objetos.
# El editor de código aquí no mostrará nada
C.Goddiu.
# Pero aquí sugerirá propiedades y métodos en el script state del personaje
C.Goddiu.state.
match
para evaluar qué opción se ha seleccionado.