Skip to reading
GDScript Programming & Godot

PCA Script to GDScript: important differences

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Earlier edition reference / Current 0.86.4.0 property paths > p. 350

Source table from PCA Script to GDScript: important differences, page 329
PCA ScriptNative GDScript
function / endfunc / colon / indentation
let / global / constvar / const; saved game globals through Variable
when room lab loadson_scene_loaded method plus subscription checkbox
set value to 5value = 5
say "text"await Say({"text": "text", ...}) or a character proxy Say method
Automatic action suspensionUse await when the caller needs completion/result
try / catchNo native try/catch; guard and inspect Error/status values
include_script returns IDIncludeScript returns a script-call proxy
Record reference / VM valueNative RefCounted record proxy object
PCA regex match dictionaryNative RegExMatch object
PCA VM debuggerNative Godot debugger for GDScript
PCA array helpers are limitedNative Array/String/Dictionary methods are available

Do not translate a script by changing function to func and leaving everything else alone. Event wiring, waits, variable lifetime, helper capitalization and return contracts need deliberate conversion.

Page 329 of 378Permalink
Go to page