First commit 🎉
This commit is contained in:
commit
43ea213f9b
728 changed files with 37080 additions and 0 deletions
23
addons/popochiu/engine/templates/character_state_template.gd
Normal file
23
addons/popochiu/engine/templates/character_state_template.gd
Normal file
|
@ -0,0 +1,23 @@
|
|||
extends PopochiuCharacterData
|
||||
# Put here variables you want to save and load when saving and loading the game.
|
||||
# By default only Godot's basic built-in types are automatically saved and loaded
|
||||
# but you can use the save_custom and load_custom methods to implement your
|
||||
# own.
|
||||
# script_name and scene variables from the inherited class will not be saved.
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# Use this to save custom data for this PopochiuCharacter when saving the game.
|
||||
# The Dictionary must contain only JSON supported types: bool, int, float, String.
|
||||
func _on_save() -> Dictionary:
|
||||
return {}
|
||||
|
||||
|
||||
# Called when the game is loaded.
|
||||
# This Dictionary should has the same structure you defined for the returned
|
||||
# one in on_save().
|
||||
func _on_load(data: Dictionary) -> void:
|
||||
prints(data)
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://dbs0clsbvk4s5
|
95
addons/popochiu/engine/templates/character_template.gd
Normal file
95
addons/popochiu/engine/templates/character_template.gd
Normal file
|
@ -0,0 +1,95 @@
|
|||
@tool
|
||||
extends PopochiuCharacter
|
||||
# You can use E.queue([]) to trigger a sequence of events.
|
||||
# Use await E.queue([]) if you want to pause the execution of
|
||||
# the function until the sequence of events finishes.
|
||||
|
||||
const Data := preload('character_state_template.gd')
|
||||
|
||||
var state: Data = null
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# When the room in which this node is located finishes being added to the tree
|
||||
func _on_room_set() -> void:
|
||||
pass
|
||||
|
||||
|
||||
# When the node is clicked
|
||||
func _on_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character walk to this character, gaze at it, and then
|
||||
# say something:
|
||||
# await C.player.walk_to_clicked()
|
||||
# await C.player.face_clicked()
|
||||
# await C.player.say("Hi!")
|
||||
|
||||
|
||||
func _on_double_click() -> void:
|
||||
# Replace the call to E.command_fallback() with your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you could make the player instantly do something instead of walking there first
|
||||
|
||||
|
||||
# When the node is right clicked
|
||||
func _on_right_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character gaze at this character and then say something:
|
||||
# await C.player.face_clicked()
|
||||
# await C.player.say("Is someone...")
|
||||
|
||||
|
||||
# When the node is middle clicked
|
||||
func _on_middle_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
|
||||
|
||||
# When the node is clicked and there is an inventory item selected
|
||||
func _on_item_used(_item: PopochiuInventoryItem) -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character say something when the Key item is used in this
|
||||
# character. Note that you have to change the name of the `_item` parameter to `item`.
|
||||
# if item == I.Key:
|
||||
# await C.player.say("I don't want to give up my key")
|
||||
|
||||
|
||||
# Use it to play the idle animation for the character
|
||||
func _play_idle() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Use it to play the walk animation for the character
|
||||
# target_pos can be used to know the movement direction
|
||||
func _play_walk(target_pos: Vector2) -> void:
|
||||
super(target_pos)
|
||||
|
||||
|
||||
# Use it to play the talk animation for the character
|
||||
func _play_talk() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Use it to play the grab animation for the character
|
||||
func _play_grab() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when the character stops moving
|
||||
func _on_move_ended() -> void:
|
||||
pass
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public #####################################################################################
|
||||
# You can add here functions triggered by the GUI commands. For example, if your GUI has a command
|
||||
# for look_at, you could have the function:
|
||||
#func on_look_at() -> void:
|
||||
#pass
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://bj6ncdmjk23em
|
44
addons/popochiu/engine/templates/dialog_template.gd
Normal file
44
addons/popochiu/engine/templates/dialog_template.gd
Normal file
|
@ -0,0 +1,44 @@
|
|||
@tool
|
||||
extends PopochiuDialog
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
func _on_start() -> void:
|
||||
# One can put here something to execute before showing the dialog options.
|
||||
# E.g. Make the PC to look at the character which it will talk to, walk to
|
||||
# it, and say something (or make the character say something):
|
||||
# await C.player.face_clicked()
|
||||
# await C.player.say("Hi")
|
||||
# await C.Popsy.say("Oh! Hi...")
|
||||
# (!) It MUST always use an await
|
||||
await PopochiuUtils.e.get_tree().process_frame
|
||||
|
||||
|
||||
func _option_selected(opt: PopochiuDialogOption) -> void:
|
||||
# You can make the player character say the selected option with:
|
||||
# await D.say_selected()
|
||||
|
||||
# Use match to check which option was selected and execute something for
|
||||
# each one
|
||||
match opt.id:
|
||||
_:
|
||||
# By default close the dialog. Options won't show after calling
|
||||
# stop()
|
||||
stop()
|
||||
|
||||
_show_options()
|
||||
|
||||
|
||||
# Use this to save custom data for this PopochiuDialog when saving the game.
|
||||
# The Dictionary must contain only JSON supported types: bool, int, float, String.
|
||||
func _on_save() -> Dictionary:
|
||||
return {}
|
||||
|
||||
|
||||
# Called when the game is loaded.
|
||||
# This Dictionary should has the same structure you defined for the returned one in _on_save().
|
||||
func _on_load(data: Dictionary) -> void:
|
||||
prints(data)
|
||||
|
||||
|
||||
#endregion
|
1
addons/popochiu/engine/templates/dialog_template.gd.uid
Normal file
1
addons/popochiu/engine/templates/dialog_template.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://na3qxt3oj4n3
|
|
@ -0,0 +1,8 @@
|
|||
# This script is empty and is necessary to programmatically
|
||||
# create an empty script to hold the <PopochiuObject>_template.gd
|
||||
# source file, after the placeholders have been populated.
|
||||
#
|
||||
# It is necessary from Godot 4.1 or an error is raised when the
|
||||
# template script is loaded.
|
||||
#
|
||||
# Do not erase this script.
|
|
@ -0,0 +1 @@
|
|||
uid://bpyea3ql2koh5
|
|
@ -0,0 +1,79 @@
|
|||
extends NineVerbCommands
|
||||
|
||||
|
||||
# Override this if you want to register additional commands. (!) Don't forget
|
||||
# to call super().
|
||||
#func _init() -> void:
|
||||
#super()
|
||||
|
||||
|
||||
# Override this if you want to change the name that will identify this set of
|
||||
# commands.
|
||||
#static func get_script_name() -> String:
|
||||
#return "NineVerbCommands"
|
||||
|
||||
|
||||
# Called when there is not a Callable defined for a registered command.
|
||||
# By default calls `walk_to()`.
|
||||
func fallback() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.WALK_TO` and E.command_fallback()
|
||||
# is triggered.
|
||||
func walk_to() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.OPEN` and E.command_fallback()
|
||||
# is triggered.
|
||||
func open() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.PICK_UP` and E.command_fallback()
|
||||
# is triggered.
|
||||
func pick_up() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.PUSH` and E.command_fallback()
|
||||
# is triggered.
|
||||
func push() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.CLOSE` and E.command_fallback()
|
||||
# is triggered.
|
||||
func close() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.LOOK_AT` and E.command_fallback()
|
||||
# is triggered.
|
||||
func look_at() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.PULL` and E.command_fallback()
|
||||
# is triggered.
|
||||
func pull() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.GIVE` and E.command_fallback()
|
||||
# is triggered.
|
||||
func give() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.TALK_TO` and E.command_fallback()
|
||||
# is triggered.
|
||||
func talk_to() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.USE` and E.command_fallback()
|
||||
# is triggered.
|
||||
func use() -> void:
|
||||
super()
|
|
@ -0,0 +1 @@
|
|||
uid://dp76ndkyh8upe
|
|
@ -0,0 +1,34 @@
|
|||
#class_name CustomCommands
|
||||
extends PopochiuCommands
|
||||
|
||||
enum Commands {
|
||||
#X_RAY, POWERFUL_HAND, HYPER_SCREAM
|
||||
}
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
super()
|
||||
|
||||
#E.register_command(Commands.X_RAY, "x ray", x_ray)
|
||||
#E.register_command(Commands.POWERFUL_HAND, "powerful hand", powerful_hand)
|
||||
#E.register_command(Commands.HYPER_SCREAM, "hyper scream", hyper_scream)
|
||||
|
||||
|
||||
static func get_script_name() -> String:
|
||||
return "CustomCommands"
|
||||
|
||||
|
||||
func fallback() -> void:
|
||||
super()
|
||||
|
||||
|
||||
#func x_ray()-> void:
|
||||
#pass
|
||||
#
|
||||
#
|
||||
#func powerful_hand()-> void:
|
||||
#pass
|
||||
#
|
||||
#
|
||||
#func hyper_scream()-> void:
|
||||
#pass
|
|
@ -0,0 +1 @@
|
|||
uid://be5gjf5r6shlb
|
89
addons/popochiu/engine/templates/gui/gui_template.gd
Normal file
89
addons/popochiu/engine/templates/gui/gui_template.gd
Normal file
|
@ -0,0 +1,89 @@
|
|||
extends PopochiuGraphicInterface
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# Called when the GUI is blocked and not intended to handle input events.
|
||||
func _on_blocked(props := { blocking = true }) -> void:
|
||||
super(props)
|
||||
|
||||
|
||||
# Called when the GUI is unblocked and can handle input events again.
|
||||
func _on_unblocked() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called to hide the GUI.
|
||||
func _on_hidden() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called to show the GUI.
|
||||
func _on_shown() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when G.show_system_text() is triggered. Shows `msg` in the SystemText
|
||||
# component.
|
||||
func _on_system_text_shown(msg: String) -> void:
|
||||
super(msg)
|
||||
|
||||
|
||||
# Called once the player closes the SystemText component (by clicking the screen
|
||||
# anywhere).
|
||||
func _on_system_text_hidden() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when the mouse enters (hover) a `clickable`.
|
||||
func _on_mouse_entered_clickable(clickable: PopochiuClickable) -> void:
|
||||
super(clickable)
|
||||
|
||||
|
||||
# Called when the mouse exits a `clickable`.
|
||||
func _on_mouse_exited_clickable(clickable: PopochiuClickable) -> void:
|
||||
super(clickable)
|
||||
|
||||
|
||||
# Called when the mouse enters (hover) an `inventory_item`.
|
||||
func _on_mouse_entered_inventory_item(inventory_item: PopochiuInventoryItem) -> void:
|
||||
super(inventory_item)
|
||||
|
||||
|
||||
# Called when the mouse exits an `inventory_item`.
|
||||
func _on_mouse_exited_inventory_item(inventory_item: PopochiuInventoryItem) -> void:
|
||||
super(inventory_item)
|
||||
|
||||
|
||||
# Called when a dialog line is said be a `PopochiuCharacter` (this is when
|
||||
# `PopochiuCharacter.say()` is called.
|
||||
func _on_dialog_line_started() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when a dialog line finishes (this is after players click the screen
|
||||
# anywhere to make the dialog line disappear).
|
||||
func _on_dialog_line_finished() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when a `dialog` starts (after calling `PopochiuDialog.start()`).
|
||||
func _on_dialog_started(dialog: PopochiuDialog) -> void:
|
||||
super(dialog)
|
||||
|
||||
|
||||
# Called when a `dialog` finishes (after calling `PopochiuDialog.stop()`).
|
||||
func _on_dialog_finished(dialog: PopochiuDialog) -> void:
|
||||
super(dialog)
|
||||
|
||||
|
||||
# Called when an `item` in the inventory is selected (i.e. by clicking it).
|
||||
func _on_inventory_item_selected(item: PopochiuInventoryItem) -> void:
|
||||
super(item)
|
||||
|
||||
|
||||
# Called by [b]cursor.gd[/b] to get the name of the cursor texture to show.
|
||||
func _get_cursor_name() -> String:
|
||||
return super()
|
||||
|
||||
|
||||
#endregion
|
1
addons/popochiu/engine/templates/gui/gui_template.gd.uid
Normal file
1
addons/popochiu/engine/templates/gui/gui_template.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://be63otag0g1n0
|
26
addons/popochiu/engine/templates/gui/popup_template.gd
Normal file
26
addons/popochiu/engine/templates/gui/popup_template.gd
Normal file
|
@ -0,0 +1,26 @@
|
|||
@tool
|
||||
extends PopochiuPopup
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
## Called when the popup is opened. At this point it is not visible yet.
|
||||
func _open() -> void:
|
||||
pass
|
||||
|
||||
|
||||
## Called when the popup is closed. The node hides after calling this method.
|
||||
func _close() -> void:
|
||||
pass
|
||||
|
||||
|
||||
## Called when OK is pressed.
|
||||
func _on_ok() -> void:
|
||||
pass
|
||||
|
||||
|
||||
## Called when CANCEL or X (top-right corner) are pressed.
|
||||
func _on_cancel() -> void:
|
||||
pass
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://bydkkguscqppe
|
|
@ -0,0 +1,40 @@
|
|||
extends SierraCommands
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
super()
|
||||
|
||||
|
||||
static func get_script_name() -> String:
|
||||
return "SierraCommands"
|
||||
|
||||
|
||||
# Called when there is not a Callable defined for a registered command.
|
||||
# By default calls walk().
|
||||
func fallback() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.WALK` and E.command_fallback()
|
||||
# is triggered.
|
||||
# By default makes the character walk to the clicked `PopochiuClickable`.
|
||||
func walk() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.LOOK` and E.command_fallback()
|
||||
# is triggered.
|
||||
func look() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.INTERACT` and E.command_fallback()
|
||||
# is triggered.
|
||||
func interact() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when `E.current_command == Commands.TALK` and E.command_fallback()
|
||||
# is triggered.
|
||||
func talk() -> void:
|
||||
super()
|
|
@ -0,0 +1 @@
|
|||
uid://c3a3ruh3uojep
|
|
@ -0,0 +1,29 @@
|
|||
extends SimpleClickCommands
|
||||
|
||||
|
||||
# Called when `E.command_fallback()` is triggered.
|
||||
# By default evaluates if the clicked object was a `PopochiuClickable` or a
|
||||
# `PopochiuInventoryItem` and calls the corresponding method depending on the
|
||||
# object type and the clicked mouse button.
|
||||
func fallback() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when players click (LMB) a `PopochiuClickable`.
|
||||
func click_clickable() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when players right click (RMB) a `PopochiuClickable`.
|
||||
func right_click_clickable() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when players click (LMB) a `PopochiuInventoryItem`.
|
||||
func click_inventory_item() -> void:
|
||||
super()
|
||||
|
||||
|
||||
# Called when players right click (RMB) a `PopochiuInventoryItem`.
|
||||
func right_click_inventory_item() -> void:
|
||||
super()
|
|
@ -0,0 +1 @@
|
|||
uid://bht4lbua380sm
|
62
addons/popochiu/engine/templates/hotspot_template.gd
Normal file
62
addons/popochiu/engine/templates/hotspot_template.gd
Normal file
|
@ -0,0 +1,62 @@
|
|||
@tool
|
||||
extends PopochiuHotspot
|
||||
# You can use E.queue([]) to trigger a sequence of events.
|
||||
# Use await E.queue([]) if you want to pause the execution of
|
||||
# the function until the sequence of events finishes.
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# When the node is clicked
|
||||
func _on_click() -> void:
|
||||
# Replace the call to E.command_fallback() with your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character walk to this hotspot, gaze at it, and then say
|
||||
# something:
|
||||
# await C.player.walk_to_clicked()
|
||||
# await C.player.face_clicked()
|
||||
# await C.player.say("What a nice view")
|
||||
|
||||
|
||||
func _on_double_click() -> void:
|
||||
# Replace the call to E.command_fallback() with your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you could make the player instantly goto another room on an exit hotspot instead
|
||||
# of waiting for the player to walk there.
|
||||
# await R.current = R.NewRoom
|
||||
|
||||
|
||||
# When the node is right clicked
|
||||
func _on_right_click() -> void:
|
||||
# Replace the call to E.command_fallback() with your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character gaze at this hotspot and then say something:
|
||||
# await C.player.face_clicked()
|
||||
# await C.player.say("A window")
|
||||
|
||||
|
||||
# When the node is middle clicked
|
||||
func _on_middle_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
|
||||
|
||||
# When the node is clicked and there is an inventory item selected
|
||||
func _on_item_used(_item: PopochiuInventoryItem) -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character say something when the Key item is used in this
|
||||
# hotspot. Note that you have to change the name of the `_item` parameter to `item`.
|
||||
# if item == I.Key:
|
||||
# await C.player.say("No can do")
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public #####################################################################################
|
||||
# You can add here functions triggered by the GUI commands. For example, if your GUI has a command
|
||||
# for look_at, you could have the function:
|
||||
#func on_look_at() -> void:
|
||||
#pass
|
||||
|
||||
|
||||
#endregion
|
1
addons/popochiu/engine/templates/hotspot_template.gd.uid
Normal file
1
addons/popochiu/engine/templates/hotspot_template.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://buhonpokhe2wq
|
|
@ -0,0 +1,23 @@
|
|||
extends PopochiuInventoryItemData
|
||||
# Put here variables you want to save and load when saving and loading the game.
|
||||
# By default only Godot's basic built-in types are automatically saved and loaded
|
||||
# but you can use the save_custom and load_custom methods to implement your
|
||||
# own.
|
||||
# script_name and scene variables from the inherited class will not be saved.
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# Use this to save custom data for this PopochiuInventoryItem when saving the game.
|
||||
# The Dictionary must contain only JSON supported types: bool, int, float, String.
|
||||
func on_save() -> Dictionary:
|
||||
return {}
|
||||
|
||||
|
||||
# Called when the game is loaded.
|
||||
# This Dictionary should has the same structure you defined for the returned
|
||||
# one in on_save().
|
||||
func on_load(data: Dictionary) -> void:
|
||||
prints(data)
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://brjrl3lnp1bcb
|
51
addons/popochiu/engine/templates/inventory_item_template.gd
Normal file
51
addons/popochiu/engine/templates/inventory_item_template.gd
Normal file
|
@ -0,0 +1,51 @@
|
|||
extends PopochiuInventoryItem
|
||||
|
||||
const Data := preload('inventory_item_state_template.gd')
|
||||
|
||||
var state: Data = null
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# When the item is clicked in the inventory
|
||||
func _on_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
|
||||
|
||||
# When the item is right clicked in the inventory
|
||||
func _on_right_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
|
||||
|
||||
# When the item is middle clicked in the inventory
|
||||
func _on_middle_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
|
||||
|
||||
# When the item is clicked and there is another inventory item selected
|
||||
func _on_item_used(_item: PopochiuInventoryItem) -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character say something when the Key item is used in this
|
||||
# item. Note that you have to change the name of the `_item` parameter to `item`.
|
||||
# if item == I.Key:
|
||||
# await C.player.say("I cannot combine them")
|
||||
|
||||
|
||||
# Actions to execute after the item is added to the Inventory
|
||||
func _on_added_to_inventory() -> void:
|
||||
# Replace the call to super() to implement your code. This only
|
||||
# makes the default behavior to happen.
|
||||
super()
|
||||
|
||||
|
||||
# Actions to execute when the item is discarded from the Inventory
|
||||
func _on_discard() -> void:
|
||||
# Replace the call to super() to implement your code. This only
|
||||
# makes the default behavior to happen.
|
||||
super()
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://x5w8xttkmotr
|
72
addons/popochiu/engine/templates/prop_template.gd
Normal file
72
addons/popochiu/engine/templates/prop_template.gd
Normal file
|
@ -0,0 +1,72 @@
|
|||
@tool
|
||||
extends PopochiuProp
|
||||
# You can use E.queue([]) to trigger a sequence of events.
|
||||
# Use await E.queue([]) if you want to pause the execution of
|
||||
# the function until the sequence of events finishes.
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# When the node is clicked
|
||||
func _on_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character walk to this prop, gaze at it, and then say
|
||||
# something:
|
||||
# await C.player.walk_to_clicked()
|
||||
# await C.player.face_clicked()
|
||||
# await C.player.say("Not picking that up!")
|
||||
|
||||
|
||||
func _on_double_click() -> void:
|
||||
# Replace the call to E.command_fallback() with your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you could make the player instantly do something instead of walking there first
|
||||
|
||||
|
||||
# When the node is right clicked
|
||||
func _on_right_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character gaze at this prop and then say something:
|
||||
# await C.player.face_clicked()
|
||||
# await C.player.say("A deck of cards")
|
||||
|
||||
|
||||
# When the node is middle clicked
|
||||
func _on_middle_click() -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
|
||||
|
||||
# When the node is clicked and there is an inventory item selected
|
||||
func _on_item_used(_item: PopochiuInventoryItem) -> void:
|
||||
# Replace the call to E.command_fallback() to implement your code.
|
||||
PopochiuUtils.e.command_fallback()
|
||||
# For example, you can make the player character say something when the Key item is used in this
|
||||
# prop. Note that you have to change the name of the `_item` parameter to `item`.
|
||||
# if item == I.Key:
|
||||
# await C.player.say("I can't do that")
|
||||
|
||||
|
||||
# When an inventory item linked to this Prop (link_to_item) is removed from
|
||||
# the inventory (i.e. when it is used in something that makes use of the object).
|
||||
func _on_linked_item_removed() -> void:
|
||||
pass
|
||||
|
||||
|
||||
# When an inventory item linked to this Prop (link_to_item) is discarded from
|
||||
# the inventory (i.e. when the player throws the object out of the inventory).
|
||||
func _on_linked_item_discarded() -> void:
|
||||
pass
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public #####################################################################################
|
||||
# You can add here functions triggered by the GUI commands. For example, if your GUI has a command
|
||||
# for look_at, you could have the function:
|
||||
#func on_look_at() -> void:
|
||||
#pass
|
||||
|
||||
|
||||
#endregion
|
1
addons/popochiu/engine/templates/prop_template.gd.uid
Normal file
1
addons/popochiu/engine/templates/prop_template.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dktjff6dmvfvv
|
17
addons/popochiu/engine/templates/region_template.gd
Normal file
17
addons/popochiu/engine/templates/region_template.gd
Normal file
|
@ -0,0 +1,17 @@
|
|||
@tool
|
||||
extends PopochiuRegion
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
func _on_character_entered(chr: PopochiuCharacter) -> void:
|
||||
# This is optional. You can put here anything you want to happen when a
|
||||
# character enters the area.
|
||||
chr.modulate = tint
|
||||
|
||||
|
||||
func _on_character_exited(chr: PopochiuCharacter) -> void:
|
||||
# This is optional, too.
|
||||
chr.modulate = Color.WHITE
|
||||
|
||||
|
||||
#endregion
|
1
addons/popochiu/engine/templates/region_template.gd.uid
Normal file
1
addons/popochiu/engine/templates/region_template.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dj2hld5sh4dcf
|
23
addons/popochiu/engine/templates/room_state_template.gd
Normal file
23
addons/popochiu/engine/templates/room_state_template.gd
Normal file
|
@ -0,0 +1,23 @@
|
|||
extends PopochiuRoomData
|
||||
# Put here variables you want to save and load when saving and loading the game.
|
||||
# By default only Godot's basic built-in types are automatically saved and loaded
|
||||
# but you can use the save_custom and load_custom methods to implement your
|
||||
# own.
|
||||
# script_name and scene variables from the inherited class will not be saved.
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# Use this to save custom data for this PopochiuRoom when saving the game.
|
||||
# The Dictionary must contain only JSON supported types: bool, int, float, String.
|
||||
func _on_save() -> Dictionary:
|
||||
return {}
|
||||
|
||||
|
||||
# Called when the game is loaded.
|
||||
# This Dictionary should has the same structure you defined for the returned
|
||||
# one in on_save().
|
||||
func _on_load(data: Dictionary) -> void:
|
||||
prints(data)
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://c6q4ldrak4aii
|
30
addons/popochiu/engine/templates/room_template.gd
Normal file
30
addons/popochiu/engine/templates/room_template.gd
Normal file
|
@ -0,0 +1,30 @@
|
|||
@tool
|
||||
extends PopochiuRoom
|
||||
|
||||
const Data := preload('room_state_template.gd')
|
||||
|
||||
var state: Data = null
|
||||
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
# What happens when Popochiu loads the room. At this point the room is in the
|
||||
# tree but it is not visible
|
||||
func _on_room_entered() -> void:
|
||||
pass
|
||||
|
||||
|
||||
# What happens when the room changing transition finishes. At this point the room
|
||||
# is visible.
|
||||
func _on_room_transition_finished() -> void:
|
||||
# You can use await E.queue([]) to execute a sequence of instructions
|
||||
pass
|
||||
|
||||
|
||||
# What happens before Popochiu unloads the room.
|
||||
# At this point, the screen is black, processing is disabled and all characters
|
||||
# have been removed from the $Characters node.
|
||||
func _on_room_exited() -> void:
|
||||
pass
|
||||
|
||||
|
||||
#endregion
|
1
addons/popochiu/engine/templates/room_template.gd.uid
Normal file
1
addons/popochiu/engine/templates/room_template.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://chj61yfmri0ra
|
|
@ -0,0 +1,6 @@
|
|||
@tool
|
||||
extends PopochiuWalkableArea
|
||||
|
||||
|
||||
# ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ VIRTUAL ░░░░
|
||||
# TODO: Add useful hooks to WalkableArea (active/inactive, char walking, etc)
|
|
@ -0,0 +1 @@
|
|||
uid://bjwij2j2jv5u8
|
Loading…
Add table
Add a link
Reference in a new issue