Quick Question: Single Global Function

Discussion and feedback on Construct 2

Post » Fri Oct 18, 2013 4:27 pm

Hi!

I was just wandering if there are any serious repercussions to duplicating the function plugin and removing the "flags": pf_singleglobal.

This would allow me to work a little more Object Oriented as well as use duplicate method names (I hope?). For instance have 2 NPCs with a shoot() function that is specifically their own.
B
18
S
6
G
3
Posts: 30
Reputation: 4,198

Post » Fri Oct 18, 2013 4:39 pm

Just to get the ability to name your own trigger?

The usual method is to go at it from the front, and use an instance variable to pick the instance.

Image ImageImage
B
169
S
50
G
173
Posts: 8,321
Reputation: 110,286

Post » Fri Oct 18, 2013 5:01 pm

Sorry I misused the term instance, I mean an object has the same method name as another. Both included in one layout would give problems.
B
18
S
6
G
3
Posts: 30
Reputation: 4,198

Post » Fri Oct 18, 2013 5:17 pm

Pretty sure that wont work in the engine, but even if it did, it really wouldn't add much functionality.

I mean suppose you want two different object to fire on the same trigger, you would just add actions for both objects in the event trigger.
Image ImageImage
B
169
S
50
G
173
Posts: 8,321
Reputation: 110,286


Return to Construct 2 General

Who is online

Users browsing this forum: Euduardo and 14 guests