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: 41 times
Been thanked: 40 times

Re: making a script for a ferry to cross water

Post by Lucy Brown » Tue Aug 14, 2018 3:55 pm

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: 41 times
Been thanked: 40 times

Re: making a script for a ferry to cross water

Post by Lucy Brown » Tue Aug 14, 2018 3:56 pm

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

Re: making a script for a ferry to cross water

Post by Graham Mills » Sat Aug 25, 2018 7:17 pm

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
Wayfinder Wishbringer
Posts: 1
Joined: Sun Aug 05, 2018 9:26 pm
Has thanked: 0
Been thanked: 4 times

Re: making a script for a ferry to cross water

Post by Wayfinder Wishbringer » Sun Aug 26, 2018 3:40 am

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> )
endwhile

To REVERSE THAT

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

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. : )
These users thanked the author Wayfinder Wishbringer for the post (total 4):
Ilan TochnerSelby EvansGraham MillsLucy Brown
Graham Mills
Posts: 979
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 578 times
Been thanked: 735 times

Re: making a script for a ferry to cross water

Post by Graham Mills » Sun Aug 26, 2018 10:04 am

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 2):
Ilan TochnerLucy Brown
User avatar
Lucy Brown
Posts: 27
Joined: Thu Jun 14, 2018 1:55 pm
Location: United Kingdom
Has thanked: 41 times
Been thanked: 40 times

Re: making a script for a ferry to cross water

Post by Lucy Brown » Sun Aug 26, 2018 4:20 pm

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: 41 times
Been thanked: 40 times

Re: making a script for a ferry to cross water

Post by Lucy Brown » Mon Aug 27, 2018 7:27 pm

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: 41 times
Been thanked: 40 times

Re: making a script for a ferry to cross water

Post by Lucy Brown » Sun Nov 11, 2018 9:12 am

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