[Plugin] Smart Random

Post your completed addons to share with the community

Post » Tue May 17, 2016 10:52 pm

@blackhornet I got the random part sorted out but for the life of me I can't see to sort out why some of my layouts are adding more than one to the global variable of score. I've followed examples and they look the same to what I've done but know I must be missing something.

My capx is at https://www.dropbox.com/s/4aeuxdgbvht0d ... .capx?dl=0

If you don't mind looking I would be most appreciated. I took it down to just two layouts for the time being. My goal is to have the user drag x number of items into dropbox defined at the top of each layout then when they have completed that they add 1 to their total score. Once the total score equals 8 they would be take to end game layout.
B
30
S
10
G
3
Posts: 75
Reputation: 3,558

Post » Tue May 17, 2016 11:15 pm

The problem is you aren't disabling your dropbox.score check in Main2. Event 10 keeps running until it hits 5 because of your Wait 2 seconds. Use a Group and move event 9 into it and disable it as the first action. That will stop that code from running repeatedly while the Wait is running. Be sure to reset it "On startup". Also don't restart BHTSmartRandom (Main1 - event 1), or that will reset the counter and break the mechanism.
ImageImageImage
B
71
S
22
G
248
Posts: 3,759
Reputation: 138,069

Post » Wed May 18, 2016 12:11 am

@blackhornet Sorry to be dim but when you say disable dropbox.score what do you mean? the wait 2 seconds, destroy dropbox after adding to sCore or is do you mean to disable txtCount > set text to "dropbox.score"? I've pulled the reset of BHT off of main2, not sure why it was still there. Even when I pull the wait 2 sec on main 1 I am getting a score of 3 so I'm pretty sure I'm not comprehending correctly.
B
30
S
10
G
3
Posts: 75
Reputation: 3,558

Post » Wed May 18, 2016 12:48 am

ImageImageImage
B
71
S
22
G
248
Posts: 3,759
Reputation: 138,069

Post » Wed May 18, 2016 2:05 am

@blackhornet Oh wow, that is awesome I now understand.

I didn't realize you could literally deactivate a group.

Much appreciated.
B
30
S
10
G
3
Posts: 75
Reputation: 3,558

Post » Tue Jul 19, 2016 3:10 pm

Hi,
Sorry if its a stupid question put how do i use this? I have put the plugin in my plugin folder but construct isn't recognizing i have it installed?

Thanks in advance
B
5
S
1
Posts: 65
Reputation: 507

Post » Tue Jul 19, 2016 3:23 pm

@ErudioLtd
If the plugin/ behavior has a .c2addon you can drag and drop it into the editor itself.

Otherwise you need to go to the construct 2 install folder, find the folders of plugins or behaviors and copy the plugin/behavior in depending on what it is

Where do you have it installed? to <install path>\exporters\html5\plugins?
B
30
S
10
G
3
Posts: 75
Reputation: 3,558

Post » Wed Jul 20, 2016 10:19 am

@luvleggs

Thanks, didn't realize you just dragged them into the editor.
B
5
S
1
Posts: 65
Reputation: 507

Post » Mon Oct 10, 2016 5:17 pm

Hi, please advise how can I to make random animation of sprite. Suppose i want to make card matching game for 5 pairs and I want them to randomly show animation without duplicate. Appreciate your kind help, i'm very new to c2.
B
13
S
3
G
1
Posts: 2
Reputation: 1,229

Post » Mon Oct 10, 2016 6:35 pm

http://www.blackhornettechnologies.com/Construct2Stuff/FivePairsOfSmartRandomCards.capx

Here's a quick example using frame numbers. You can do exactly the same thing with animations. You use two SmartRandom objects, one for each side of the pair, and generate the one pair-half, then the other pair-half. Use a function to decode the number to an animation name, instead pf a frame number.
ImageImageImage
B
71
S
22
G
248
Posts: 3,759
Reputation: 138,069

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests