[Plugin] Nickname, [Behavior] Nickname

Post your completed addons to share with the community

Post » Thu Feb 06, 2014 10:33 pm

@Jase00 are you using the behavior, if so, i believe you can just check what the nickname property is, so if nickname = "" > its empty
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Thu Feb 06, 2014 10:47 pm

@vtrix , Ohh I'm using the plugin :P But thank you!

My scenario involves having an item spawn from an Array, e.g. "hat" or "pistol", and I can use the Nickname plugin to spawn the item correctly (and if the array is blank, I do a "[Negate]Is Array (0,0,0) = "" " like you've sorta mentioned :P), but if for whatever reason an items' nickname doesn't actually exist, it glitches things up pretty bad as the following conditions that would affect the newly spawned item (setting the spawned objects properties), would go to ALL objects that exist within the family of the item I attempted to spawn.

The reason this isn't TOO big of a problem, is because I don't really think there'll be much chance of the Array having an non-existant item within it, but if there does come some form of case (E.G, custom-made items in-game that a user can specify their own nickname for), then there would be a need for some form of "Does nickname exist?" action.
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Thu Feb 06, 2014 11:05 pm

i suggest you use the behavior too, its just an addon to the plugin, you can better see what nickname each object has, (test it on a new project),
but for you case, you could also just redo the random pick, if arrayvalue is "", or maybe.. they get nothing!
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Fri Feb 07, 2014 3:56 am

Update:

Please update nickname plugin and nickname behavior
- pick instances by invalid nickname now will clean the SOL of target family.
- add condition: is nickname valid , return true if this nickname is valid.
- add condition, action: pick instances by nickname matched
Designer could pick instances (from more then one type) by nickname which matched the target string.
Capx
In this demo, there are 3 object types, these nicknames are "[obj][A]", "[obj]\[\B]", "[obj][C]".
Pick the matched instances with "[A]" will get the instances with nickname "[obj][A]" only.
Pick the matched instances with "[obj]" will get the instances with nickname "[obj][A]", "[obj]\[\B]", "[obj][C]".


@Jase00

Have a nice day~rexrainbow2014-02-07 04:07:56
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Fri Feb 07, 2014 6:03 am

Update

Please update nickname behavior.
Add "Mode" property, It had 2 mode,
- "Manual" mode is older mode, assign nickname by user.
- "SID" mode will assign an unique number (sid, generated by engine actually) automatically.

Demo capx
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Sat Feb 08, 2014 6:46 pm

@vtrix
Ohh, I didn't explain things properly; I'm using both the plugin + behaviour as required, and have implemented it into my game and it works perfectly, I need a way to detect if a nickname exists or not to prevent some unneccecary actions being fired/put up an error message or something :P

@rexrainbow
Thank you so much, works perfectly! You are a legend!!
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Sun Feb 23, 2014 10:47 pm

@rexrainbow

im having trouble with creating nicknamed instances from another layout
(meaning a layout where i place my objects) previously i put all my objects in first layout, so it wasn't an issue
but its getting to complex.

i tested system create object and this works, so my question, is it a plugin limitation or something that could be fixed/added ?
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Mon Feb 24, 2014 1:30 am

i just created an example of usage for automatic nickname
with this you can put all you objects from a family in a list and create from list, without any naming

in example
a "for each sort" (sort by object.x )
put automatic sid to array, make dropdownlist from array
create object from list

https://dl.dropboxusercontent.com/u/61666915/objectlist_nickname.capx
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Mon Feb 24, 2014 3:34 am

@vtrix

About the fail of instance creating.
You might use nickname behavior to register the nickname (and it's mapping object-type), and it need to be run once. (In your case, it had not been run once.)

A solution is using nickname plugin's action: assign nickname to force register the nickname. Or preload (run once) these object-type before create it.
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Mon Feb 24, 2014 9:16 pm

thanks!, tested and working
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Josek5494 and 1 guest