how can i refence existing object by code

Get help using Construct 2

Post » Fri Nov 15, 2013 2:51 pm

Hello,
I just downloaded the program and I find it very interesting.
I have read a bit 'of documentation about but still I could not understand
How can I programmatically referencing existing objects in the game?
the only way to write code is to write a javascript plugin?
B
3
Posts: 4
Reputation: 183

Post » Fri Nov 15, 2013 7:14 pm

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Nov 17, 2013 1:44 am

Thank you,
but I have not found anything in that guide about referencing objects programmatically
B
3
Posts: 4
Reputation: 183

Post » Sun Nov 17, 2013 2:00 am

? Maybe explain your question in detail, because the way you describe it is simple picking of objects in the event sheet. If you wanna add custom javascript functions then yes, you have to write a plugin - most stuff can be done through the event system, though.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sun Nov 17, 2013 7:43 pm

I Have to use custom javascript.
For example if I have a textbox on the layout I want to understand how to invoke a setText
and if I have a button I want to know how to write code when fired onclick event
B
3
Posts: 4
Reputation: 183

Post » Sun Nov 17, 2013 7:55 pm

You can use custom javascript in the SDK, but Construct 2 IDE is an event-driven system, designed to eliminate the need for coding.

There are numerous other systems that cater for 'proper' coders. This system is designed for maximum accessibility for the majority of non-coders out there.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,375
Reputation: 58,432

Post » Tue Nov 19, 2013 10:33 pm

Thank you,
I like the simplicity of construct2 but would like to use javascript to integrate functionality with smartfoxserver.
So I have to study how to use javascript sdk and how to load external js file
B
3
Posts: 4
Reputation: 183

Post » Wed Nov 20, 2013 12:13 am

The browser object can execute external .js: https://www.scirra.com/manual/110/browser
for security reasons it is safer to code a plugin with the SDK instead
https://www.scirra.com/manual/15/sdk
you should ask your questions about sdk development in the sdk development subforum, though maybe your question is already answered there
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786


Return to How do I....?

Who is online

Users browsing this forum: grigrizljac, korbaach and 16 guests