
mgodsell1973
United Kingdom
Asked
— Edited

Hi guys and galls,
I am writing a script for K9, that depending on which glyph he sees first determines what he does next. now I am taking this step by step to increase my learning of ez script, so the plan is as follows.
When asked to "patrol", he wanders off and looks for glyph 3, then moves on looking for glyph 4, then glyph 2, then back home to glyph 1, with actions at the stops.
Now I have written what I believe to be the code and uploaded to the cloud, but, I just want a sense check to see if this is the right direction, or is there a better way to do this.
Thanks in advance for your patience whilst I am learning :-)
I wouldn't mind except I really don't have much time today... It is something that I would have to sit down and think about for a while before putting "pen to paper" so to speak...
I'll have to get back to you...
OK thanks Richard, i will have a play later, but anything that you can do is much appreciated.
you are definitely an asset the the forum as a friend and a source of knowledge
:)
It always sounds more complicated than it is. The reality of it is that each glyph would have a variable set, i.e. $Glyph1Seen = 1
Each Glyph would begin with
This way, if unseen the script wouldn't run. Or use 0 not 1 and if it hasn't seen it run some code...
For glyph 2 it;s as simple as
If Glyph1 is unseen (i.e. 0 as set in the init script or script which starts this process) it doesn't do anything for Glyph 2. Use similar for Glyph 3 and 4...
See... Even I made it more complicated than it has to be....
With what Rich has here I think you can get a good start on what you want to accomplish....
Well, have to do some work...
Cheers
WOW, that gives me something to get my teeth into. thanks @Rich
once again, thanks @Richard R for your time and patience
i will revert with (hopefully) a video of K9 doing this thing of protecting the DR
Hi there @Rich,
If I am reading your examples right, the following should work
This can tgen be tailored and added as required, what do you think. Am I on the right track.
Are you looking for the glyphs in order, i.e. Glyph 1 then 2 then 3 then 4?
Think logically and you'll get it working the way you want. IFs are pure logic and work the same way we think.
For instance, IF you are looking for the glyphs in order. You spot 1, you remember that (so you save it to a variable). You continue looking, you find glyph 3, you think "hmm, did I see glyph 2?), another IF. etc.
To find them in order...
Set the ground work first by adding in some script to the Glyph part of the camera control. Something as simple as; Glyph 1
Glyph 2
Glyph 3
Glyph 4
Use of AND and OR in the IF will reduce the number of IFs needed as will correctly ordering them. The IF is read in order and once one IF or ELSEIF returns true it ignores any others below it.
I don't have the time right now to properly think about the best order or the best operators to use in the ifs but hopefully the above should be a start and possibly help you understand that IFs work the same way as we think.
For more than one AND or IF read the statement back and see if it makes sense.
for instance, IF($x < $y AND $y > 100 OR $y > 200) that would only be true if $x was less than y and $y was more than 100 OR if $y was over 200. So if $y was 201 it would be true regardless of if $x was less than $y. If $y was 103 but $x was 104 it would be false.
Hope that's clear. If not, check my topics, I did write one on IFs and how to use them which may help you in your glyph hunt script.
thanks Dude, again something to get my teeth into and my head around.
the end concept is to have K9 leave the Tardis (Glyph 1) and then depending upon which of the remaining 3 glyph's he finds does a different routine.
i.e if he leaves the Tardis and locates glyph 4 first he will then attack the dalek and then check on the Dr (Glyph 3) and then return home, but if he spotted the Warning (glyph 2) then he would move on to attack the Dalek and then check on the Dr, returning back to the Tradis after checking on the Dr each time.
i understand that this is a massive programming challenge for me, but if you don't push yourself you don't learn, right.
i totally appreciate all your time a assistance in my journey