[Plugin] Nickname, [Behavior] Nickname

Post your completed addons to share with the community

Post » Mon Oct 26, 2015 3:42 am

Shadowblitz16 wrote:@rexrainbow
ok Is there a way to address a object name(not nickname) by a string
and address its events, actions, and expressions with that string?

If not could you add that feature?


I am not sure what you want. Object name will be changed after exporting with minify option, so that I added this nickname plugin to address object type by another alias string. And it is only useful while creating instance by an input string.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Mon Oct 26, 2015 4:51 am

basically I want to be able to spawn a object via a string
and then treat that string a that object so I could do something like

spawn string "player"
set "player" animation to "spin"

thats just an example but it would be really nice

it would be probably better to make a different plugin for this as it would use real names instead of nicknames

but It would be a nice addiction to just be able to spawn a object like this and then set its variables
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Mon Oct 26, 2015 6:00 am

@Shadowblitz16

You might use a family for all types of sprite, like

[niclname] Create instance "player" into family_sprite
set family_sprite animation to "spin"
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Tue Oct 27, 2015 1:38 am

but then I would need to create a family for every time I create a object
or I would need a large amount of family's
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Tue Oct 27, 2015 3:16 am

@Shadowblitz16

You only need to create a family which contains all (object) types of sprite.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Tue Oct 27, 2015 3:30 am

I basically want to address them separately though a variable not a family

the problem with family's is that they can't be the objects can't be addressed by a variable

the problem though with the nickname plugin is you can't set actions for that object once you spawn it with the nickname
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Tue Oct 27, 2015 4:13 am

@Shadowblitz16

All actions, conditions, expressions are working with object type (or SOL), which is the core concept of C2. That's why action of creating instance in nickname plugin will conduct to object type.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Tue Dec 22, 2015 8:23 am

I tried to use "create instance into family" action,it's not working.
(the objects are created, but my family is still empty)
but if I try your example, it's working correctly.
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
46
S
10
G
1
Posts: 280
Reputation: 5,202

Post » Tue Dec 22, 2015 12:26 pm

@puntodamar

Do you have a very simple capx for this bug reporting?
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Tue Dec 22, 2015 1:02 pm

"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
46
S
10
G
1
Posts: 280
Reputation: 5,202

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest