making a script for a ferry to cross water

Creating scripts
User avatar
Lucy Brown
Posts: 27
Joined: Thu Jun 14, 2018 1:55 pm
Location: United Kingdom
Has thanked: 47 times
Been thanked: 41 times

Re: making a script for a ferry to cross water

Post 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.
These users thanked the author Lucy Brown for the post:
Hypatia Emerson
User avatar
Lucy Brown
Posts: 27
Joined: Thu Jun 14, 2018 1:55 pm
Location: United Kingdom
Has thanked: 47 times
Been thanked: 41 times

Re: making a script for a ferry to cross water

Post by Lucy Brown »

Thanks Graham, I am so lost with scripting.
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: making a script for a ferry to cross water

Post by Graham Mills »

Apologies for the delay, Lucy. When you get a chance, please try the updated code in the original message.

Thanks

Graham
These users thanked the author Graham Mills for the post:
Lucy Brown
User avatar
Wayfinder Wishbringer
Posts: 5
Joined: Sun Aug 05, 2018 9:26 pm
Has thanked: 3 times
Been thanked: 19 times

Re: making a script for a ferry to cross water

Post 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. : )
Last edited by Wayfinder Wishbringer on Wed Sep 09, 2020 9:26 pm, edited 3 times in total.
These users thanked the author Wayfinder Wishbringer for the post (total 5):
Ilan TochnerSelby EvansGraham MillsLucy BrownAlexina Proctor
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: making a script for a ferry to cross water

Post 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
Last edited by Graham Mills on Sun Aug 26, 2018 4:50 pm, edited 1 time in total.
These users thanked the author Graham Mills for the post (total 3):
Ilan TochnerLucy BrownAlexina Proctor
User avatar
Lucy Brown
Posts: 27
Joined: Thu Jun 14, 2018 1:55 pm
Location: United Kingdom
Has thanked: 47 times
Been thanked: 41 times

Re: making a script for a ferry to cross water

Post by Lucy Brown »

Thank you so much again Graham, I will try it out as soon as I can and report back. :-)
User avatar
Lucy Brown
Posts: 27
Joined: Thu Jun 14, 2018 1:55 pm
Location: United Kingdom
Has thanked: 47 times
Been thanked: 41 times

Re: making a script for a ferry to cross water

Post by Lucy Brown »

AWESOME, thank you so much Graham, working perfect.
These users thanked the author Lucy Brown for the post:
Graham Mills
User avatar
Lucy Brown
Posts: 27
Joined: Thu Jun 14, 2018 1:55 pm
Location: United Kingdom
Has thanked: 47 times
Been thanked: 41 times

Re: making a script for a ferry to cross water

Post 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?
Post Reply