Page 2 of 2

Re: making a script for a ferry to cross water

Posted: Tue Aug 14, 2018 3:55 pm
by Lucy Brown
Hypatia Emerson wrote:
Tue Aug 14, 2018 1:17 pm
Lucy Brown wrote:
Tue Aug 14, 2018 8:31 am
Ok, had a chance to try it out and some odd things are happening!

travelling from an island in the centreish to a shoreline not far from the southern sim edge (4x4) everything works fine, trying to get another ferry to go from shoreline back to the island though no way!, the ferry dives for the sim edge or the corner 0,0,0, I have tried numerous times and consistantly get the same result, any ideas? one would think that if it works fine in one direction then it would the other, baffles me.
Just a wild guess and I may be way off mark but did you by chance shift copy? That could very well do it... I would recommend starting with fresh prim and being sure to reset the script before testing.

I thought that exact thing too, tried it, several times, same results in a big dive for the edge, thanks for your suggestion.

Re: making a script for a ferry to cross water

Posted: Tue Aug 14, 2018 3:56 pm
by Lucy Brown
Thanks Graham, I am so lost with scripting.

Re: making a script for a ferry to cross water

Posted: Sat Aug 25, 2018 7:17 pm
by Graham Mills
Apologies for the delay, Lucy. When you get a chance, please try the updated code in the original message.

Thanks

Graham

Re: making a script for a ferry to cross water

Posted: Sun Aug 26, 2018 3:40 am
by Wayfinder Wishbringer
Halloo. If it goes one way, it will go the other. The question is... how are you getting it to go the one way? There are several ways to do that. Whatever method you use has to be reversed. Just remember with scripting... the script only handles one thing at a time. So if you are moving the ferry, question is... physical or scripted movement? If it's scripted movement you are basically telling it repeatedly to move from here to there. To reverse that, you tell it to move from there to here.

For example, a scripted loop works the same forward as backwards, but with reverse logic. Here is the "flowchart" in English so the logic can be seen:

startPos=100
endPos=50
count=startPos
while count is greater than endPos
count=count - 1
move to new position (example <count,y,z> )
loop while

To REVERSE THAT

startPos=50
endPos=100
count=startPos
while count is less than endPos
count=count + 1
move to new position
loop while

It's the same logic, just in reverse.

Hope this helps. : )

If not, post the script that you're using to go one direction, and might be able to help you go other direction. : )

Re: making a script for a ferry to cross water

Posted: Sun Aug 26, 2018 10:04 am
by Graham Mills
The code is appended to an earlier message. Improvements and enhancements welcome -- I'm all too aware of my limitations in this regard ;)

Graham

Re: making a script for a ferry to cross water

Posted: Sun Aug 26, 2018 4:20 pm
by Lucy Brown
Thank you so much again Graham, I will try it out as soon as I can and report back. :-)

Re: making a script for a ferry to cross water

Posted: Mon Aug 27, 2018 7:27 pm
by Lucy Brown
AWESOME, thank you so much Graham, working perfect.

Re: making a script for a ferry to cross water

Posted: Sun Nov 11, 2018 9:12 am
by Lucy Brown
A little bug has been found, some visitors seem to unsit themselves before the ferry unsits them automatically, this causes the start position for the ferry to reset to the point at which the passenger unsat, is it possible to have the script detect this and return the ferry to its original start point?