So…if a number of points must be given to a property(saying that you do something that will grant you points and the points are tracked on a property, "Points") and we decide to use a counter for this, we have a limitation, we can only increment by 1 each time so how can we increment it by 5? Idea: increment using a trigger that uses recursion to repeat its attempts 5 times, in other words we can view it like this:
trigger → +1 to counter
trigger, re-run → +1 to counter
and this will continue until we reach our fifth attempt and say in other words:
trigger → +5 to counter
Even though we can only do 1 we did 5 because we repeated the same task. The problem:
In order to achieve this we need to tell the trigger what the limit is or what to look for before it does it, in other words:
As long as the points/counter doesn’t equal what it used to equal + 6(if it equaled 5 beforehand, it should repeat the task as long as it isn’t more than 10, which would be 5+6 which = 11) then repeat.
I’m not entirely sure if that can be done because if it is doing recursion then this is what will be done:
set newpoints to [get property "points" + 6]
if [get property "points" < newpoints] then
broadcast on channel "trigger trigger"
The above sets newpoints to 11, but if it were to be repeated then the newpoints would become 12 as it is constantly updating the property value and the variable value.
I could terribly be wrong about this(if I am please tell me…), or I could be terribly right, but either way I do need help.
Thank you.
-VALUEX
PS:
I’m not sure if I am supposed to add tags to this help request…or what tags…
You could try to just have a counter that tracks how many times the trigger triggers, use a trigger to increment the counter and the points property and have a system that stops after 5 increments, so the points are incremented exactly 5 times, even though each individual increment is by 1(?)
I might just be trying to say what ShadowDragon44 said above so kudos to him and anyone who is replying to this topic (for a potential solution). But, i don’t think you need block code.
You just need 1 triggers, 2 counters, 1 wire repeater, and 1 property. lol
So basically, you have a trigger that gets triggered after an event happens [1]. Then when the trigger gets triggered, it increments both the score counter(a) and the incrementation counter(b). Counter(a) tracks the property [2]. The property is a number type property with whatever scope you want and it broadcasts on the same channel that the event that triggered it did [3]. Now, for counter(b). Set it to a target value of 5 and when target value is reached, broadcast on a channel (I used “scoreIncrementOver”) and also have the counter(b) reset when receiving on this channel (“scoreIncrementOver”). The trigger should deactivate when receiving on this channel (“scoreIncrementOver”) as well. Finally, the wire repeater [4]. Wire the counter to the wire repeater [target value reached → repeat wire pulse] and wire the wire repeater to the trigger [wire pulse repeated → activate trigger. Make the wire repeater have a delay of 1 or less seconds. And I think that should be all!
Sorry for all the side-note thingies! Good day/night/your time to you as well! If you need pics, I can get some.
in this example, I’ll say, someone scores a goal in blastball ↩︎
unless you use wires for this, then you can broadcast on a new channel. Also, if the blastball is scored, then I would broadcast on channel “triggerRecursion” and that would also be the channel the property broadcasts on. ↩︎