Page 1 of 1

Find Object Game - changing the increment settings

PostPosted: Mon Jan 23, 2017 3:19 pm
by bnutton1
Hi Kolor Community,

I have the Find Object Game plugin installed, and I was hoping to get some advice on how I would adapt it so the increment trigger doesn't go off when nb=max, instead triggers when the nb=max hotspot is closed (rather than firing upon being opened which it does)

Any help would be greatly appreciated.

Thanks all

Re: Find Object Game - changing the increment settings

PostPosted: Mon Jan 23, 2017 3:51 pm
by bdd
I think I did not understand your question.

What I understood is that you want the hotspot to be closed before the "nb=max" action is triggered.

But it is already the case.
Here is the steps done after the last click :
1/ The spot is clicked
2/ The internal counter is incremented
3/ The spot is removed
4/ the message is updated with the new counter
5/ the custom action is called

Can you tell me more about your need, because I think I did not understand them ?

Gérald

Re: Find Object Game - changing the increment settings

PostPosted: Mon Jan 23, 2017 4:06 pm
by bnutton1
Hi Gerald,

Thanks for taking the time to get back to me.

Currently I have 5 point hotspots - all of which when clicked display individual urls in web boxes.

When the "Find Object Game" is complete (all 5 hotspots have been clicked) I want to automatically trigger the end event - which will be to load another web box.

Problem is upon clicking the 5th Hotspot it automatically fires the end trigger of loading another web box. What I would like is for this to be triggered when the user closes the 5th hotspoint - not clicks to open.

Hope this makes a little bit more sense :s

Re: Find Object Game - changing the increment settings  [SOLVED]

PostPosted: Mon Jan 23, 2017 4:43 pm
by bdd
OK, now I understand.

You can't do it through PTP interface.
You'll have to change the generated code once the tour is built.

The plugin code can be changed a little to ease the modifications, but even with a modified plugin, you'll have to edit the xxx_skin.xml file.

1/ Edit the xxx_skin.xml file
2/ Find the action called "incrementcountergame"
Code: Select all
  <action name="incrementcountergame">
    inc(countergamenb);
    txtadd(countergameremovedelements, get(countergameremovedelements), xx, get(%1));
    updatecountergame();

    if (countergamenb == countergamemax,
     xxx your custom action called on the last spot
    );
  </action>

3/ Modify it like this :
Code: Select all
  <action name="incrementcountergame">
    inc(countergamenb);
    txtadd(countergameremovedelements, get(countergameremovedelements), xx, get(%1));
    updatecountergame();
  </action>

  <action name="nbequalsmaxaction">
    if (countergamenb == countergamemax,
     xxx your custom action called on the last spot
    );
  </action>


4/ Find the action called when the Website box displayed on a spot clicked is closed.
It's name should be something like this "closeKolorBoxCallback_websiteViewerXX" where X is a number if you have different website boxes.

5/ Add the following line at the end of the action :
Code: Select all
nbequalsmaxaction();

like this :
Code: Select all
<action name="closeKolorBoxCallback_websiteViewer">
     resumeautorotation(forceplugin);

   set(ptplugin[websiteViewer].isOpen, false);
nbequalsmaxaction();
</action>



It will do what you want, but you'll need to have a different website box plugin for the final displayed box.

Gérald

Re: Find Object Game - changing the increment settings

PostPosted: Thu Jan 26, 2017 2:41 pm
by bnutton1
Brilliant, Thanks Gerald. Worked a treat :)