Home   Help Search Login Register  

Author Topic: Bus Route  (Read 666 times)

0 Members and 1 Guest are viewing this topic.

Sol Fire

  • Guest
Bus Route
« on: 05 Mar 2003, 07:49:35 »
hello..

i need help setting up a route for a bus to drive around the map allowing the players to get on and ride to a certain area and get off

i can set up the Waypoints etc..
but i need a script or something that once the bus gets to the waypoint at the bus stop it activates and the bus stops and waits for 10 seconds before moving on to the next bus stop.. i could do it myself with a more complicated method of using triggers but i would much rather use a script to do this.. thanks for your time and help

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Bus Route
« Reply #1 on: 05 Mar 2003, 08:08:30 »
use the time when u put out da WP :-*

CrashnBurn

  • Guest
Re:Bus Route
« Reply #2 on: 05 Mar 2003, 17:11:50 »
Best way is to script it. Use object ID's as waypoints (road section at each bus stop). You won't have to place anything in the editor except the buses. Here's a sample from one of my bus scripts-

;Bus line 1 starts in Loukov moving South
;---------------------------------------------
_unit = _this select 0

#start
? !(canmove _unit): exit
_unit move getpos (object 136176)
@ Unitready _unit
_unit stop true
~1
_unit setdir 90
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop Bitov"
_unit stop false
_unit move getpos (object 136171)
@ Unitready _unit
_unit move getpos (object 134629)
@ Unitready _unit
_unit stop true
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop Lany"
_unit stop false
_unit move getpos (object 274)
@ Unitready _unit
_unit stop true
~1
_unit setdir 90
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop Lipany"
_unit stop false
_unit move getpos (object 6378)
@ Unitready _unit
_unit stop true
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop Okrouhlo"
_unit stop false
_unit move getpos (object 17796)
@ Unitready _unit
_unit move getpos (object 26089)
@ Unitready _unit
_unit move getpos (object 57847)
@ Unitready _unit
_unit move getpos (object 57852)
@ Unitready _unit
_unit move getpos (object 173142)
@ Unitready _unit
_unit stop true
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop St. Sedlo"
_unit stop false
_unit move getpos (object 172484)
@ Unitready _unit
_unit move getpos (object 171664)
@ Unitready _unit
_unit stop true
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop Lipany"
_unit stop false
_unit move getpos (object 171568)
@ Unitready _unit
_unit move getpos (object 31626)
@ Unitready _unit
_unit move getpos (object 6378)
@ Unitready _unit
_unit stop true
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop Lany"
_unit stop false
_unit move getpos (object 6322)
@ Unitready _unit
_unit move getpos (object 274)
@ Unitready _unit
_unit stop true
~1
_unit setdir 90
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop Bitov"
_unit stop false
_unit move getpos (object 134570)
@ Unitready _unit
_unit move getpos (object 134629)
@ Unitready _unit
_unit stop true
? !(canmove _unit): exit
?(getdammage _unit > 0.1 and canmove _unit): _unit setdammage 0
_unit setfuel 1
~random(30) + 30
?(player in _unit): _unit globalchat "Next stop Loukov"
_unit stop false
_unit move getpos (object 136170)
@ Unitready _unit

goto "start"


The only problem that ever arose was the drivers inability to turn the big bus around to repeat the route, so I used setdir at a few locations to help him. The check for dammage is necessary since they tend to bump into things and after a while the dammage would build up to the point where the bus would not run.

Josef

  • Guest
Re:Bus Route
« Reply #3 on: 05 Mar 2003, 18:09:45 »
Just swap GlobalChat for vehicleChat, that way it will work better in co-op...

Sol Fire

  • Guest
Re:Bus Route
« Reply #4 on: 06 Mar 2003, 01:53:19 »
use the time when u put out da WP :-*
what time?

i'll try out that script too thanks crashnburn!

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Bus Route
« Reply #5 on: 06 Mar 2003, 04:24:53 »
Quote
what time?

dat time u c in waypoint's menu

also called "timeout": max/min/avg

max: 10 / min: 10 / avg: 10

will let the bus wait for 10 seconds until it heads over
to it's next waypoint.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Bus Route
« Reply #6 on: 06 Mar 2003, 09:05:03 »
I vote for using waypoints. So much easier.
Not all is lost.

General Goober

  • Guest
Re:Bus Route
« Reply #7 on: 07 Mar 2003, 11:06:07 »
 CrashnBurn , you are the guru of OFP.  That bus route is absolutely brilliant and so easy to use. Thanks mate. I owe you.!!!

I vote for more scripts like these. Just show us how it is done.