How do I this?

Get help using Construct 2

Post » Sun Oct 23, 2016 11:46 pm

It is my first time with Construct and there are many things I do not know
the first i need to create an object, but not a specific object, just the one that his name match with the text in the Global Variable
Image
in my case, i just can specify one single object
the other thing is, following a tutorial i have created an rpg inventory, how i do for set the value of the global variable with the name of the object placed in the equipslot of the inventory. so when you put an object on the equip slot in the inventory, then you can make it appear in the game by clicking on it
this inventory uses one single sprite for all the items, and every frame is one single item

this a picture of the inventory on the tutorial
Image
B
8
S
2
Posts: 15
Reputation: 530

Post » Mon Oct 24, 2016 7:22 am

You can't create objects using a text string, so you have to make a condition first then use the create object.

Example:

Code: Select all
Object_to_spawn = GVpcSlot1
        Create object butterfly

Object_to_spawn = GVpcSlot2
        Create object Cat

Object_to_spawn = GVpcSlot3
        Create object Dog


So use your global variables as tests in your conditions and based on that create the correct object.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Mon Oct 24, 2016 12:23 pm

Lol, you know that we have almost 700 pokemons? In that way i have to do it 4200 times, is the only way to do it?
B
8
S
2
Posts: 15
Reputation: 530

Post » Mon Oct 24, 2016 1:59 pm

SacrilAI wrote:Lol, you know that we have almost 700 pokemons? In that way i have to do it 4200 times, is the only way to do it?


:D There might be and actual think there is a 3rd party plugin that can do it, however I can't remember the name of it or whether its can actual do what you need. But maybe someone can remember the name and you can check it out. But by default its the only way that C2s can create specific objects. I do agree with you that it would be a good option to be able to create objects based on an input and pretty sure it have been suggested close to a million times before :D

But the only thing to really keep in mind when designing your game is to take something like this into account, so for instant how do you organize or design a pokemon object so it can handle that many in a way you can work with it.

It is unfortunately one of the lesser good things about C2 in my opinion, the bigger and more advanced your game become, the more you will notice the lack of tools for helping you manage and working with huge projects, its really on a minimum I think. But after a while as you loose control over bigger and bigger projects and scrap them, you will eventually realize that organising and really design things to be able to handle stuff you might add later is crucial for any big projects or they will most likely fail.

Here are 2 tips for you:

1. Do a lot of small independent tests - Analyse you game for elements where you assume problems might occur, obvious this is easier the more experience you have, but for instant if you know that you will need a lot of different units types in your case 700, how can you design such object so you can work with them efficiently, its definitely not a good idea to make 700 global variables to keep track of them, so how do you get around that? And you do this as a separate project simply to test whether its going to work or not, so don't add it in your final project and its best to do it before you even start the project.

2. How do you organize a project so you can find things - In my game Dragonhelm in my description (Which is now abandoned) there is 5657 events. Now imagine finding a specific function or event, if you might not remember exactly what its called, or if you notice a bug in the game, but which event actual caused it?. So spending time on making a system so you know exactly where to look for things is a must. A good idea would be for instant not to mix functions and other types of events etc, but whatever works for you. But this is where C2 really crumbles in my opinion, the lack of tools for helping with this, you are really left with this almost alone.
Last edited by nimos100 on Mon Oct 24, 2016 4:42 pm, edited 1 time in total.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Mon Oct 24, 2016 4:22 pm

SacrilAI wrote:Lol, you know that we have almost 700 pokemons? In that way i have to do it 4200 times, is the only way to do it?


Yeah, use 1 object with 700 frames, or if they animate, with 700 animations.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Oct 24, 2016 5:58 pm

There is a handy Nickname plugin that enables you to create an object by its nickname.
B
16
S
6
G
1
Posts: 29
Reputation: 1,656

Post » Tue Oct 25, 2016 1:42 am

nimos100 wrote:Here are 2 tips for you:

1. Do a lot of small independent tests - Analyse you game for elements where you assume problems might occur, obvious this is easier the more experience you have, but for instant if you know that you will need a lot of different units types in your case 700, how can you design such object so you can work with them efficiently, its definitely not a good idea to make 700 global variables to keep track of them, so how do you get around that? And you do this as a separate project simply to test whether its going to work or not, so don't add it in your final project and its best to do it before you even start the project.

2. How do you organize a project so you can find things - In my game Dragonhelm in my description (Which is now abandoned) there is 5657 events. Now imagine finding a specific function or event, if you might not remember exactly what its called, or if you notice a bug in the game, but which event actual caused it?. So spending time on making a system so you know exactly where to look for things is a must. A good idea would be for instant not to mix functions and other types of events etc, but whatever works for you. But this is where C2 really crumbles in my opinion, the lack of tools for helping with this, you are really left with this almost alone.

Thanks for your tip, actually i have a good system to organize my project, I'll find that plugin
B
8
S
2
Posts: 15
Reputation: 530

Post » Tue Oct 25, 2016 1:46 am

Message: SacrilAI can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
benpalgi wrote:There is a handy https://www.scirra.com/forum/plugin-nickname-behavior-nickname_t74522 Nickname plugin that enables you to create an object by its nickname.

Thanks so much, is what i need
B
8
S
2
Posts: 15
Reputation: 530

Post » Tue Oct 25, 2016 1:49 am

99Instances2Go wrote:
SacrilAI wrote:Lol, you know that we have almost 700 pokemons? In that way i have to do it 4200 times, is the only way to do it?


Yeah, use 1 object with 700 frames, or if they animate, with 700 animations.

I need to set skills and different behaviors for ech one, i don't think I can do it in that way.
B
8
S
2
Posts: 15
Reputation: 530

Post » Tue Oct 25, 2016 1:41 pm

Sure you can, you have instance variables (and arrays) to do that. And you will end up with 700 times less code.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Next

Return to How do I....?

Who is online

Users browsing this forum: matriax and 21 guests