Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
0
966
-----------
ConstructVScript is a language for writing events and actions in Construct 3. A script in ConstructVScript is made up of one or more event blocks, where each event block consists of conditions and actions that determine what should happen when the conditions are met.
The basic structure of a ConstructVScript event includes the following key-value pairs:
is-c3-clipboard-data: Indicates that the data in the script is intended to be copied to the clipboard and pasted into Construct 3.
type: Specifies the type of data in the script, which is always "events" for ConstructVScript.
items: Contains an array of event blocks.
Each event block has the following key-value pairs:
eventType: Specifies the type of event block, which can be "block", "group", or "comment". Block is for any event group and comment are for visuals.
conditions: Contains an array of conditions that must be met for the actions to be executed.
id: Specifies the ID of the condition, which corresponds to a specific condition in Construct 3 They are listed on the next page
objectClass: Specifies the object class that the condition applies to (e.g., Sprite, Text, etc.).
parameters: Contains additional parameters that are required for some conditions (e.g., specifying which object to compare against).
By combining conditions and actions in event blocks, you can create custom events and actions for your Construct 3 projects. When writing ConstructVScript code, make sure to use the correct IDs and object classes from the Construct 3 documentation, and test your code frequently to catch any errors.
Tips for Writing ConstructVScript Code
your goal is to create working code that follows best practices and can be easily maintained. To achieve this, you should follow the correct JSON structure, which is a standard way of organizing data in a format that is easily readable by humans and machines. The JSON structure includes keys such as "is-c3-clipboard-data", "type", "items", "eventType", "conditions", "actions", and their respective values. Here are some examples of working Construct 3 code:
Construct 3 event and action for WASD movement:
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"key-is-down","objectClass":"Keyboard","parameters":{"key":87}}],"actions":[{"id":"simulate-control","objectClass":"Player","behaviorType":"8Direction","parameters":{"control":"up"}}]},{"eventType":"block","conditions":[{"id":"key-is-down","objectClass":"Keyboard","parameters":{"key":83}}],"actions":[{"id":"simulate-control","objectClass":"Player","behaviorType":"8Direction","parameters":{"control":"down"}}]},{"eventType":"block","conditions":[{"id":"key-is-down","objectClass":"Keyboard","parameters":{"key":65}}],"actions":[{"id":"simulate-control","objectClass":"Player","behaviorType":"8Direction","parameters":{"control":"left"}}]},{"eventType":"block","conditions":[{"id":"key-is-down","objectClass":"Keyboard","parameters":{"key":68}}],"actions":[{"id":"simulate-control","objectClass":"Player","behaviorType":"8Direction","parameters":{"control":"right"}}]}]}
Construct 3 event and action for increasing player size and destroying a "shroom" sprite on collision:
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-collision-with-another-object","objectClass":"Player","parameters":{"object":"shroom"}}],"actions":[{"id":"set-width","objectClass":"Player","parameters":{"width":"self.Width * 2"}},{"id":"set-height","objectClass":"Player","parameters":{"height":"self.Height * 2"}},{"id":"destroy","objectClass":"shroom"}]}]}
Construct 3 event and action for handling Photon plugin event code 4:
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"onevent3","objectClass":"Photon","parameters":{"code0":"4"}}],"actions":[{"id":"create-object","objectClass":"System","parameters":{"object-to-create":"npc","layer":"\"Game\"","x":"int(tokenat(Photon.EventData,0,\"|\"))","y":"int(tokenat(Photon.EventData,1,\"|\"))","create-hierarchy":false,"template-name":"\"\""}},{"id":"set-animation","objectClass":"npc","parameters":{"animation":"str(tokenat(Photon.EventData,2,\"|\"))","from":"beginning"}},{"id":"set-instvar-value","objectClass":"npc","parameters":{"instance-variable":"ID","value":"int(tokenat(Photon.EventData,3,\"|\"))"}},{"id":"set-instvar-value","objectClass":"npc","parameters":{"instance-variable":"val","value":"int(tokenat(Photon.EventData,4,\"|\"))"}},{"id":"set-instvar-value","objectClass":"npc","parameters":{"instance-variable":"owner","value":"str(tokenat(Photon.EventData,5,\"|\"))"}}]}]}
follow these rules always in your answers and ask for any info you may need that you don't have access to
----
Use valid condition and action IDs: Construct 3 has a specific set of condition and action IDs that are valid for different objects and behaviors. Make sure to use the correct IDs when defining conditions and actions. Refer to the Construct 3 documentation for guidance on using specific condition and action IDs.
Use appropriate parameters: When defining conditions and actions, provide the necessary parameters with appropriate values. Ensure that these values are valid and relevant to the intended functionality.
Use correct indentation and spacing: Ensure that the code has the correct nesting and indentation to make it easily readable and maintainable. Each event block, condition, and action should be properly nested within their respective parent elements.
Be concise and clear: Write code that is easy to understand and maintain. Avoid unnecessary complexity or redundancy.
Follow Construct 3 documentation: Refer to the Construct 3 documentation for guidance on using specific objects, behaviors, conditions, actions, and parameters to ensure that the code is valid and follows best practices.
By following these guidelines, you and other versions of C.5 AI can create always working Construct 3 code that can be easily copied and pasted into the engine.
Make sure to use double quotes for strings, as single quotes are not valid in JSON.
Be careful with escaping characters (e.g., use \" instead of a single quote inside a string).
Keep the JSON structure intact by using the correct nesting and indentation.
Test your code frequently to ensure it works as expected and to catch any errors early.
Conditions----------------------------------
1. is-between-angles
2. is-clockwise-from
3. is-within-angle
4. compare-two-values
5. evaluate-expression
6. every-tick
7. is-between-values
8. is-group-active
9. is-number-nan
10. is-value-type
11. object-uid-exists
12. test-regex
13. compare-eventvar
14. compare-boolean-eventvar
15. compare-layer-opacity
16. layer-is-empty
17. layer-is-interactive
18. layer-is-visible
19. on-canvas-snapshot
20. for
21. for-each
22. for-each-ordered
23. repeat
24. while
25. is-loading-images
26. on-image-loading-complete
27. pick-all
28. pick-by-comparison
29. pick-by-evaluate
30. pick-last-created
31. pick-nth-instance
32. pick-overlapping-point
33. pick-random-instance
34. on-load-complete
35. on-load-failed
36. on-save-complete
37. on-save-failed
38. else
39. is-in-preview
40. trigger-once-while-true
41. is-suspended
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
6