[Suggestion]"Object's Name" parameter filed

Discussion and feedback on Construct 2

Post » Sun Apr 20, 2014 9:36 pm

Hi,

I would like to suggest adding an extra optional parameter input field, which would allow to pick/create object via its written name.
I have large number of Tiled Backgrounds Each requiring to be created on the run. My option right now is to make loads of events, each creating one of those tiled bg's. With that extra parameter filed, I would cut down on events to just one ( with the name being called from variable, that holds different value per sprite that is used as spawn). Same would go for PICKING, FOR EACH loop, and other that require to pick object from the pop up box.

What do you guys think, would it be useful for ya too?
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Apr 21, 2014 6:38 am

I think I see what you are getting at. You don't want to hard code all the Event blocks for creating your different Tiled Background Object Types. That seems like a reasonable and worthwhile addition to any of the Condition or Action dialogs that require you to pick a Plugin Object Type. This would definitely be more efficient and result in a more minimized Event list. I would say that this would be a very nice dynamic feature that would be beneficial to many people.
B
9
S
2
G
1
Posts: 41
Reputation: 708

Post » Mon Apr 21, 2014 8:11 am

Try this 3rd plugin - nickname
B
108
S
26
G
272
Posts: 4,472
Reputation: 152,279

Post » Mon Apr 21, 2014 8:17 am

For picking you should use families and families instance variables.
Also do you really require several tiled background and can't you make use of the "Load image from URL" action with project files for example ?
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Mon Apr 21, 2014 12:10 pm

Yo,
Thanks!

@509Dave16 Yeah, I just want to make a loop.

@rexrainbow cheers, will try it out.

@Kyatric I do use, and I do require :) However, here I don't know if I can have several instances of the same tiled bg, but for each one of them load different image. If you're saying that's possible, then I will try this too.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Apr 21, 2014 12:14 pm

megatronx wrote:I don't know if I can have several instances of the same tiled bg, but for each one of them load different image.


As I can remember You can't do that in C2. It was possible in CC to have multiple instances of same tileBG with different texture on each of them, but not in C2 - at least while I was testing it few months ago.
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Mon Apr 21, 2014 12:36 pm

shinkan wrote:
megatronx wrote:I don't know if I can have several instances of the same tiled bg, but for each one of them load different image.


As I can remember You can't do that in C2. It was possible in CC to have multiple instances of same tileBG with different texture on each of them, but not in C2 - at least while I was testing it few months ago.


Cheers. Will try rex's plugin. Seams like it's good temp solution.

[email protected] Yeah, I tired that plugin and it will do. Thanks again @rexrainbow !
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Apr 21, 2014 6:45 pm

@megatronx - I had this very problem as well. I tried Rexrainbow's plugin and it works well enough for creating object dynamically it was a little short of what I needed. I found a pretty simple work around though that might help. It a bit of extra code but i keep an extra event sheet that in it I create a function for each object (Sprite, Dictionary, Text, etc) with the same name and just make the return value its As.JSON element. I can them call this function where ever based on the name of the object I want and get its JSON string and load it to a temp object as needed. I also over load the function with useful commands for instance my functions that reference dictionaries all have Get, Set depending on the number of params I pass the function. This makes working with dictionairies dynamically via ajax so much easier as I feel data management is poorly lacking (currently) in C2. This is the only way I know of for now to dynamically reference objects in C2 until they are able to put it in natively.

Example Dictionary Function Declaration:
Image

If the function"PlayerSettings" is called with no Parameters then it returns the JSON string of the object
If it has 1 param then use that param as the Key and return its value
If it has 2 param then I set the value

Example Usage 1
Image

Each Setting Dictionary gets flags added to it dynamically

Example Usage 2
Image

On start of layout I call the function by its string name and set the player name

While I use more for data manage management I feel it would work for objects as well. Hope this helps
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Mon Apr 21, 2014 10:06 pm

This is redonk. Should just be able to store multiple named images in a single TiledBG. Same for tilemaps...
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Mon Apr 21, 2014 10:17 pm

MadFactory wrote:This is redonk. Should just be able to store multiple named images in a single TiledBG. Same for tilemaps...


Agreed


@troublesum thanks :)
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 23 guests