[Plugin] Nickname, [Behavior] Nickname

Post your completed addons to share with the community

Post » Mon Dec 24, 2012 6:56 am

First thanks to rexrainbow (Youre my hero)

@noonche

Sure with this plugin is everything possible ;)
The thing is Im bad at explaining things. So if you grant me a .capx as an example I make you an example ;)

Also I try to describe it shortly:
- Subevent: Pick all instances by name out of family
- Action: Set Value "family.UID" to "20" |or| family compare instance variable "Fuu" to 20

   localboss2012-12-24 07:01:23
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Mon Dec 24, 2012 7:18 am

So, the problem seems to be that you must place an instance of anything that will be "nicknamed" into the layout where it will be created.

Here's a project with three layouts.

https://www.dropbox.com/s/r5rxpn95z1czkot/nickname_test.capx

One works because it has the two nicknamed sprites placed. "LayoutWorks"

One just tries to just create the nicknamed sprites but that doesn't work. "LayoutBroken"

The final layout uses an EventSheet ("EventDecls") to try spawning a copy of everything that needs to be nicknamed and then destroys it. This also doesn't work.

Do we have to place all these instances in every layout? Is there no way to get around it? That will be very error prone in projects with a large number of layouts and a large number of objects that will be spawned via nicknaming.

Thanks guys.
B
3
Posts: 4
Reputation: 283

Post » Mon Dec 24, 2012 7:28 am

oh something bigger, give me some minutes pls
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Mon Dec 24, 2012 7:39 am

https://www.dropbox.com/sh/mu6x5m9j2w89jth/LDkhS38Vi0

First, why you use 3 layouts ? But ok, yes the one you need must be in every layout.. Or I don't know another way, but that's no problem just copy them, they don't need any save or download from the user more..




Any more problems with it ?

Edit:
The problem is, that behaviors are not global but I got an idea.
   localboss2012-12-24 07:42:28
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Mon Dec 24, 2012 7:55 am

I'm just using the 3 layouts as examples of what works and what doesn't.

It's a problem in any game with a lot of layouts because manually adding all those objects to each layout is time-consuming and error-prone.
B
3
Posts: 4
Reputation: 283

Post » Mon Dec 24, 2012 8:02 am

I know what you mean, I tried a bit around but at the moment I don't get the right idea.. Write me a Pm and we can talk a bit about the problem and don't spam this thread :D
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Mon Dec 24, 2012 8:12 am

God damn have it, how could I forget that :D

https://www.dropbox.com/sh/mu6x5m9j2w89jth/LDkhS38Vi0 :The nickname_test..


Just set the images that you will keep to global, the example shows you how it works
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Mon Dec 24, 2012 5:33 pm

Thanks!

One note though, you have to load into a layout where the instances are placed in order for this to work. I guess I will try to make some kind of "loading/setup" layout that I transition through before I go to my actual first layout.
B
3
Posts: 4
Reputation: 283

Post » Wed Jan 30, 2013 6:06 pm

Hi, I'm using C2 r116 64 bits and it seems that something is wrong, this is my code:
On start of layout >>
**assign nickname "DUDE" to "object1"
**create "DUDE" at(500,500) on layer 0, then put into family PLAYER1

the object is created but never gets to the family. The object is not following any event related to PLAYER1.. even if I put a:

**destroy PLAYER1

OR

**pick all "DUDE" instances into family PLAYER1
**destroy PLAYER1

the object is still there... any help?
Image
B
42
S
11
G
5
Posts: 269
Reputation: 10,880

Post » Wed Jan 30, 2013 11:40 pm

@danuyos


It works fine in my testing. Please provide a capx file.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: DragoMej and 0 guests