-
-
Notifications
You must be signed in to change notification settings - Fork 19
Hotspot
Each hotspot you create will have its own script file (based on HotspotTemplate.gd). This is created with the name you give the hotspot in the Create hotspot popup prefixed by Hotspot: E.g. HotspotWindow.gd, HotspotSky.gd.
- on_interact() void
Called when "popochiu-interact" (set to Left Mouse Button in the project's Input Map) is used on the hotspot. E.g. You can use it to make the PC do something with the hotspot when players interact with it.
By default this calls to
.on_interact()
. In case you don't overwrite this, it will use the default PopochiuClickable.gd on_interact() call, which shows a game message.
func on_interact() -> void:
yield(E.run([
C.walk_to_clicked(), # The PC walks to the clicked hotspot's walk_to_point property
'Player: This window is closed.',
"Player: Can't open it!"
]), 'completed')
- on_look() void
Called when "popochiu-look" (set to Right Mouse Button in the project's Input Map) is used on the hotspot. E.g. You can use it to make the character say something about it.
By default this calls to
.on_look()
. In case you don't overwrite this, it will use the default PopochiuClickable.gd on_look() call, which shows a game message.
func on_look() -> void:
E.run([
C.face_clicked(),
'Player: The sky is beautiful this morning.',
])
-
on_item_used(
item: PopochiuInventoryItem
) void
Called when an inventory item is used on the hotspot. Use the script_name
property of item
to see which was used.
By default this calls to
.on_item_used(item)
. In case you don't overwrite this, it will use the default PopochiuClickable.gd on_item_used(item: PopochiuInventoryItem) call, which shows a game message.
func on_item_used(item: PopochiuInventoryItem) -> void:
if item.script_name == 'Lever':
E.run([
C.walk_to_clicked(),
C.face_clicked(),
'Player: Ugh!',
'...',
'Player: I think the window is stuck with something very strong.'
])
else:
.on_item_used(item) # Call the parent's on_item_used method