Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

SDK v2 - IRuntime.isSuspended property from can't be set #8223

Closed sotano42 closed 3 weeks ago

sotano42 commented 3 weeks ago

Problem description

Property isSuspended from IRuntime can't be set to pause the execution. SetSuspended is an official feature from SDK v1 that must still be available.

image

Attach a .c3p

Project: test-pause.zip Addon: singleGlobalPlugin-zipped.zip

Steps to reproduce

  1. Install the attached global plugin sample
  2. Open the attached project
  3. Run the project and then open the console.

Observed result

Construct can't be suspended from scripting. It's highly important that this feature works since the integration with 3rd party APIs sometimes requires you to react to DOM events and suspend the engine execution untill the 3rd party API sends a message to resume the game.

Expected result

IRuntime.isSuspended Property must be writtable.

More details

r406-2 Beta

System details

View details Uncaught (in promise) TypeError: Cannot set property isSuspended of # which has only a getter at SingleGlobalInstance.Pause (actions.js:9:27) at EventBlock._RunActions_Fast (eventBlock.js:26:466) at EventBlock._RunAndBlock (eventBlock.js:25:88) at EventBlock.Run (eventBlock.js:22:11) at EventSheet._ExecuteTrigger (eventSheet.js:19:154) at EventSheet._TriggerForClass (eventSheet.js:13:302) at EventSheet._Trigger (eventSheet.js:12:404) at EventSheetManager._Trigger (eventSheetManager.js:15:90) at C3Runtime.Trigger (runtime.js:108:165) at C3Runtime.TriggerAsync (runtime.js:109:435)
AshleyScirra commented 3 weeks ago

This is already supported in the latest releases via runtime.sdk.setSuspended().

sotano42 commented 3 weeks ago

@AshleyScirra thanks. Is there a way we could know when these features release? I'm constantly browsing the documents and releases log and never figured out this feature was moved to an SDK object.

AshleyScirra commented 3 weeks ago

Look at the changelog entries marked SDK.