I have two questions on some expressions.

Get help using Construct 2

Post » Mon Mar 19, 2012 12:58 am

I'm fairly new to Construct 2, and have 2 questions.

______________________________________________________________

I am trying to do a menu that has a couple things you can choose from, I have a global variable that sets to what is selected. Now on click I want it to spawn that item. How could this be done?
______________________________________________________________


______________________________________________________________

I used to advance program in GameMaker:HTML5(scripting) and I was wondering how do I do a "On create event like GameMaker"??? So lets say I create a new object(In game) and on this creation I want to execute some code with it. How could this be done?
______________________________________________________________

Thank you, DylanT
B
5
Posts: 23
Reputation: 446

Post » Mon Mar 19, 2012 1:17 am

On click set global to 1
global = 1 system create object, set global to 0
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Mon Mar 19, 2012 1:38 pm

Oh, I get where your coming from.

If Global = 1 then {
Spawn this...
}

Ok I was thinking about this too, but thought there would be a 'custom' spawn. Thank you newt.

Also, "to anyone" Is there an "on create object" command I have not been able to get it... So when I spawn an object I trigger "this" ?
B
5
Posts: 23
Reputation: 446

Post » Mon Mar 19, 2012 1:54 pm

Sorry, no on create. Thats the variables job.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Mon Mar 19, 2012 2:44 pm

[QUOTE=Dylantechy]Also, "to anyone" Is there an "on create object" command I have not been able to get it... So when I spawn an object I trigger "this" ?[/QUOTE]

If you want something to happen every time you spawn a specific object, just add another event under the same condition.

[code]
Global variable = 1:
-> Create object X
-> Do other things
[/code]

Or, if you want it to happen every time you spawn ANY object, just make another variable that changes every time you spawn an object.

(Or if you have a license, you can use families)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Mar 20, 2012 1:38 pm

Ok thank you everyone.
B
5
Posts: 23
Reputation: 446


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, jeffige, LeFuji, plinkie, Radulepy and 1 guest