So I'm still learning construct 2 (been about 2 weeks) and I'm trying to get my head around loops. I'm trying to build a branching outcomes system from scratch (it's probably way above my knowledge level, but I'm forging ahead), and am trying to do something where I have an array. It has a opening dialogue prompt, then 2 choices. But sometimes the choices will have requirements (like 'give me 10 gold'). I want to be able to run a check to see if the player meets that requirement, and, if not, grey it out.
(0,0,0) Hi, want to stay at the inn?
(1,0,0) Yes (10 Gold)
(1,1,0) No (exit)
At (1,0,1) I'd have GOLD, to signify we're looking for Gold (not...Copper or some other resource)
At (1,0,2) I'd have 10 to signify that it's ten of that resource (in this case 10 gold)
So I'm trying to build a for loop that says when you come across a dialogue option, search the Z axis and compare it against global varables to see if PlayerGold>Gold they're charging. If it is, I'll be able to run an event where it's unselectable, if not, and it's clicked, it'll reduce the player gold by 10. That bit I'm not too worried about.
Ultimately I think I can do almost everything, but for some reason I can't get it to search just one axis - I can't figure out how to use loops to limit the search.
I want to do something like:
If ChatArray.X = 1 and ChatArray.Y = 0 Search ChatArray.Depth for CurrentValue="Gold"
Then I'd set a local variable 'resource' to "Gold" at ChatArray.CurZ and local variable 'amount' to ChatArray.CurZ+1 and be able to manipulate the values from there.
Does any of that make sense?
At its most basic - how do I run a loop that searches a at a set X and a set Y position to see if there's a specific string (eg "gold") and, if there is, return that value to a local variable, and the value after it (ie 'the amount of gold as a number) to another variable.
I'd link a .capx, but don't know how yet. Also, the event will look horrendous
Thanks for any help you can offer!