Check object types

Discussion and feedback on Construct 2

Post » Fri Sep 28, 2012 1:11 pm

So basically this plugin would have its own method "create object by tag"?
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Sat Sep 29, 2012 1:00 am

@xoros

Yes, before using "create object by tag", user should register tag with object.
B
97
S
22
G
179
Posts: 4,126
Reputation: 104,559

Post » Sat Sep 29, 2012 1:21 am

[QUOTE=xoros] Another problem is perfoming actions on each newly created object. In this particular example - how to make each object reach each destination (the problem is - every time you click on create new object, movement of the prevous one is interrupted) [/QUOTE]

You can use an instance variable to identify each object/frame that is created. I do this for my current project.

So, when object is created [e.g. green_card], you can have the instance variable (IV) set to a new number. You can then use this IV number to identify only that card. Likewise, if different families or groups of cards move to the same location/in the same manner, you can set each new instance of that card/object with the same IV.

Or, if you don't want to set each one manually, you can have a global variable (GV) track the progress of these cards (e.g. create green_card -> +1 to GV). You can then have each IV set to the GV, and use this as a unique card identifier.

So it would look like this:

On Create Green_Card;
     Change GV by +1
     Set IV to GV    --> NOTE: this might need to be an empty subevent,
                                   or one additional indentation

AND

If Green_Card IV = (x)
     Move Green_Card to (x,y)


Something like that.teahousemoon2012-09-29 01:24:08
B
28
S
6
G
5
Posts: 248
Reputation: 5,463

Post » Sun Sep 30, 2012 7:00 am

@xoros

I'll try to make a plugin from your requirement about creating object by tag if you want.

The first step, you need to write down your requirement.rexrainbow2012-09-30 07:00:34
B
97
S
22
G
179
Posts: 4,126
Reputation: 104,559

Post » Sun Sep 30, 2012 10:58 pm

Cool, that will be usefull!

I'll try to define a requirment:

I think it will make sence to implement it as a behaviour, which can be added to basic object types (like families, sprites, tiled backgrounds, text etc.) Methods of the behaviour could be accesed through actions dialogue. Tag could be defiened in the behaviour properties or by an action.

In the actions menu there are 3 methods
1) Create object by tag
2) Set objects tag name
3) Pick objetc by tag (if it makes sence)

rexrainbow, thanks for your help
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Thu Oct 04, 2012 6:01 am

@xoros

3) Pick objetc by tag (if it makes sence)

There are many ways to pick instances, for example: pick by UID, pick by private instance, pick by condition...

What "condition" would you like for picking instances?


BTW, I had implemented "Create object by tag" called "Nickname plugin". I might release it recently.
B
97
S
22
G
179
Posts: 4,126
Reputation: 104,559

Post » Thu Oct 04, 2012 2:28 pm

That's great!

If I understand you right, there could be following conditions for picking up instances:

1) pick all instances with a certain tag: tag>all
2) pick specific instances (e.g. by ID or instance variable) with a certain tag: tag>ID or tag>variable

Looking forwar to test your "Nickname plugin".xoros2012-10-04 14:28:55
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Fri Oct 05, 2012 4:39 am

@xoros

Here it is, nickname plugin and nickname behavior.
B
97
S
22
G
179
Posts: 4,126
Reputation: 104,559

Post » Fri Oct 05, 2012 8:38 am

Thanks, man - that will be extremely useful.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests